Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(G)rab, (R)otate, and (S)cale layers with hotkeys #356

Merged
merged 29 commits into from Aug 30, 2021
Merged

Conversation

0HyperCube
Copy link
Member

@0HyperCube 0HyperCube commented Aug 24, 2021

Closes #317

  • Add new handler
  • Add (neat) bindings to input mapper
  • Handle translation mouse movement
  • Handle rotation mouse movement
  • Handle scale mouse movement
  • Handle constrain to axis
  • Handle number typing
  • Handle shift to slow mouse movements
  • Handle ctrl to snap rotation and scale
  • Fix 0 scale breaking things
  • Fix deselecting layers sometimes causing panic (trouble reproducing)

This change is Reviewable

@cloudflare-pages
Copy link

cloudflare-pages bot commented Aug 25, 2021

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1a2fec6
Status: ✅  Deploy successful!
Preview URL: https://f2eba157.graphite-master.pages.dev

View logs

@0HyperCube 0HyperCube changed the title Add handler and input mapping. Grab scale and rotate layers with keyboard shortcuts Aug 25, 2021
@Keavon
Copy link
Member

Keavon commented Aug 26, 2021

I just played with the branch and this is super awesome! I really wish other tools like Illustrator had this functionality. This will be popular for sure.

@TrueDoctor
Copy link
Member

Btw, just wanted to mention that I appreciate this work a lot. I will help to keep things organized so thanks!

@0HyperCube 0HyperCube marked this pull request as ready for review August 26, 2021 10:21
@0HyperCube 0HyperCube marked this pull request as draft August 26, 2021 10:44
@Keavon Keavon changed the title Grab scale and rotate layers with keyboard shortcuts Grab, scale, and rotate layers with hotkeys Aug 26, 2021
@Keavon Keavon changed the title Grab, scale, and rotate layers with hotkeys (G)rab, (S)cale, and (R)otate layers with hotkeys Aug 26, 2021
@Keavon
Copy link
Member

Keavon commented Aug 26, 2021

Fix deselecting layers sometimes causing panic (trouble reproducing)
I noticed the same thing, but didn't have time to try reproducing. If you get stuck on this, I can lend some time tomorrow trying to pin it down.

@0HyperCube 0HyperCube marked this pull request as ready for review August 28, 2021 10:27
@Keavon
Copy link
Member

Keavon commented Aug 28, 2021

Some UX observations/requests:

  • If the user aborts (Esc/right click), it should return to the original transform even if the user successively hit G, R, and S to switch between modes)
  • Please make it so the minus key toggles between positive and negative numbers that the user types. So they might type -1 to scale by negative 1, or -.5- to scale by positive 0.5. If only a minus key is pressed, but no numbers entered, nothing should happen yet and the mouse should still have normal control over it.
  • Multiple presses of the decimal point key should only count the first one, and discard subsequent ones, as far as Backspace is concerned. Currently if you type numbers and decimal points together, it will delete the decimal point and cause no visible change (since it's not the first decimal point) but it should instead delete the next number from the sequence. The minus key should also not affect the backspace key at all, it minus should just toggle signs but not be part of the queue. You might want the very last backspace (when the list of values is empty) to reset the sign back to positive, though, to avoid confusing users who accidentally hit minus and can't figure out why they are stuck with negative numbers.
  • While in number entry mode, I wonder if there's a way to block all other keyboard input (so you can't, for example change tools)?

@0HyperCube
Copy link
Member Author

While in number entry mode, I wonder if there's a way to block all other keyboard input (so you can't, for example change tools)?

@Keavon You'd probably have to refer to @TrueDoctor but my guess is that this would not be trivial.

@TrueDoctor
Copy link
Member

While in number entry mode, I wonder if there's a way to block all other keyboard input (so you can't, for example change tools)?

@Keavon You'd probably have to refer to @TrueDoctor but my guess is that this would not be trivial.

Should be pretty easy, just add a InputMapper::MaskEvents message

@Keavon
Copy link
Member

Keavon commented Aug 28, 2021

If the user aborts (Esc/right click), it should return to the original transform even if the user successively hit G, R, and S to switch between modes)

@Keavon That is somewhat difficult with the current architecture. Looking at blender, if you are translating and then you rotate, the translate is reverted. Would this be acceptable behaviour?

Sure, that would be equally acceptable.

@Keavon
Copy link
Member

Keavon commented Aug 28, 2021

Bug: when snapping a rotation, it doesn't let me snap back to the starting rotation (it skips that 15 degree increment, you can't go to 0 degrees, only the +15 or -15 surrounding it). Same deal for scale snapping: I can't snap to 1.0, only 0.9 or 1.1.

@0HyperCube
Copy link
Member Author

Bug: when snapping a rotation, it doesn't let me snap back to the starting rotation (it skips that 15 degree increment, you can't go to 0 degrees, only the +15 or -15 surrounding it). Same deal for scale snapping: I can't snap to 1.0, only 0.9 or 1.1.

Fixed

@0HyperCube
Copy link
Member Author

If the user aborts (Esc/right click), it should return to the original transform even if the user successively hit G, R, and S to switch between modes)

@Keavon That is somewhat difficult with the current architecture. Looking at blender, if you are translating and then you rotate, the translate is reverted. Would this be acceptable behaviour?

Sure, that would be equally acceptable.

Done

@0HyperCube
Copy link
Member Author

Should be pretty easy, just add a InputMapper::MaskEvents message

@TrueDoctor What trigger should be used and how should it know only to advertise if the layer is being transformed?

@TrueDoctor
Copy link
Member

TrueDoctor commented Aug 29, 2021

Should be pretty easy, just add a InputMapper::MaskEvents message

@TrueDoctor What trigger should be used and how should it know only to advertise if the layer is being transformed?

So do you want to mask all keyboard input?
That would be something like:

(Ready, StartDragging) => {
  responses.push_back(InputMapperMessage::MaskKeyboardInputs)}
  (Dragging, StopDragging) => {
    responses.push_back(InputMapperMessage::UnmaskKeyboardInputs)
  }

@0HyperCube
Copy link
Member Author

0HyperCube commented Aug 29, 2021

@TrueDoctor It would still need typing numbers, x and y to constrain axis etc, this was why I believed it to be non trivial.

@TrueDoctor
Copy link
Member

@0HyperCube @Keavon suggested adding different "input modes" that you could define. Like separate mapping definition files that you could switch between, but I don't know what the best approach for that would be.
You can think about a better solution I would need a bit of time and thought to come up with a better one

@0HyperCube
Copy link
Member Author

0HyperCube commented Aug 29, 2021

@Keavon Are you fine without it for this for this PR?

@Keavon
Copy link
Member

Keavon commented Aug 30, 2021

I'm happy with the features and UX. We can save input mode switching for another PR. I still want to review this for code quality though. I'll try to do that in an hour or two.

@Keavon Keavon changed the title (G)rab, (S)cale, and (R)otate layers with hotkeys (G)rab, (R)otate, and (S)cale layers with hotkeys Aug 30, 2021
@Keavon
Copy link
Member

Keavon commented Aug 30, 2021

@TrueDoctor what are your thoughts on having the unreachable!() branch arms and the places where unwrap() is used?

@0HyperCube 0HyperCube merged commit a6c57be into master Aug 30, 2021
@0HyperCube 0HyperCube deleted the transform-layer branch August 30, 2021 17:04
Keavon added a commit that referenced this pull request Jun 16, 2022
* Add handler and input mapping.

* Selecting transform type

* Add translation and axis constraints

* Remove unnecessary Key::

* Add rotation

* Centre pivot point for rotation

* Add scaling

* Select Tool bounding box now updates when transforming

* Add typing

* Shift to slow mouse movements

* Add snapping

* Refactor modifier keys

* Refactor to apply only 1 operation per frame

* Refactor to fix scale 0 issue

* Remove logging

* Avoid multiple decimol points in queue

* Add typing negative

* Add typing negative values

* Fix bounding box on apply/abort; fix some variable names

* Allow transform to daffine2 identity

* Revert previous operation when changing operation

* Remove repopulate transforms method

* Code readability tweaks

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Keavon added a commit that referenced this pull request Jun 17, 2022
* Improve web infrastructure

Upgrade npm packages that were locked to old versions due to now-resolved problems
Remove unused/unnecessary dependencies and their configurations
Fix VS Code format on save
Fix VS Code removing EOF newline in JSON files in conflict with npm
Remove JSON files from ESLint because it doesn't properly support JSON
Add detailed comments to web-related configuration files

* Minor code readability improvements

* Fix bug where swiching to the Fill Tool would trigger a fill operation

* Add two-way tool option messaging system between frontend/backend (#361)

* Add two-way tool option messaging system

* Rename tool option functions

* Move repeated frontend messaging code to function

* Address style comments

* Rename variable to be more descriptive

* Move tool options update to SetActiveTool message

* Refactor record of all tool options

* Only pass active tool options to bar

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Implement anchor and handle point rendering with the Path Tool (#353)

* Implement Path Tool

* Draw a red rectangle where the first point on the shape is

* Correctly render anchors, handles, and connecting lines

* Fix drain() which can panic

* Refactor frontend messages to work as return values not callbacks

* Reduce the number of unnecessary frontend updates

* Fix stack overflow by using a loop

* Group Document Render calls and put them at the end

* Speed hacks for dirtification

* Add performance

* Bunch folder changed updates

* Add triggers to redraw overlays to movement_handler

* Polish the pixel-perfect rendering of vector manipulators

* Restore scrollbars that were disabled

* Cleanup

* WIP Add shape outline rendering

* Fix compiling

* Add outlines to selected shapes

* Fix outlines rendering over handles and anchors

* Fix dirtification

* Add a comment

* Address code review feedback

* Formatting

* Small tweaks

Co-authored-by: Oliver Davies <oliver@psyfer.io>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>

* Add folders to frontend and folder creation to backend (#315)

* Add folders to frontend and folder creation to backend

Closes #149

* Add Group keybind

* Add logic to handle expanding of folders

* Send all paths as (u32, u32)

* Add custom serialization for path

* Merge two layer_panel files

* Refactor frontend layer merging

* Fix JS linting

* Update upstream thumbnail changes

* Add paste into selected folder + fix thumbnail dirtification

* Implement CollapseFolder function

* Skip folders on a different indentation level during reorder

* Only reorder within the same folder

* Add folder node icon for folder layers

* Add expand/collapse folder button; partly implement new layer tree design

* Update terminology in the docs

* Add number labels to ruler marks

* Replace promise with await in MenuList.vue

* Miscellaneous minor code cleanup

* Disallow snake_case variable names in frontend

* Add support for saving and opening files (#325)

* Add support for saving a document

This is similar to the "export" functionality, except that
we store all metadata needed to open the file again.

Currently we store the internal representation of the layer
which is probably pretty fragile.

* Add support for opening a saved document

User can select a file using the browser's file input selector.
We parse it as JSON and load it into the internal representation.

Concerns:
- The file format is fragile
- Loading data directly into internal data structures usually creates
security vulnerabilities
- Error handling: The user is not informed of errors

* Serialize Document and skip "cache" fields in Layer

Instead of serializing the root layer, we serialize the
Document struct directly. Additionally, we mark the
"cache" fields in layer as "skip" fields so they
don't get serialized.

* Opened files use the filename as the tab title

* Split "new document" and "open document" handling

Open document needs name and content to be provided so having a
different interface is cleaner. Also did some refactoring to reuse code.

* Show error to user when a file fails to open

* Clean up code: better variable naming and structure

* Use document name for saved and exported files

We pass through the document name in the export and save
messages. Additionally, we check if the appropriate file
suffixes (.graphite and .svg) need to be added before
passing it to the frontend.

* Refactor document name generation

* Don't assign a default of 1 to Documents that start with something
  other than DEFAULT_DOCUMENT_NAME
* Improve runtime complexity by using binary instead of linear search

* Update Layer panel upon document selection

* Add File>Open/Ctrl+O; File>Save (As)/Ctrl+(Shift)+S; browse filters extension; split out download()/upload() into files.ts; change unsaved close dialog text

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Refactor ViewportPosition from u32 (UVec2) to f64 (DVec2) (#345)

* Refactor ViewportPosition from u32 (UVec2) to f64 (DVec2)

* Fix pseudo_hash call

* Replace hash function with proper function for uuid generation

* Cargo fmt

Co-authored-by: Dennis Kobert <dennis@kobert.dev>

* Improve Frontend -> Backend user input system (#348)

Includes refactor that sends coordinates of the document viewports to the backend so input is sent relative to the application window
Closes #124
Fixes #291

* Improve Frontend -> Backend user input system

* Code review changes

* More code review changes

* Fix TS error

* Update the readme

* Make scrollbars interactable (#328)

* Make scrollbars interactable

* Add watcher for position change

* Fix case of data

* Fix updateHandlePosition capitalization

* Clean up class name thing

* Scroll bars between 0 and 1

* Allow width to be 100%

* Scrollbars reflect backend

* Include viewport in scrollbar

* Add half viewport padding for scrollbars

* Refactor scrollbar using lerp

* Send messages to backend

* Refactor

* Use glam::DVec2

* Remove glam::

* Remove unnecessary abs

* Add TrueDoctor's change

* Add missing minus

* Fix vue issues

* Fix viewport size

* Remove unnecessary log

* Linear dragging

* Improve scrollbar behavior (#351)

* Change scrollbar behavior

* Leave space at the end of the scrollbar

* Change mid to center

* Use shorter array initialization

* Add space around scrollbar

* Fix scrollbar spacing

* Smooth end of scrollbars

* Add page up and down

* Page up and down on click in scrollbar track

* Add shift pageup to translate horizontally

* Implement bounding box for selected layers (#349)

* Implement bounding box for selected layers

* Add shift modifier for multi selection

* Fix collapsing of folders

* Add have pixel offset to selection bounding box

* Don't panic on Ctrl + A

* Rename to camel case

* Add todo comment for Keavon

* Apply @Hypercubes review suggestions

* Fix many panics, improve behavior of copy/paste and grouping (but grouping still can panic)

Co-authored-by: Dennis Kobert <dennis@kobert.dev>

* Add space key & drag to pan the canvas (#364)

* (G)rab, (R)otate, and (S)cale layers with hotkeys (#356)

* Add handler and input mapping.

* Selecting transform type

* Add translation and axis constraints

* Remove unnecessary Key::

* Add rotation

* Centre pivot point for rotation

* Add scaling

* Select Tool bounding box now updates when transforming

* Add typing

* Shift to slow mouse movements

* Add snapping

* Refactor modifier keys

* Refactor to apply only 1 operation per frame

* Refactor to fix scale 0 issue

* Remove logging

* Avoid multiple decimol points in queue

* Add typing negative

* Add typing negative values

* Fix bounding box on apply/abort; fix some variable names

* Allow transform to daffine2 identity

* Revert previous operation when changing operation

* Remove repopulate transforms method

* Code readability tweaks

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Dispatcher::handle_message does not need Result anymore (#365)

* Dispatcher::handle_message does not need Result anymore (1)

Callers can get rid of result handling, too.

* Dispatcher::handle_message does not need Result anymore (2)

* Dispatcher::handle_message does not need Result anymore (3) cargo fmt

* Additional WASM translation layer cleanup

* Bump tar from 5.0.7 to 5.0.11 in /frontend (#367)

Bumps [tar](https://github.com/npm/node-tar) from 5.0.7 to 5.0.11.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v5.0.7...v5.0.11)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Show a crash dialog when the editor panics (#362)

* Show a crash dialog when the editor panics

Closes #357

* Suppress console usage lints

* Proxy cleanup and comments

* Improve and clean up panic dialog code and wasm wrapper (#368)

Part of #357

* Reorganize and clean up the WASM wrapper

* Postpone 0.1 launch in readme from Aug to early Sept

* Upgrade wasm-pack to 0.10.1 (#369)

Closes #167

* Auto-generate third-party license notices (#370)

Closes #294
Closes #371

* Additional improvements to license notice formatting

* Add function to serialize the layer structure to a 1D array (#363)

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Change scrollbar drag color

* Add an intentional panic for debug

* Hook up layer tree structure with frontend (#372)

* Hook up layer tree structure with frontend (decoding and Vue are WIP)

* Fix off by one error

* Avoid leaking memory

* Parse layer structure into list of layers

* Fix thumbnail updates

* Correctly popagate deletions

* Fix selection state in layer tree

* Respect expansion during root serialization

* Allow expanding of subfolders

* Fix arrow direction

Co-authored-by: Dennis Kobert <dennis@kobert.dev>

* Add proper type annotations for panicProxy (#378)

* Do not silently install cargo-about. (#377)

* Fix deployment script (#380)

* id-based-docs (#376)

* Added some notes on what ds to use for the documents.

* Added a separate list of ids to associate ID to doc. Looks up all
documents by id to retrieve an index via linear search.

* Fixed function name.

* Removed id recycling, replaced document vector with hashmap.

* Uses the same logic for PrevDocument in closing

* Implement interactive scaling/motion of rulers (#306) (#385)

* Update ruler origin

* Fix ruler text

* Handle zoom

* Remove log

* Fix origin

* Upgrade Graphite to Rust 2021 edition; upgrade dependencies (#387)

* Upgrade Graphite to Rust 2021 edition; upgrade dependencies

* Fix CI

* Move changes to the project Cargo.tomls

* Remove unnecessary 2021 edition upgrade tweak

* Show version number before and after updating rustc

Co-authored-by: Dennis Kobert <dennis@kobert.dev>

* Replace vue-svg-loader dependency with simple JS file (fixes a security alert) (#389)

* Update notice for Safari users that BigInt64Array is now supported in 15 (#390)

* Update various node dependencies (#391)

* Upgrade rustfmt to 2021 edition

* Layer snapping

* Test snapping

* Snap new shapes

* Fix snapping when zoomed

* Refactor to use viewport bounds

* Reduce snap tolerance to 3

* Snap line and path tool

* Add disable snapping and refactor

* new_snap -> new status

* Rearrange import

* Cleanup

* Fix incorrect variable name

* Store snap data in tool data

* Switch to Node.js 16 LTS, upgrade TypeScript, ESLint, and other dependencies (#395)

* Upgrade TypeScript, ESLint, and other dependencies

This also cleans up various other files where newer ESLint rules complained

* Set CI and CD to use Node.js version 16

* Small tweak

* Fix CD version printing

* Add nvm version for Cloudflare Pages

* Display Asterisk on Unsaved Documents (#392)

* ability to mark an open document as unsaved

* unsaved detection now being triggered based on layer tree height

* - rust implementation of unsaved markers
- upgraded eslint

* updated eslint in package.json

* - Renamed GetOpenDocumentsList -> UpdateOpenDocumentsList
- is not -> was not

* changed hash to current identifier to better reflect its meaning

* resolve some merge conflicts

* removed console.log statement leftover from debuging

* Confirm when the browser window is closed and there is unsaved work (#397)

* - browser confirmation on page exit
- prompt to save a document when closed will only trigger when unsaved

* add back select document for close prompt

* - name -> displayname
- add preventPropigation to middle click

* CSS editor layout fixes and scrolling

Major CSS improvements to layout at small screen sizes. By adding min-width: 0 and min-height: 0 on the nested display: flex structure, widgets no longer coerce the whole layout into large-scale resizing. Scrollbars are now used to allow correct overflowing of the tab bar (fixes #177), Document Panel options bar, and tool shelf. Improvements to responsive resizing are also included for viewing the UI correctly on mobile now. Additional small fixes to styling of widget colors and corner roundness. The ruler has been darkened one shade to improve text contrast and aesthetics.

* Change responses to use classes instead of interfaces (#394)

* ability to mark an open document as unsaved

* unsaved detection now being triggered based on layer tree height

* Changed responses to use classes instead of interfaces

* - rust implementation of unsaved markers
- upgraded eslint

* updated eslint in package.json

* - Renamed GetOpenDocumentsList -> UpdateOpenDocumentsList
- is not -> was not

* changed hash to current identifier to better reflect its meaning

* resolve some merge conflicts

* removed console.log statement leftover from debuging

* - changed Response to jsMessage
- split files
- Array<> -> []

* -remove path from UpdateLayer

* - remove unused if statements

* - comment for reflect-metadata
- registerJsMessageHandler -> subscribeJsMessage
- readonly message properties
- fixed binding filename and comment
- toRgb -> toRgba

* - newOpacity -> transformer
- added comments

* MessageMaker -> messageMaker

* Fix ESLint configuration triggering an error in the ESLint VS Code extension

* Switch CI and CD scripts to use `npm ci` instead of `npm install`

* Enable vertical scroll wheel on horizontal scrollable containers

* Fix bug in last commit that broke when scrolling on SVG elements

* Fix blend mode serialization and de-serialization to match (#400)

* Update the project readme

* Fix floating menus above scrollable content; they now respect content's preferred width at edges

* Clean up JS message dispatcher and fix a bug thrown on empty-data messages

Fixes bug in #394

* Add the Help > About Graphite dialog with build info

Closes #404

* Make deployment switch branch from HEAD to master

* Rework wasm initialization and reduce global state (#379)

* wasm: do the async initialization only once

This allows the rest of the app to access wasm synchronously.

This allows removing of a global.

* provide the wasm via vue provide/inject.

There's still code directly accessing the wasm. That will be changed later.

* MenuBarInput: use injected wasm instead of the global instance

* Let the App handle event listeners

* move stateful modules into state/

* state/fullscreen: create per instance

* App: load the initial document list on mount.
This got lost a few commits ago. Now it's back.

* state/dialog: create per instance

* util/input: remove dependency on global dialog instance

* state/documents: create per instance

* reponse-handler: move into EditorWasm

* comingSoon: move into dialog

* wasm: allow instantiating multiple editors

* input handlers: do not look at canvases outside the mounted App

* input: listen on the container instead of the window when possible

* - removed proxy from wasm-loader
- integrated with js-dispatcher
- state functions to classes
- integrated some upstream changes

* fix errors caused by merge

* Getting closer:
- added global state to track all instances
- fix fullscreen close trigger
- wasm-loader is statefull
- panic across instanes

* - fix outline while using editor
- removed circular import rule
- added editorInstance to js message constructor

* - changed input handler to a class
- still need a better way of handeling it in App.vue

* - fixed single instance of inputManager to weakmap

* - fix no-explicit-any in a few places
- removed global state from input.ts

* simplified two long lines

* removed global state

* removed $data from App

* add mut self to functions in api.rs

* Update Workspace.vue

remove outdated import

* fixed missing import

* Changes throughout code review; note this causes some bugs to be fixed in a later commit

* PR review round 1

* - fix coming soon bugs
- changed folder structure

* moved declaration to .d.ts

* - changed from classes to functions
- moved decs back to app.vue

* removed need to export js function to rust

* changed folder structure

* fixed indentation breaking multiline strings

* Fix eslint rule to whitelist @/../

* Simplify strip-indents implementation

* replace type assertions with better annotations or proper runtime checks

* Small tweaks and code rearranging improvements after second code review pass

* maybe fix mouse events

* Add back preventDefault for mouse scroll

* code review round 2

* Comment improvements

* -removed runtime checks
- fixed layers not showing

* - extened proxy to cover classes
- stopped multiple panics from logging
- Stop wasm-bindgen from mut ref counting our struct

* cleaned up messageConstructors exports

* Fix input and fullscreen regressions

Co-authored-by: Max Fisher <maxmfishernj@gmail.com>
Co-authored-by: mfish33 <32677537+mfish33@users.noreply.github.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Skip cargo-about in CI to save 5 minutes (#409)

* Upgrade node packages (#413)

* Fix undefined behavior in the editor wasm bridge (#414)

* removed possible undifined behavior

* changed naming of Editor -> JsEditorHandle

* fix rust formatting

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Set Cargo.toml versions to 0.0.0 to avoid version confusion

* Change mouse to pointer events (#403)

* Change mouse to pointer events

* Add `npm start` command

* Change all mouse to pointer events;
Fix `touch-action: none;`

* Merge with master

* Fix middle mouse click

* Remove console.log

* Delete the empty line

* Re-add middle click auto-scroll blocking

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Skip the web page close confirmation when crashed or in debug mode

* Make the Pen Tool confirm when leaving the tool

* Move layer selection logic from vue to editor (#410)

* Add vue selectLayer(layer, ctrl, shift)

* Individual selection working, range fill next

* Frontend package-lock.json seems apparently needs to be pushed. Weird.

* Selection working with ctrl, shift from editor. Still some bugs to sqaush with folder nesting.

* WIP resolving nesting folders issues

* Changed comparison approach, handling corner cases now

* Fully working selection.

* Reverted changes to package-lock.json

* Removed unused code

* Resolved ctrl click not behaving similar to windows

* Slight comment clarification

* Double checked a windows behavior and corrected. Changed last_selected name.

* Simplified if statement slightly.

* Made the naming clearer regarding UUIDs versus indices

* Clarified comments further

* Minor comment fixup

* Implemented suggestions, clarified comments

* Resolved todo regarding clearing selection when ctrl not pressed

* Ensure we only push responses when needed

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Reviewed by: @TrueDoctor <3

* Fix new document position (#421)

* Fix new document pos

* All new documents are centered before deserialization

* Move constructors to the top of to block

* Fix merge (moving coe around is a bad idea)

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add a temporary solution to non-Latin keyboards being unusable

* Fix previous commit by mapping codes to keys

* Implement input hints based on the active tool state (#388)

* Hook up user input hints to display in the frontend status bar

Closes #171

* MVP hint system based on tool FSM

* Fix hints for Fill and Eyedropper tools

* Add icons for keyboard shortcuts

* Fix hints for Pen Tool

* Cleanup

* Implement outline view mode (#401)

* Created wasm binding to action's of the radio buttons which control the view mode
Added entry to DocumentMessage Enum

* draw in wireframe mode by changing parameters on each shape
added functions/changed behavior to do as above
not working yet
   - newly added shapes should be drawn in wireframe
   - setting fill to "none" on a path does not only draw an outline
      - maybe the stroke width is 0?

* Wire frame view mostly functional for ellipses
   - Need to implement for all shapes
   - BUG: shapes don't immediatley update upon changing view-mode

* Fixed: active document now updates after view mode swap

* The Pros:
   - wire frame mode effects all shapes correctly

The Cons:
   - wire frame mode effects everything, including things that maybe shouldn't be, like select boxes and pen lines

* wire frame view no longer effects overlay layers

* Fixed: While in wireframe view the pen tool will draw regular thickness lines.

* some commenting

* Fixed potential bug:
   In layer/file system with a Folder layer with a sub-layer that is also
   a Folder cache_dirty must be set in order for all shapes to update properly

* refactored code to use ViewMode enum names throughout

* Changed: All wireframe lines are blank
cargo fmt

* Wireframe thickness doesn't change as a result of zooming
   - Added DocumentMessage::ReRenderDocument, which marks layers as dirty and renders with the updated render-string
   - All "zoom" messages in the movement_handler send a re-render message
   - while in wireframe view, the "render-transform" of all shapes includes the root layer transform

Added getter/setter methods for graphene::Document::view_mode

* cargo fmt

* wireframe now has proper thickness after "Zoom Canvas to Fit all" action

* Refactored
   - Changed FrontendMessage::UpdateCanvas to RenderDocument message to allow for lazy evaluation
   - Created DocumentOperation::SetViewMode to be more consistent with existing code
   - removed log statement
   - Added constants for empty fill and thin-black stroke

* cargo fmt

* Removed ReRenderDocument message

* cargo fmt

* Fixes as suggested by TrueDoctor

* clean up merge
cargo fmt

* Refactor:
   moved view_mode to DocumentMessageHandler

* Polishing

* changed those two comments

* Remove unknown todo comment

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Remove all use of document indices (#406)

* removed all use of document indicies

* -add u64 support for wasm bridge

* fixed rust formating

* Cleaned up FrontendDocumentState in js-messages

* Tiny tweaks from code review

* - moved more of closeDocumentWithConfirmation to rust
- updated serde_wasm_bindgen to add feature flag

* changed to upsteam version of serde_wasm_bindgen

* cargo fmt

* -fix event propigation on delete
- Js message change class extention to typedef

* changed another typedef

* cargo fmt

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Fix bug where duplication with Ctrl+D doesn't properly duplicate (#423)

* bug fix: duplication didn't properly duplicate

* cargo fmt

* changed the formatting slightly for readability

* Implement IndexedDB document auto-save (#422)

* removed all use of document indicies

* -add u64 support for wasm bridge

* fixed rust formating

* Cleaned up FrontendDocumentState in js-messages

* Tiny tweaks from code review

* - moved more of closeDocumentWithConfirmation to rust
- updated serde_wasm_bindgen to add feature flag

* working initial auto save impl

* auto save is a lifetime file

* - cargo fmt
- fixc error message
- move document version constant

* code review round 1

* generate seed for uuid in js when wasm is initialized

* Resolve PR feedback

* Further address PR feedback

* Fix failing test

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: otdavies <oliver@psyfer.io>

* Fix Ctrl+scroll wheel zoom point relative to the mouse position (#429)

* Fix zoom

* Cleanup maths

* Snap while dragging with select tool (#433)

* Snap while dragging with select tool

* Remove unnecessary mut

* Snap to 90 degrees instead of 45

* Removed (coming soon) text

Co-authored-by: otdavies <oliver@psyfer.io>

* Fix console error caused by the Pen Tool (#432)

* Fix error in pen tool

* Cleanup

* Split make operation and remove preview

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Fix line centering (#431)

* Implement multiple clipboards (#425)

* Imeplement multiple Clipboards

* Cargo fmt

* Fix unit tests

* Fix console error caused by the Pen Tool (#432)

* Fix error in pen tool

* Cleanup

* Split make operation and remove preview

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Fix line centering (#431)

* cargo fmt

Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>

* Change the select tool to immediately start dragging when clicking a shape (#424)

* Change the select tool to immediately start dragging when clicking a shape

* Fix operation order

* Fix holding shift to add to selection

* Update intoiter syntax (#436)

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Remove snap rotate from layerdata (#435)

* Fix the File > Close All crash (#438)

* Populate layer entry cache (#437)

* Populate layer entry cache

* Serialize the DocumentMessageHandler

* Fix restoring of collapsed/expanded state, add iter impl for Layer, and clean up layer_data() functions

* Fixed bug with CreateEmptyLayer revealed by test

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: otdavies <oliver@psyfer.io>

* Add cut, copy, and paste to the Edit menu (#440)

* Add cut

* Hook up edit dropdown

* Use copy message

* Drag to rearrange layers in the layer panel (#434)

* Add insert line

* Implement dragging

* Improve CSS and variable naming consistency

* Resolved folder crash, added Undo/Redo support

* Removed marker TODO leftover

* JS cleanup

* WIP preserving expanded state (via LayerData) when copy/pasting and moving layers in layer panel

* Finish making folders copy/paste preserving expanded state, but not recursively yet

* Add cut, copy, and paste to the Edit menu (#440)

* Add cut

* Hook up edit dropdown

* Use copy message

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: otdavies <oliver@psyfer.io>

* New overlay system that reimplements how overlays are drawn (#418)

* New overlay system that reimplements how overlays are drawn

* Fix overlay message declaration

* Fix small mistake

* WIP (broken) changes to plumb the overlay document

* Fix confusion over messaging system architecture

* Removed log

* Overlay system working

* (broken) WIP overlay association

* Finish the overlay system (except test failure)

* Change back IDs in test

* Fixed test, but stilled fails due to revealed real problem with layer reordering selection

* Disable broken test that has a bug in issue #444

Co-authored-by: Dennis <dennis@kobert.dev>
Co-authored-by: otdavies <oliver@psyfer.io>

* Fix one item folders (#442)

* Remove transformations from LayerData (#439)

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add navigate tool (#441)

* Remove transformations from layerdata

* Clean up snap rotate

* Enable the navigate tool

* Implement navigate tool

Co-authored-by: otdavies <oliver@psyfer.io>

* Fix all clippy lint errors

* Rename Editor's LayerData to LayerMetadata

* Major frontend code cleanup (#452)

Many large changes, including:
- TypeScript enums are now string unions throughout
- Strong type-checking throughout the TS and Vue codebase
- Vue component props now all specify `as PropType<...>`
- Usage of annotated return types on all functions
- Sorting of JS import statements
- Explicit usage of Vue bind attribute function call arguments (`@click="foo"` is now `@click=(e) => foo(e)`)
- Much improved code quality related to the color picker
- Consistent camelCase Vue bind and v-model attributes
- Consistent Vue HTML attribute strings with single quotes
- Bug fix and clarity improvement with incorrect hint class parameters
- Empty Vue component objects like `props: {}` and `components: {}` removed

* Vue/TS bug and bad typing fixes

* Fix to send panic message to all editor instances immediately upon crash (#460)

* Fix group creation parenting (#455)

* WIP fix of folder crash / indent

* Fixed most crashes

* Known cases of crash / incorrect behavior resolved

* Removed todo & readability tweak

* Removed left over test

* Resolved clippy issue resulting from merging master

* Replace recursive tree traversal with prefix matching

* Reverted changes for #453 and added undo functionality to Paste

* Make uuid generator thread local for tests

* Maintain layer order, test still failing 50% of the time

* Reverting back to known working with the knowledge we can optimize later.

This reverts commit 1aaf5c0d7dbe67cd9f4ba8b536a4771a2cef6439.

* Revert "Make uuid generator thread local for tests"

This reverts commit d68e3b9c4ebf639c4b2ecae43f5ad3d060dcb12b.

* Revert "Reverted changes for #453 and added undo functionality to Paste"

This reverts commit d66992ac9440f244d461a6a815ae2a08eede47d7.

* Revert "Replace recursive tree traversal with prefix matching"

This reverts commit 6bcbb9f82f62b1f9aa00287110fbce64e1d2f0db.

* Reverted to working state and added comment back to optimized commit hash

* Re-removed the changes involving #453

Co-authored-by: Dennis <dennis@kobert.dev>

* Fix build script to use correct branch name

* Better decimal rounding in the NumberInput widget (#457)

* better decimal rounding in NumberInput

* - created function to reuse
- used math instead of string manipulation

* updated comment to be correct

* updated comment

* updated comment

* Tidy up path handling in document_file (#464)

* Tidy up path handling in document_file

+ Improve #455

* Cargo Clippy lints

* Rename to_vec to map_to_vec

Co-authored-by: Oliver Davies <oliver@psyfer.io>

* Ungroup layers (#465)

* WIP handling corner cases, like ungrouping subfolders

* Resolved hanging

* Fix recursive ungrouping

* Functional, corner case free Ungroup. Small Undo issue & warnings

* Update layertree upon undo

* Also update  layerdata upon redo

* Add some polish

* Resolved TODOs

* Oops didn't save all after rename, ha.

Co-authored-by: Dennis <dennis@kobert.dev>

* Redesign the Layer Tree UI (#468)

* Path Tool: Implement anchor point dragging (#451)

* #82 path-tool: WIP selecting control point working

* Fix bug where duplication with Ctrl+D doesn't properly duplicate (#423)

* bug fix: duplication didn't properly duplicate

* cargo fmt

* changed the formatting slightly for readability

* Small cleanups, changed color of handles upon selection

* Fix changes from merge

* Remove duplicate anchor points on top of one another

* Fix possible issues with thumbnails not being updated from Graphene operations

* path-tool: attempt to move control points on click

* Add dragging for control points

* Editing shape anchors functional. Handles next.

* Comment cleanup & slight cleanup of closest_anchor(..)

* Removing conflict with master

* Tiny code tweaks

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: caleb <56044292+caleb-ad@users.noreply.github.com>
Co-authored-by: otdavies <oliver@psyfer.io>
Co-authored-by: Dennis <dennis@kobert.dev>

* Implement artboards and document version enforcement (#466)

* - graphite document artboard implementation
- autosave document load hitch fix
- Autosave will delete saved files when graphite document version changes

* formating

* - top left 0,0
- fixed hitch on first document
- vue calls first render

* Revert

* Merge branch 'master' into artboards

* Small bug fixes and code review tweaks

Co-authored-by: Oliver Davies <oliver@psyfer.io>
Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add support for resizing workspace panels (#443)

* Resize panels

* Removing move_selection test pending #444 resolved

* Bind event listners and cursor to the document

* Fix flex grow on document being reset when drawing

* Call onresize when the boundry is dragged

* Add min panel size

* Add explicit function return types

* Dispatch resize event

* Lock pointer instead of setting cursor on document

Co-authored-by: otdavies <oliver@psyfer.io>
Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Enhance the Navigate Tool zoom behavior (#461)

* Snap zoom

* Navigate zoom from centre

* Ctrl to snap zoom in navigate

* Use ctrl for global snap rotate

* Fix the rotation input on snap rotate

* Update hint to use ctrl

* Fix mouse centre on drag

* Click to zoom in

* Clean up centre zoom

* Update user input hints; tweak some variable names for clarity and standardization

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Fix rotation input (#472)

* Fix bounds with artboards for zoom-to-fit and scrollbar scaling (#473)

* - document load keeps postition
- zoom to fit
- scrollbars use artboard dimensions

* - review comments
- svg export uses all artboard bounds

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Fix NumberInput clamping regression with undefined bounds

* Remove Charcoal references from the code for now

* Switch VS Code's Vue extension from Vetur to Volar

* Add `npm start` script alias for `npm run serve`

* Migrate to using MoveSelectedLayersTo (#469)

* migrate to using MoveSelectedLayersTo

* Fix dragging a selected layer with multiple selected layers

* Fix CreatedLayer overriding selection

* Fix MoveSelectedLayersTo behaviour

* Squashed commit of the following:

commit 095d577a49f6b904ba3038327109860e5519f981
Author: Keavon Chambers <keavon@keavon.com>
Date:   Mon Jan 10 18:06:12 2022 -0800

    Fix NumberInput clamping regression with undefined bounds

commit 9f54a376c4ad20a60731bb4a4eca5a25001fcfd1
Author: mfish33 <32677537+mfish33@users.noreply.github.com>
Date:   Sun Jan 9 15:52:55 2022 -0800

    Fix bounds with artboards for zoom-to-fit and scrollbar scaling (#473)

    * - document load keeps postition
    - zoom to fit
    - scrollbars use artboard dimensions

    * - review comments
    - svg export uses all artboard bounds

    Co-authored-by: Keavon Chambers <keavon@keavon.com>

commit 61432de4801d63d62faa18aaa624b11a122a97b1
Author: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Date:   Sat Jan 8 21:06:15 2022 +0000

    Fix rotation input (#472)

* Fix insert with no nesting at end of panel

* Deselect other layers on paste

* Resolve logging

* Rename document_message_handler.rs to portfolio_message_handler.rs

* Rename DocumentsMessage to PortfolioMessage

* Rename document_file.rs to document_message_handler.rs

* Standardize FrontendMessage message names

* Sort messages and message handlers

* Massively reorganize and clean up the whole Rust codebase (#478)

* Massively reorganize and clean up the whole Rust codebase

* Additional changes during code review

* Modify all message enum data to use named struct values, not tuples (#479)

* Massively reorganize and clean up the whole Rust codebase

* Modify all message enum data to use named struct values, not tuples

* Change canvas artboard background color to be 1 shade lighter

* Tweak whitespace around `use` statements and other lint fixes

* Fix all remaining Vue/TS errors flagged in Volar

* Set the mouse cursor in the canvas based on the current tool and its state (#480)

* Add FrontendMouseCursor and DisplayMouseCursor

* Add update_cursor method to the Fsm trait and implement it for all tools

* Rename DisplayMouseCursor to UpdateMouseCursor

* Add 'To CSS Cursor Property' transform decorator and change the mouse cursor in the canvas based on the current tool and its state

* Implement update_cursor for Navigate tool properly

* Keep the cursor when dragging outside of the canvas

* Change the mouse cursor to 'zoom-in' when LMB dragging on canvas with Navigate tool

* Rename FrontendMouseCursor to MouseCursorIcon

* Rename 'event' to 'e' and replace v-on with @

* Change the definition of the MouseCursorIcon type in TS

* Replace switch with dictionary look-up

* Move the definition of MouseCursorIcon closer to where it's used

* Do not transform layers when transforming a parent folder (#481)

* Modify all message enum data to use named struct values, not tuples (#479)

* Massively reorganize and clean up the whole Rust codebase

* Modify all message enum data to use named struct values, not tuples

* Do not transform layers when transforming parent

* Reduce complexity to O(nlogn)

* Add TODO comment about performance

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Dennis <dennis@kobert.dev>

* Make the toggle overlays button functional (#484)

* Make the toggle overlays button functional

* Move state from the OverlaysMessageHandler to DocumentMessageHandler

* Code review fixes

* Add cursors and hints to global viewport navigation (#487)

* Add global nav cursors

* Update hints on global navigation

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Fix sorting of message enum variants

* Reverse layer panel entries (#489)

* Reverse layer panel entries

* Ctrl + Bracket moves layers in correct direction

* Fix dragging layers in tree

* Fix reverse in wrong place

* Remove log

* Fix sorting of message enum variants

* Fix hotkeys

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Generify functions in document.rs (#488)

* Generify functions in document.rs

* Add alignment overlays (#462)

* Add alignment overlays

* Made snapping / overlays not render extra times, made snapping distance larger

* Revert snap tolerance change until user testing can be done

* WIP conversion to messages

* Revert "WIP conversion to messages"

This reverts commit ddcc23865a4a93639a0e4c60db66c664da8ccc09.

* Overlay document always has (0,0) in top left

* Fix AA on overlay lines

* Merge branch 'master' into alignment-overlays

* Squashed commit of the following:

commit dbc19912ca62b85c512985c10c1799cec1014c44
Author: asyncth <97792158+asyncth@users.noreply.github.com>
Date:   Sun Jan 16 12:57:03 2022 +0500

    Set the mouse cursor in the canvas based on the current tool and its state (#480)

    * Add FrontendMouseCursor and DisplayMouseCursor

    * Add update_cursor method to the Fsm trait and implement it for all tools

    * Rename DisplayMouseCursor to UpdateMouseCursor

    * Add 'To CSS Cursor Property' transform decorator and change the mouse cursor in the canvas based on the current tool and its state

    * Implement update_cursor for Navigate tool properly

    * Keep the cursor when dragging outside of the canvas

    * Change the mouse cursor to 'zoom-in' when LMB dragging on canvas with Navigate tool

    * Rename FrontendMouseCursor to MouseCursorIcon

    * Rename 'event' to 'e' and replace v-on with @

    * Change the definition of the MouseCursorIcon type in TS

    * Replace switch with dictionary look-up

    * Move the definition of MouseCursorIcon closer to where it's used

commit 9b36e6a909ce54bc8bb0db8d11b0caed3eebec85
Author: Keavon Chambers <keavon@keavon.com>
Date:   Sat Jan 15 17:24:58 2022 -0800

    Fix all remaining Vue/TS errors flagged in Volar

commit 2cc39cdb3782dc3ab42a0cb33f54af577a10b5bd
Author: Keavon Chambers <keavon@keavon.com>
Date:   Sat Jan 15 12:55:51 2022 -0800

    Tweak whitespace around `use` statements and other lint fixes

commit fa390c3875c9c355dc9c63a1f738575fb780f3b0
Author: Keavon Chambers <keavon@keavon.com>
Date:   Sat Jan 15 06:35:06 2022 -0800

    Change canvas artboard background color to be 1 shade lighter

commit ea2d00348474976a6021d06978cbead497bc6e2c
Author: Keavon Chambers <keavon@keavon.com>
Date:   Fri Jan 14 20:54:38 2022 -0800

    Modify all message enum data to use named struct values, not tuples (#479)

    * Massively reorganize and clean up the whole Rust codebase

    * Modify all message enum data to use named struct values, not tuples

commit 9b6cbb5f50f1c2493a6fbbbd6b2e34e83ce72b38
Author: Keavon Chambers <keavon@keavon.com>
Date:   Fri Jan 14 14:58:08 2022 -0800

    Massively reorganize and clean up the whole Rust codebase (#478)

    * Massively reorganize and clean up the whole Rust codebase

    * Additional changes during code review

commit a535f5c1c19c56f53e1d4d8bed7acafb2fac956b
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 12 16:17:40 2022 -0800

    Sort messages and message handlers

commit e70858884dc57cf678cb47bf7f38098e08279c1b
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 12 14:16:13 2022 -0800

    Standardize FrontendMessage message names

commit 0b4934b4f3754ed8732c0a7d50d87b4624874c3e
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 12 12:45:07 2022 -0800

    Rename document_file.rs to document_message_handler.rs

commit ec7bf4a771a3028b07879d1131041bcd9742f666
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 12 12:19:14 2022 -0800

    Rename DocumentsMessage to PortfolioMessage

commit 0991312ba009f6a1452a9892e7d5a248a22939ed
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 12 11:44:49 2022 -0800

    Rename document_message_handler.rs to portfolio_message_handler.rs

commit c76c92e50028feed99fccf509385baea9442bbdf
Author: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Date:   Wed Jan 12 19:05:55 2022 +0000

    Migrate to using MoveSelectedLayersTo (#469)

    * migrate to using MoveSelectedLayersTo

    * Fix dragging a selected layer with multiple selected layers

    * Fix CreatedLayer overriding selection

    * Fix MoveSelectedLayersTo behaviour

    * Squashed commit of the following:

    commit 095d577a49f6b904ba3038327109860e5519f981
    Author: Keavon Chambers <keavon@keavon.com>
    Date:   Mon Jan 10 18:06:12 2022 -0800

        Fix NumberInput clamping regression with undefined bounds

    commit 9f54a376c4ad20a60731bb4a4eca5a25001fcfd1
    Author: mfish33 <32677537+mfish33@users.noreply.github.com>
    Date:   Sun Jan 9 15:52:55 2022 -0800

        Fix bounds with artboards for zoom-to-fit and scrollbar scaling (#473)

        * - document load keeps postition
        - zoom to fit
        - scrollbars use artboard dimensions

        * - review comments
        - svg export uses all artboard bounds

        Co-authored-by: Keavon Chambers <keavon@keavon.com>

    commit 61432de4801d63d62faa18aaa624b11a122a97b1
    Author: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
    Date:   Sat Jan 8 21:06:15 2022 +0000

        Fix rotation input (#472)

    * Fix insert with no nesting at end of panel

    * Deselect other layers on paste

    * Resolve logging

commit 574028375b4b0aea6ccd76414dd93272a72add5f
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 12 06:14:32 2022 -0800

    Add `npm start` script alias for `npm run serve`

commit 75e8fc6614d4b498b0beb93ac9313144160e7689
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 12 05:17:56 2022 -0800

    Switch VS Code's Vue extension from Vetur to Volar

commit 389b445ef16065412759c4e4fc1e10835ebb8bdb
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 12 03:56:28 2022 -0800

    Remove Charcoal references from the code for now

commit 095d577a49f6b904ba3038327109860e5519f981
Author: Keavon Chambers <keavon@keavon.com>
Date:   Mon Jan 10 18:06:12 2022 -0800

    Fix NumberInput clamping regression with undefined bounds

commit 9f54a376c4ad20a60731bb4a4eca5a25001fcfd1
Author: mfish33 <32677537+mfish33@users.noreply.github.com>
Date:   Sun Jan 9 15:52:55 2022 -0800

    Fix bounds with artboards for zoom-to-fit and scrollbar scaling (#473)

    * - document load keeps postition
    - zoom to fit
    - scrollbars use artboard dimensions

    * - review comments
    - svg export uses all artboard bounds

    Co-authored-by: Keavon Chambers <keavon@keavon.com>

commit 61432de4801d63d62faa18aaa624b11a122a97b1
Author: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Date:   Sat Jan 8 21:06:15 2022 +0000

    Fix rotation input (#472)

commit 3eeac79f5a811c10ab898471f41bd796c5cf16b0
Author: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Date:   Sat Jan 8 16:30:03 2022 +0000

    Enhance the Navigate Tool zoom behavior (#461)

    * Snap zoom

    * Navigate zoom from centre

    * Ctrl to snap zoom in navigate

    * Use ctrl for global snap rotate

    * Fix the rotation input on snap rotate

    * Update hint to use ctrl

    * Fix mouse centre on drag

    * Click to zoom in

    * Clean up centre zoom

    * Update user input hints; tweak some variable names for clarity and standardization

    Co-authored-by: Keavon Chambers <keavon@keavon.com>

commit a2c2f7fc9da5beb73f677e95d5b4095cd8851318
Author: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Date:   Sat Jan 8 16:02:02 2022 +0000

    Add support for resizing workspace panels (#443)

    * Resize panels

    * Removing move_selection test pending #444 resolved

    * Bind event listners and cursor to the document

    * Fix flex grow on document being reset when drawing

    * Call onresize when the boundry is dragged

    * Add min panel size

    * Add explicit function return types

    * Dispatch resize event

    * Lock pointer instead of setting cursor on document

    Co-authored-by: otdavies <oliver@psyfer.io>
    Co-authored-by: Keavon Chambers <keavon@keavon.com>

commit 54e91211158c3b6e3f6597fde85f0340a75f1667
Author: mfish33 <32677537+mfish33@users.noreply.github.com>
Date:   Sat Jan 8 07:50:08 2022 -0800

    Implement artboards and document version enforcement (#466)

    * - graphite document artboard implementation
    - autosave document load hitch fix
    - Autosave will delete saved files when graphite document version changes

    * formating

    * - top left 0,0
    - fixed hitch on first document
    - vue calls first render

    * Revert

    * Merge branch 'master' into artboards

    * Small bug fixes and code review tweaks

    Co-authored-by: Oliver Davies <oliver@psyfer.io>
    Co-authored-by: Keavon Chambers <keavon@keavon.com>

commit 11f15bd6afa7f355b79e2b296f9397c5cb5ad783
Author: Leonard Pauli <leonardpauli@me.com>
Date:   Sat Jan 8 14:25:24 2022 +0100

    Path Tool: Implement anchor point dragging (#451)

    * #82 path-tool: WIP selecting control point working

    * Fix bug where duplication with Ctrl+D doesn't properly duplicate (#423)

    * bug fix: duplication didn't properly duplicate

    * cargo fmt

    * changed the formatting slightly for readability

    * Small cleanups, changed color of handles upon selection

    * Fix changes from merge

    * Remove duplicate anchor points on top of one another

    * Fix possible issues with thumbnails not being updated from Graphene operations

    * path-tool: attempt to move control points on click

    * Add dragging for control points

    * Editing shape anchors functional. Handles next.

    * Comment cleanup & slight cleanup of closest_anchor(..)

    * Removing conflict with master

    * Tiny code tweaks

    Co-authored-by: Keavon Chambers <keavon@keavon.com>
    Co-authored-by: caleb <56044292+caleb-ad@users.noreply.github.com>
    Co-authored-by: otdavies <oliver@psyfer.io>
    Co-authored-by: Dennis <dennis@kobert.dev>

commit 05e8a98f468cb3a8814cf02e482805ed1616e357
Author: Keavon Chambers <keavon@keavon.com>
Date:   Fri Jan 7 23:13:33 2022 -0800

    Redesign the Layer Tree UI (#468)

commit 8e3d2372289872716ab2567da744a213f0c4d1f3
Author: Oliver Davies <oliver@psyfer.io>
Date:   Fri Jan 7 15:53:12 2022 -0800

    Ungroup layers (#465)

    * WIP handling corner cases, like ungrouping subfolders

    * Resolved hanging

    * Fix recursive ungrouping

    * Functional, corner case free Ungroup. Small Undo issue & warnings

    * Update layertree upon undo

    * Also update  layerdata upon redo

    * Add some polish

    * Resolved TODOs

    * Oops didn't save all after rename, ha.

    Co-authored-by: Dennis <dennis@kobert.dev>

commit c1c719294862e049c55c0ede72f2014ba7851dc4
Author: TrueDoctor <dennis@kobert.dev>
Date:   Fri Jan 7 04:15:08 2022 +0100

    Tidy up path handling in document_file (#464)

    * Tidy up path handling in document_file

    + Improve #455

    * Cargo Clippy lints

    * Rename to_vec to map_to_vec

    Co-authored-by: Oliver Davies <oliver@psyfer.io>

commit f4707f9b741973adddf769dee1b64effcc702805
Author: mfish33 <32677537+mfish33@users.noreply.github.com>
Date:   Thu Jan 6 18:45:37 2022 -0800

    Better decimal rounding in the NumberInput widget (#457)

    * better decimal rounding in NumberInput

    * - created function to reuse
    - used math instead of string manipulation

    * updated comment to be correct

    * updated comment

    * updated comment

commit 0219f060b8e13b7dc9e47335f130d1737b9a8529
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 5 05:40:32 2022 -0800

    Fix build script to use correct branch name

* Fix indentation

* Overlays fade in

* Fix formatting

* Add consts for snap visible and opacity

* Tweak constants for improved UX, rejigger imports

* Fix AA bounding box

* Snap only visible layers

* Add some comments

Co-authored-by: otdavies <oliver@psyfer.io>
Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Move scrollable behavior into LayoutRow/LayoutCol

* Clean up web code's use of display CSS properties, using <LayoutRow>/<LayoutCol> where intended

* Simplify point storage for pen tool (#500)

Store points as vectors instead of representing them as transforms to
avoid confusion and improve efficiency

* Add folder outline insert marker and clean up layer insertion Vue code (#497)

* Add folder insert outline

* Fix typo

* Use v-bind for insert folder class

* Remove v-bind prefix

* Convert to using v-if for the insert marker

* Simplify Vue-based insertion lines with pseudo elements
Regression I caused: can't insert in bottom of folder listing

* Fix the insertion-at-bottom-of-folder bug

* Apply folder insertion to the layer not its row

* Convert to using an absolutly positioned marker

* Remove v-bind prefix

* Remove other v-bind prefix

* Cleanup css

* Little code review nitpicks

* Better name for closest

* Rename js constants

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add folder outline insert marker and clean up layer insertion Vue code (#497)

* Add folder insert outline

* Fix typo

* Use v-bind for insert folder class

* Remove v-bind prefix

* Convert to using v-if for the insert marker

* Simplify Vue-based insertion lines with pseudo elements
Regression I caused: can't insert in bottom of folder listing

* Fix the insertion-at-bottom-of-folder bug

* Apply folder insertion to the layer not its row

* Convert to using an absolutly positioned marker

* Remove v-bind prefix

* Remove other v-bind prefix

* Cleanup css

* Little code review nitpicks

* Better name for closest

* Rename js constants

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add folder outline insert marker and clean up layer insertion Vue code (#497)

* Add folder insert outline

* Fix typo

* Use v-bind for insert folder class

* Remove v-bind prefix

* Convert to using v-if for the insert marker

* Simplify Vue-based insertion lines with pseudo elements
Regression I caused: can't insert in bottom of folder listing

* Fix the insertion-at-bottom-of-folder bug

* Apply folder insertion to the layer not its row

* Convert to using an absolutly positioned marker

* Remove v-bind prefix

* Remove other v-bind prefix

* Cleanup css

* Little code review nitpicks

* Better name for closest

* Rename js constants

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Implement layer renaming (#501)

* Implement layer renaming

* Fix sneaky typo in CSS

Co-authored-by: Moritz Vetter <16950410+HansAuger@users.noreply.github.com>

Co-authored-by: Moritz Vetter <16950410+HansAuger@users.noreply.github.com>

* Implement Freehand Tool (#503)

* Implement freehand tool

* Address review comments

* Consistent ordering of tools

* Add hotkey N for freehand tool

* Tweak freehand tool hint

* Implement the Text Tool and text layer MVP (#492)

* Add text tool

* Double click with the select tool to edit text

* Fix (I think?) transitioning to select tool

* Commit and abort text editing

* Transition to a contenteditable div and autosize

* Fix right click blocking

* Cleanup hints

* Ctrl + enter leaves text edit mode

* Render indervidual bounding boxes for text

* Re-format space indents

* Reflect font size in the textarea

* Fix change tool behaviour

* Remove starting text

* Populate the cache (caused doc load bug)

* Remove console log

* Chrome display the flashing text entry cursor

* Update overlay on input

* Cleanup input.ts

* Fix bounding boxes

* Apply review feedback

* Remove manual test

* Remove svg from gitignore

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Layout system implementation and applied to tool options bar (#499)

* initial layout system with tool options

* cargo fmt

* cargo fmt again

* document bar defined on the backend

* cargo fmt

* removed RC<RefCell>

* cargo fmt

* - fix increment behavior
- removed hashmap from layout message handler
- removed no op message from layoutMessage

* cargo fmt

* only send documentBar when zoom or rotation is updated

* ctrl-0 changes zoom properly

* Code review changes

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Fix overlays on document switching (#505)

* Fix overlays on document switching

* Fix generating new document

* Move messages

* Abort tool when deleteing active document

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Rename deployment script

* Clean up text input (#506)

* Fix firefox text input

* Fix descenders below bounding box

* Fix chromium empty text

* Descenders back below baseline

* Fix trailing newline on chromium

* Reinstate correct baseline height

* Fix highlighted new line on empty text

* Add comment for trailing new line removal

* Extract cleanupTextInput to a separate file

* Function import simplification

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Transformation cage (#502)

* Render corners and edges of selection box

* Refactor

* Add drag detection

* Implement the transform handles

* Implement rotation by dragging <40px from bounds

* Refine clustered handle behaviour

* Add cursors

* Add snap angle

* Fix MMB drag whilst in select tool

* Convert calculate_pivot into a seperate function

* rename start_vec to start_offset

* Fix typo

* Remove Undo transaction on <10px mouse move

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Double click on a SimpleShape to path edit (#507)

* Add log level selection to help menu (#511)

* Add log level selection to help menu

* Show keyboard shortcuts in loglevel menu items

* Bump follow-redirects from 1.14.5 to 1.14.7 in /frontend (#515)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.5 to 1.14.7.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.5...v1.14.7)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump nanoid from 3.1.30 to 3.2.0 in /frontend (#514)

Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.30 to 3.2.0.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.30...3.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Solve "Coming Soon" dialog from bubbled click event on sub-menu entries (#517)

* Fix shape not closed after using Fill Tool (#510)

* Always set shape property 'closed' on fill

* Remove closed property on Shape

* Make color mandatory in Fill

* Fix intersection for filled but open shapes

* Code style tweak

* Add TODO note to rework ClosePath check

* De duplicate Overlay render messages (#520)

* Set text fill color to the primary color (#521)

* Fix text has no fill

* Use primary color for text fill

* Use correct text color when editing

* Change fallback text color to gray

* Place new layers in tree based on layer selection (#526)

* place new layers based on layer selection

* Add the TextInput widget (#518)

* Separate out the number input from a generic field input

* Add TextInput widget

Co-authored-by: mfish33 <32677537+mfish33@users.noreply.github.com>

* Overhaul Path Tool (#498)

* First pass cleanup omw to handles

* Handles dragging with anchors, handles still not draggable and some bugs

* Dragging single side of handle works, need to create mirror case

* In progress addition of improved anchor / handle representation

* partially working

* Handle dragging working for non-end points, normal anchor drag bugged

* Fixed corner cases, fixed anchors without handles bug

* Add snapping

* Change path tool selection by clicking on shape

* Fixed path close point being draggable

* Variable length handle, firstpass of alt to stop mirroring

* Alt improved, not done. Only update structures when needed. Added snapping for selected shapes

* Can now undo path edits

* Do not maintain angle between non-mirrored handles

* Replaced segment based overlay setup with anchor based setup

* Cleanup, handle angle comparison bug remains. Investigating.

* Added OverlayPooler. May closely associate overlays to VectorManipulatorAnchors instead.

* Moved anchor / segment creation logic out of document_message_handler

* Overlays are now managed by VectorManipulatorShapes

* Fixed inconsistent handle mirroring.

* Clearly shows which point you have selected

* Removed OverlayPooler system

* Added more comments

* Removed all clones of the vector structures. A little uglier but better.

* Resolved Text path initialization bug with a workaround.

* Cleaned up comments

* More comment cleanup

* Fixed issue with quad handle dragging unwanted behavior, renamed VectorShapeManipulator

* In progress refactor to allow multi-selection

* In progress dragging multiple points, selection works, transform still has issues

* Added Multiselect, major refactor

* Commented out progress for selection change, bug with hop back on multiple shapes

* Removed debug og

* Resolved issue with merge

* Minor cleanup, added a few comments

* Review changes

* Resolved unclear comment

* Fixed snap back for now

* Add todo comment for future snap back fix

* Working situations where curve paths do not close. Thanks for points it out  @pkupper

* Tweaked selection size

* Fix curve start point dragability, renames, cleanup

* Separated into multiple files, applied @TrueDoctor review feedback

* Resolved tests failing due to doc generation

* Re-added closed, added concept of distance mirroring

* Added shift distance mirroring, removed debounce from anchor

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Thank you for the reviews @TrueDoctor and @pkupper

* Fix TextInput widget casting from string to number by mistake (#528)

* Implement the Crop Tool for artboard resizing (#519)

* Extract transformation cage to a seperate file

* Hook up tool

* Implement resize

* Draw artboards

* centre and constrain

* Bounding box is rotated

* Fix transform handle positions for artboard

* Drag layers

* Snapping

* Fix imports

* Cleanup

* Remove allocation from bounding_boxes

* Round artboard size and position

* Hints

* Fix rotated transform cage

* Code review changes

* Hints changes

Co-authored-by: Dennis <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Implement the Spline Tool (#512)

* Add Spline Tool

* Adapt to changes from master

* Apply review feedback

* Fixes

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Improve Path Tool hint text

* Polishing: standardize binding JS resize event (fixes non-integer AA rendering); remove "X" to delete; cleanup

* Allow deleting artboards (#533)

* Properly show document bar on initialization (#535)

* properly show document bar

* updated comments

* Add Pen Tool  (#536)

* First steps toward pen tool, similar to spline tool currently.

* Broken WIP

* Progress, but still glitchy

* Improvements, a little farther

* Pen tool functioning as expected

* Merged master

* Fixed commit bug and overlay flashing

* Reordered import statements

TODO: Resolve issue with last segment losing its handle position on confirm

* Implement the Properties panel with a transform section for layers (#527)

* initial layout system with tool options

* cargo fmt

* cargo fmt again

* document bar defined on the backend

* cargo fmt

* removed RC<RefCell>

* cargo fmt

* - fix increment behavior
- removed hashmap from layout message handler
- removed no op message from layoutMessage

* cargo fmt

* only send documentBar when zoom or rotation is updated

* ctrl-0 changes zoom properly

* unfinished layer hook in

* fix layerData name

* layer panel options bar

* basic x/y movment

* working transform section

* changed messages from tuples to structs

* hook up text input

* - fixed number input to be more clear
- fixed actions for properties message handler

* Add styling

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Boolean shape operations (#470)

* added BooleanUnion message for select tool, which is sent by the BooleanUnion button

* select to dispatches a BooleanUnion message
   - as far as I can tell the selected layers aren't stored anywhere

* Added neccesary messages and functions for boolean operation

* Intersection code, as yet untested
does not compile

* Updated intersection algorithm

* Fixed shapes_as_seen
   - should not be effected by root transform, should be effected by the shape transform
Working line intercepts

* updated intersection algorithm

…
Keavon added a commit that referenced this pull request Jul 30, 2023
* Add handler and input mapping.

* Selecting transform type

* Add translation and axis constraints

* Remove unnecessary Key::

* Add rotation

* Centre pivot point for rotation

* Add scaling

* Select Tool bounding box now updates when transforming

* Add typing

* Shift to slow mouse movements

* Add snapping

* Refactor modifier keys

* Refactor to apply only 1 operation per frame

* Refactor to fix scale 0 issue

* Remove logging

* Avoid multiple decimol points in queue

* Add typing negative

* Add typing negative values

* Fix bounding box on apply/abort; fix some variable names

* Allow transform to daffine2 identity

* Revert previous operation when changing operation

* Remove repopulate transforms method

* Code readability tweaks

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Keavon added a commit that referenced this pull request Jul 30, 2023
* Improve web infrastructure

Upgrade npm packages that were locked to old versions due to now-resolved problems
Remove unused/unnecessary dependencies and their configurations
Fix VS Code format on save
Fix VS Code removing EOF newline in JSON files in conflict with npm
Remove JSON files from ESLint because it doesn't properly support JSON
Add detailed comments to web-related configuration files

* Minor code readability improvements

* Fix bug where swiching to the Fill Tool would trigger a fill operation

* Add two-way tool option messaging system between frontend/backend (#361)

* Add two-way tool option messaging system

* Rename tool option functions

* Move repeated frontend messaging code to function

* Address style comments

* Rename variable to be more descriptive

* Move tool options update to SetActiveTool message

* Refactor record of all tool options

* Only pass active tool options to bar

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Implement anchor and handle point rendering with the Path Tool (#353)

* Implement Path Tool

* Draw a red rectangle where the first point on the shape is

* Correctly render anchors, handles, and connecting lines

* Fix drain() which can panic

* Refactor frontend messages to work as return values not callbacks

* Reduce the number of unnecessary frontend updates

* Fix stack overflow by using a loop

* Group Document Render calls and put them at the end

* Speed hacks for dirtification

* Add performance

* Bunch folder changed updates

* Add triggers to redraw overlays to movement_handler

* Polish the pixel-perfect rendering of vector manipulators

* Restore scrollbars that were disabled

* Cleanup

* WIP Add shape outline rendering

* Fix compiling

* Add outlines to selected shapes

* Fix outlines rendering over handles and anchors

* Fix dirtification

* Add a comment

* Address code review feedback

* Formatting

* Small tweaks

Co-authored-by: Oliver Davies <oliver@psyfer.io>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>

* Add folders to frontend and folder creation to backend (#315)

* Add folders to frontend and folder creation to backend

Closes #149

* Add Group keybind

* Add logic to handle expanding of folders

* Send all paths as (u32, u32)

* Add custom serialization for path

* Merge two layer_panel files

* Refactor frontend layer merging

* Fix JS linting

* Update upstream thumbnail changes

* Add paste into selected folder + fix thumbnail dirtification

* Implement CollapseFolder function

* Skip folders on a different indentation level during reorder

* Only reorder within the same folder

* Add folder node icon for folder layers

* Add expand/collapse folder button; partly implement new layer tree design

* Update terminology in the docs

* Add number labels to ruler marks

* Replace promise with await in MenuList.vue

* Miscellaneous minor code cleanup

* Disallow snake_case variable names in frontend

* Add support for saving and opening files (#325)

* Add support for saving a document

This is similar to the "export" functionality, except that
we store all metadata needed to open the file again.

Currently we store the internal representation of the layer
which is probably pretty fragile.

* Add support for opening a saved document

User can select a file using the browser's file input selector.
We parse it as JSON and load it into the internal representation.

Concerns:
- The file format is fragile
- Loading data directly into internal data structures usually creates
security vulnerabilities
- Error handling: The user is not informed of errors

* Serialize Document and skip "cache" fields in Layer

Instead of serializing the root layer, we serialize the
Document struct directly. Additionally, we mark the
"cache" fields in layer as "skip" fields so they
don't get serialized.

* Opened files use the filename as the tab title

* Split "new document" and "open document" handling

Open document needs name and content to be provided so having a
different interface is cleaner. Also did some refactoring to reuse code.

* Show error to user when a file fails to open

* Clean up code: better variable naming and structure

* Use document name for saved and exported files

We pass through the document name in the export and save
messages. Additionally, we check if the appropriate file
suffixes (.graphite and .svg) need to be added before
passing it to the frontend.

* Refactor document name generation

* Don't assign a default of 1 to Documents that start with something
  other than DEFAULT_DOCUMENT_NAME
* Improve runtime complexity by using binary instead of linear search

* Update Layer panel upon document selection

* Add File>Open/Ctrl+O; File>Save (As)/Ctrl+(Shift)+S; browse filters extension; split out download()/upload() into files.ts; change unsaved close dialog text

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Refactor ViewportPosition from u32 (UVec2) to f64 (DVec2) (#345)

* Refactor ViewportPosition from u32 (UVec2) to f64 (DVec2)

* Fix pseudo_hash call

* Replace hash function with proper function for uuid generation

* Cargo fmt

Co-authored-by: Dennis Kobert <dennis@kobert.dev>

* Improve Frontend -> Backend user input system (#348)

Includes refactor that sends coordinates of the document viewports to the backend so input is sent relative to the application window
Closes #124
Fixes #291

* Improve Frontend -> Backend user input system

* Code review changes

* More code review changes

* Fix TS error

* Update the readme

* Make scrollbars interactable (#328)

* Make scrollbars interactable

* Add watcher for position change

* Fix case of data

* Fix updateHandlePosition capitalization

* Clean up class name thing

* Scroll bars between 0 and 1

* Allow width to be 100%

* Scrollbars reflect backend

* Include viewport in scrollbar

* Add half viewport padding for scrollbars

* Refactor scrollbar using lerp

* Send messages to backend

* Refactor

* Use glam::DVec2

* Remove glam::

* Remove unnecessary abs

* Add TrueDoctor's change

* Add missing minus

* Fix vue issues

* Fix viewport size

* Remove unnecessary log

* Linear dragging

* Improve scrollbar behavior (#351)

* Change scrollbar behavior

* Leave space at the end of the scrollbar

* Change mid to center

* Use shorter array initialization

* Add space around scrollbar

* Fix scrollbar spacing

* Smooth end of scrollbars

* Add page up and down

* Page up and down on click in scrollbar track

* Add shift pageup to translate horizontally

* Implement bounding box for selected layers (#349)

* Implement bounding box for selected layers

* Add shift modifier for multi selection

* Fix collapsing of folders

* Add have pixel offset to selection bounding box

* Don't panic on Ctrl + A

* Rename to camel case

* Add todo comment for Keavon

* Apply @Hypercubes review suggestions

* Fix many panics, improve behavior of copy/paste and grouping (but grouping still can panic)

Co-authored-by: Dennis Kobert <dennis@kobert.dev>

* Add space key & drag to pan the canvas (#364)

* (G)rab, (R)otate, and (S)cale layers with hotkeys (#356)

* Add handler and input mapping.

* Selecting transform type

* Add translation and axis constraints

* Remove unnecessary Key::

* Add rotation

* Centre pivot point for rotation

* Add scaling

* Select Tool bounding box now updates when transforming

* Add typing

* Shift to slow mouse movements

* Add snapping

* Refactor modifier keys

* Refactor to apply only 1 operation per frame

* Refactor to fix scale 0 issue

* Remove logging

* Avoid multiple decimol points in queue

* Add typing negative

* Add typing negative values

* Fix bounding box on apply/abort; fix some variable names

* Allow transform to daffine2 identity

* Revert previous operation when changing operation

* Remove repopulate transforms method

* Code readability tweaks

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Dispatcher::handle_message does not need Result anymore (#365)

* Dispatcher::handle_message does not need Result anymore (1)

Callers can get rid of result handling, too.

* Dispatcher::handle_message does not need Result anymore (2)

* Dispatcher::handle_message does not need Result anymore (3) cargo fmt

* Additional WASM translation layer cleanup

* Bump tar from 5.0.7 to 5.0.11 in /frontend (#367)

Bumps [tar](https://github.com/npm/node-tar) from 5.0.7 to 5.0.11.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v5.0.7...v5.0.11)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Show a crash dialog when the editor panics (#362)

* Show a crash dialog when the editor panics

Closes #357

* Suppress console usage lints

* Proxy cleanup and comments

* Improve and clean up panic dialog code and wasm wrapper (#368)

Part of #357

* Reorganize and clean up the WASM wrapper

* Postpone 0.1 launch in readme from Aug to early Sept

* Upgrade wasm-pack to 0.10.1 (#369)

Closes #167

* Auto-generate third-party license notices (#370)

Closes #294
Closes #371

* Additional improvements to license notice formatting

* Add function to serialize the layer structure to a 1D array (#363)

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Change scrollbar drag color

* Add an intentional panic for debug

* Hook up layer tree structure with frontend (#372)

* Hook up layer tree structure with frontend (decoding and Vue are WIP)

* Fix off by one error

* Avoid leaking memory

* Parse layer structure into list of layers

* Fix thumbnail updates

* Correctly popagate deletions

* Fix selection state in layer tree

* Respect expansion during root serialization

* Allow expanding of subfolders

* Fix arrow direction

Co-authored-by: Dennis Kobert <dennis@kobert.dev>

* Add proper type annotations for panicProxy (#378)

* Do not silently install cargo-about. (#377)

* Fix deployment script (#380)

* id-based-docs (#376)

* Added some notes on what ds to use for the documents.

* Added a separate list of ids to associate ID to doc. Looks up all
documents by id to retrieve an index via linear search.

* Fixed function name.

* Removed id recycling, replaced document vector with hashmap.

* Uses the same logic for PrevDocument in closing

* Implement interactive scaling/motion of rulers (#306) (#385)

* Update ruler origin

* Fix ruler text

* Handle zoom

* Remove log

* Fix origin

* Upgrade Graphite to Rust 2021 edition; upgrade dependencies (#387)

* Upgrade Graphite to Rust 2021 edition; upgrade dependencies

* Fix CI

* Move changes to the project Cargo.tomls

* Remove unnecessary 2021 edition upgrade tweak

* Show version number before and after updating rustc

Co-authored-by: Dennis Kobert <dennis@kobert.dev>

* Replace vue-svg-loader dependency with simple JS file (fixes a security alert) (#389)

* Update notice for Safari users that BigInt64Array is now supported in 15 (#390)

* Update various node dependencies (#391)

* Upgrade rustfmt to 2021 edition

* Layer snapping

* Test snapping

* Snap new shapes

* Fix snapping when zoomed

* Refactor to use viewport bounds

* Reduce snap tolerance to 3

* Snap line and path tool

* Add disable snapping and refactor

* new_snap -> new status

* Rearrange import

* Cleanup

* Fix incorrect variable name

* Store snap data in tool data

* Switch to Node.js 16 LTS, upgrade TypeScript, ESLint, and other dependencies (#395)

* Upgrade TypeScript, ESLint, and other dependencies

This also cleans up various other files where newer ESLint rules complained

* Set CI and CD to use Node.js version 16

* Small tweak

* Fix CD version printing

* Add nvm version for Cloudflare Pages

* Display Asterisk on Unsaved Documents (#392)

* ability to mark an open document as unsaved

* unsaved detection now being triggered based on layer tree height

* - rust implementation of unsaved markers
- upgraded eslint

* updated eslint in package.json

* - Renamed GetOpenDocumentsList -> UpdateOpenDocumentsList
- is not -> was not

* changed hash to current identifier to better reflect its meaning

* resolve some merge conflicts

* removed console.log statement leftover from debuging

* Confirm when the browser window is closed and there is unsaved work (#397)

* - browser confirmation on page exit
- prompt to save a document when closed will only trigger when unsaved

* add back select document for close prompt

* - name -> displayname
- add preventPropigation to middle click

* CSS editor layout fixes and scrolling

Major CSS improvements to layout at small screen sizes. By adding min-width: 0 and min-height: 0 on the nested display: flex structure, widgets no longer coerce the whole layout into large-scale resizing. Scrollbars are now used to allow correct overflowing of the tab bar (fixes #177), Document Panel options bar, and tool shelf. Improvements to responsive resizing are also included for viewing the UI correctly on mobile now. Additional small fixes to styling of widget colors and corner roundness. The ruler has been darkened one shade to improve text contrast and aesthetics.

* Change responses to use classes instead of interfaces (#394)

* ability to mark an open document as unsaved

* unsaved detection now being triggered based on layer tree height

* Changed responses to use classes instead of interfaces

* - rust implementation of unsaved markers
- upgraded eslint

* updated eslint in package.json

* - Renamed GetOpenDocumentsList -> UpdateOpenDocumentsList
- is not -> was not

* changed hash to current identifier to better reflect its meaning

* resolve some merge conflicts

* removed console.log statement leftover from debuging

* - changed Response to jsMessage
- split files
- Array<> -> []

* -remove path from UpdateLayer

* - remove unused if statements

* - comment for reflect-metadata
- registerJsMessageHandler -> subscribeJsMessage
- readonly message properties
- fixed binding filename and comment
- toRgb -> toRgba

* - newOpacity -> transformer
- added comments

* MessageMaker -> messageMaker

* Fix ESLint configuration triggering an error in the ESLint VS Code extension

* Switch CI and CD scripts to use `npm ci` instead of `npm install`

* Enable vertical scroll wheel on horizontal scrollable containers

* Fix bug in last commit that broke when scrolling on SVG elements

* Fix blend mode serialization and de-serialization to match (#400)

* Update the project readme

* Fix floating menus above scrollable content; they now respect content's preferred width at edges

* Clean up JS message dispatcher and fix a bug thrown on empty-data messages

Fixes bug in #394

* Add the Help > About Graphite dialog with build info

Closes #404

* Make deployment switch branch from HEAD to master

* Rework wasm initialization and reduce global state (#379)

* wasm: do the async initialization only once

This allows the rest of the app to access wasm synchronously.

This allows removing of a global.

* provide the wasm via vue provide/inject.

There's still code directly accessing the wasm. That will be changed later.

* MenuBarInput: use injected wasm instead of the global instance

* Let the App handle event listeners

* move stateful modules into state/

* state/fullscreen: create per instance

* App: load the initial document list on mount.
This got lost a few commits ago. Now it's back.

* state/dialog: create per instance

* util/input: remove dependency on global dialog instance

* state/documents: create per instance

* reponse-handler: move into EditorWasm

* comingSoon: move into dialog

* wasm: allow instantiating multiple editors

* input handlers: do not look at canvases outside the mounted App

* input: listen on the container instead of the window when possible

* - removed proxy from wasm-loader
- integrated with js-dispatcher
- state functions to classes
- integrated some upstream changes

* fix errors caused by merge

* Getting closer:
- added global state to track all instances
- fix fullscreen close trigger
- wasm-loader is statefull
- panic across instanes

* - fix outline while using editor
- removed circular import rule
- added editorInstance to js message constructor

* - changed input handler to a class
- still need a better way of handeling it in App.vue

* - fixed single instance of inputManager to weakmap

* - fix no-explicit-any in a few places
- removed global state from input.ts

* simplified two long lines

* removed global state

* removed $data from App

* add mut self to functions in api.rs

* Update Workspace.vue

remove outdated import

* fixed missing import

* Changes throughout code review; note this causes some bugs to be fixed in a later commit

* PR review round 1

* - fix coming soon bugs
- changed folder structure

* moved declaration to .d.ts

* - changed from classes to functions
- moved decs back to app.vue

* removed need to export js function to rust

* changed folder structure

* fixed indentation breaking multiline strings

* Fix eslint rule to whitelist @/../

* Simplify strip-indents implementation

* replace type assertions with better annotations or proper runtime checks

* Small tweaks and code rearranging improvements after second code review pass

* maybe fix mouse events

* Add back preventDefault for mouse scroll

* code review round 2

* Comment improvements

* -removed runtime checks
- fixed layers not showing

* - extened proxy to cover classes
- stopped multiple panics from logging
- Stop wasm-bindgen from mut ref counting our struct

* cleaned up messageConstructors exports

* Fix input and fullscreen regressions

Co-authored-by: Max Fisher <maxmfishernj@gmail.com>
Co-authored-by: mfish33 <32677537+mfish33@users.noreply.github.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Skip cargo-about in CI to save 5 minutes (#409)

* Upgrade node packages (#413)

* Fix undefined behavior in the editor wasm bridge (#414)

* removed possible undifined behavior

* changed naming of Editor -> JsEditorHandle

* fix rust formatting

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Set Cargo.toml versions to 0.0.0 to avoid version confusion

* Change mouse to pointer events (#403)

* Change mouse to pointer events

* Add `npm start` command

* Change all mouse to pointer events;
Fix `touch-action: none;`

* Merge with master

* Fix middle mouse click

* Remove console.log

* Delete the empty line

* Re-add middle click auto-scroll blocking

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Skip the web page close confirmation when crashed or in debug mode

* Make the Pen Tool confirm when leaving the tool

* Move layer selection logic from vue to editor (#410)

* Add vue selectLayer(layer, ctrl, shift)

* Individual selection working, range fill next

* Frontend package-lock.json seems apparently needs to be pushed. Weird.

* Selection working with ctrl, shift from editor. Still some bugs to sqaush with folder nesting.

* WIP resolving nesting folders issues

* Changed comparison approach, handling corner cases now

* Fully working selection.

* Reverted changes to package-lock.json

* Removed unused code

* Resolved ctrl click not behaving similar to windows

* Slight comment clarification

* Double checked a windows behavior and corrected. Changed last_selected name.

* Simplified if statement slightly.

* Made the naming clearer regarding UUIDs versus indices

* Clarified comments further

* Minor comment fixup

* Implemented suggestions, clarified comments

* Resolved todo regarding clearing selection when ctrl not pressed

* Ensure we only push responses when needed

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Reviewed by: @TrueDoctor <3

* Fix new document position (#421)

* Fix new document pos

* All new documents are centered before deserialization

* Move constructors to the top of to block

* Fix merge (moving coe around is a bad idea)

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add a temporary solution to non-Latin keyboards being unusable

* Fix previous commit by mapping codes to keys

* Implement input hints based on the active tool state (#388)

* Hook up user input hints to display in the frontend status bar

Closes #171

* MVP hint system based on tool FSM

* Fix hints for Fill and Eyedropper tools

* Add icons for keyboard shortcuts

* Fix hints for Pen Tool

* Cleanup

* Implement outline view mode (#401)

* Created wasm binding to action's of the radio buttons which control the view mode
Added entry to DocumentMessage Enum

* draw in wireframe mode by changing parameters on each shape
added functions/changed behavior to do as above
not working yet
   - newly added shapes should be drawn in wireframe
   - setting fill to "none" on a path does not only draw an outline
      - maybe the stroke width is 0?

* Wire frame view mostly functional for ellipses
   - Need to implement for all shapes
   - BUG: shapes don't immediatley update upon changing view-mode

* Fixed: active document now updates after view mode swap

* The Pros:
   - wire frame mode effects all shapes correctly

The Cons:
   - wire frame mode effects everything, including things that maybe shouldn't be, like select boxes and pen lines

* wire frame view no longer effects overlay layers

* Fixed: While in wireframe view the pen tool will draw regular thickness lines.

* some commenting

* Fixed potential bug:
   In layer/file system with a Folder layer with a sub-layer that is also
   a Folder cache_dirty must be set in order for all shapes to update properly

* refactored code to use ViewMode enum names throughout

* Changed: All wireframe lines are blank
cargo fmt

* Wireframe thickness doesn't change as a result of zooming
   - Added DocumentMessage::ReRenderDocument, which marks layers as dirty and renders with the updated render-string
   - All "zoom" messages in the movement_handler send a re-render message
   - while in wireframe view, the "render-transform" of all shapes includes the root layer transform

Added getter/setter methods for graphene::Document::view_mode

* cargo fmt

* wireframe now has proper thickness after "Zoom Canvas to Fit all" action

* Refactored
   - Changed FrontendMessage::UpdateCanvas to RenderDocument message to allow for lazy evaluation
   - Created DocumentOperation::SetViewMode to be more consistent with existing code
   - removed log statement
   - Added constants for empty fill and thin-black stroke

* cargo fmt

* Removed ReRenderDocument message

* cargo fmt

* Fixes as suggested by TrueDoctor

* clean up merge
cargo fmt

* Refactor:
   moved view_mode to DocumentMessageHandler

* Polishing

* changed those two comments

* Remove unknown todo comment

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Remove all use of document indices (#406)

* removed all use of document indicies

* -add u64 support for wasm bridge

* fixed rust formating

* Cleaned up FrontendDocumentState in js-messages

* Tiny tweaks from code review

* - moved more of closeDocumentWithConfirmation to rust
- updated serde_wasm_bindgen to add feature flag

* changed to upsteam version of serde_wasm_bindgen

* cargo fmt

* -fix event propigation on delete
- Js message change class extention to typedef

* changed another typedef

* cargo fmt

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Fix bug where duplication with Ctrl+D doesn't properly duplicate (#423)

* bug fix: duplication didn't properly duplicate

* cargo fmt

* changed the formatting slightly for readability

* Implement IndexedDB document auto-save (#422)

* removed all use of document indicies

* -add u64 support for wasm bridge

* fixed rust formating

* Cleaned up FrontendDocumentState in js-messages

* Tiny tweaks from code review

* - moved more of closeDocumentWithConfirmation to rust
- updated serde_wasm_bindgen to add feature flag

* working initial auto save impl

* auto save is a lifetime file

* - cargo fmt
- fixc error message
- move document version constant

* code review round 1

* generate seed for uuid in js when wasm is initialized

* Resolve PR feedback

* Further address PR feedback

* Fix failing test

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: otdavies <oliver@psyfer.io>

* Fix Ctrl+scroll wheel zoom point relative to the mouse position (#429)

* Fix zoom

* Cleanup maths

* Snap while dragging with select tool (#433)

* Snap while dragging with select tool

* Remove unnecessary mut

* Snap to 90 degrees instead of 45

* Removed (coming soon) text

Co-authored-by: otdavies <oliver@psyfer.io>

* Fix console error caused by the Pen Tool (#432)

* Fix error in pen tool

* Cleanup

* Split make operation and remove preview

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Fix line centering (#431)

* Implement multiple clipboards (#425)

* Imeplement multiple Clipboards

* Cargo fmt

* Fix unit tests

* Fix console error caused by the Pen Tool (#432)

* Fix error in pen tool

* Cleanup

* Split make operation and remove preview

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Fix line centering (#431)

* cargo fmt

Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>

* Change the select tool to immediately start dragging when clicking a shape (#424)

* Change the select tool to immediately start dragging when clicking a shape

* Fix operation order

* Fix holding shift to add to selection

* Update intoiter syntax (#436)

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Remove snap rotate from layerdata (#435)

* Fix the File > Close All crash (#438)

* Populate layer entry cache (#437)

* Populate layer entry cache

* Serialize the DocumentMessageHandler

* Fix restoring of collapsed/expanded state, add iter impl for Layer, and clean up layer_data() functions

* Fixed bug with CreateEmptyLayer revealed by test

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: otdavies <oliver@psyfer.io>

* Add cut, copy, and paste to the Edit menu (#440)

* Add cut

* Hook up edit dropdown

* Use copy message

* Drag to rearrange layers in the layer panel (#434)

* Add insert line

* Implement dragging

* Improve CSS and variable naming consistency

* Resolved folder crash, added Undo/Redo support

* Removed marker TODO leftover

* JS cleanup

* WIP preserving expanded state (via LayerData) when copy/pasting and moving layers in layer panel

* Finish making folders copy/paste preserving expanded state, but not recursively yet

* Add cut, copy, and paste to the Edit menu (#440)

* Add cut

* Hook up edit dropdown

* Use copy message

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: otdavies <oliver@psyfer.io>

* New overlay system that reimplements how overlays are drawn (#418)

* New overlay system that reimplements how overlays are drawn

* Fix overlay message declaration

* Fix small mistake

* WIP (broken) changes to plumb the overlay document

* Fix confusion over messaging system architecture

* Removed log

* Overlay system working

* (broken) WIP overlay association

* Finish the overlay system (except test failure)

* Change back IDs in test

* Fixed test, but stilled fails due to revealed real problem with layer reordering selection

* Disable broken test that has a bug in issue #444

Co-authored-by: Dennis <dennis@kobert.dev>
Co-authored-by: otdavies <oliver@psyfer.io>

* Fix one item folders (#442)

* Remove transformations from LayerData (#439)

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add navigate tool (#441)

* Remove transformations from layerdata

* Clean up snap rotate

* Enable the navigate tool

* Implement navigate tool

Co-authored-by: otdavies <oliver@psyfer.io>

* Fix all clippy lint errors

* Rename Editor's LayerData to LayerMetadata

* Major frontend code cleanup (#452)

Many large changes, including:
- TypeScript enums are now string unions throughout
- Strong type-checking throughout the TS and Vue codebase
- Vue component props now all specify `as PropType<...>`
- Usage of annotated return types on all functions
- Sorting of JS import statements
- Explicit usage of Vue bind attribute function call arguments (`@click="foo"` is now `@click=(e) => foo(e)`)
- Much improved code quality related to the color picker
- Consistent camelCase Vue bind and v-model attributes
- Consistent Vue HTML attribute strings with single quotes
- Bug fix and clarity improvement with incorrect hint class parameters
- Empty Vue component objects like `props: {}` and `components: {}` removed

* Vue/TS bug and bad typing fixes

* Fix to send panic message to all editor instances immediately upon crash (#460)

* Fix group creation parenting (#455)

* WIP fix of folder crash / indent

* Fixed most crashes

* Known cases of crash / incorrect behavior resolved

* Removed todo & readability tweak

* Removed left over test

* Resolved clippy issue resulting from merging master

* Replace recursive tree traversal with prefix matching

* Reverted changes for #453 and added undo functionality to Paste

* Make uuid generator thread local for tests

* Maintain layer order, test still failing 50% of the time

* Reverting back to known working with the knowledge we can optimize later.

This reverts commit 1aaf5c0d7dbe67cd9f4ba8b536a4771a2cef6439.

* Revert "Make uuid generator thread local for tests"

This reverts commit d68e3b9c4ebf639c4b2ecae43f5ad3d060dcb12b.

* Revert "Reverted changes for #453 and added undo functionality to Paste"

This reverts commit d66992ac9440f244d461a6a815ae2a08eede47d7.

* Revert "Replace recursive tree traversal with prefix matching"

This reverts commit 6bcbb9f82f62b1f9aa00287110fbce64e1d2f0db.

* Reverted to working state and added comment back to optimized commit hash

* Re-removed the changes involving #453

Co-authored-by: Dennis <dennis@kobert.dev>

* Fix build script to use correct branch name

* Better decimal rounding in the NumberInput widget (#457)

* better decimal rounding in NumberInput

* - created function to reuse
- used math instead of string manipulation

* updated comment to be correct

* updated comment

* updated comment

* Tidy up path handling in document_file (#464)

* Tidy up path handling in document_file

+ Improve #455

* Cargo Clippy lints

* Rename to_vec to map_to_vec

Co-authored-by: Oliver Davies <oliver@psyfer.io>

* Ungroup layers (#465)

* WIP handling corner cases, like ungrouping subfolders

* Resolved hanging

* Fix recursive ungrouping

* Functional, corner case free Ungroup. Small Undo issue & warnings

* Update layertree upon undo

* Also update  layerdata upon redo

* Add some polish

* Resolved TODOs

* Oops didn't save all after rename, ha.

Co-authored-by: Dennis <dennis@kobert.dev>

* Redesign the Layer Tree UI (#468)

* Path Tool: Implement anchor point dragging (#451)

* #82 path-tool: WIP selecting control point working

* Fix bug where duplication with Ctrl+D doesn't properly duplicate (#423)

* bug fix: duplication didn't properly duplicate

* cargo fmt

* changed the formatting slightly for readability

* Small cleanups, changed color of handles upon selection

* Fix changes from merge

* Remove duplicate anchor points on top of one another

* Fix possible issues with thumbnails not being updated from Graphene operations

* path-tool: attempt to move control points on click

* Add dragging for control points

* Editing shape anchors functional. Handles next.

* Comment cleanup & slight cleanup of closest_anchor(..)

* Removing conflict with master

* Tiny code tweaks

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: caleb <56044292+caleb-ad@users.noreply.github.com>
Co-authored-by: otdavies <oliver@psyfer.io>
Co-authored-by: Dennis <dennis@kobert.dev>

* Implement artboards and document version enforcement (#466)

* - graphite document artboard implementation
- autosave document load hitch fix
- Autosave will delete saved files when graphite document version changes

* formating

* - top left 0,0
- fixed hitch on first document
- vue calls first render

* Revert

* Merge branch 'master' into artboards

* Small bug fixes and code review tweaks

Co-authored-by: Oliver Davies <oliver@psyfer.io>
Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add support for resizing workspace panels (#443)

* Resize panels

* Removing move_selection test pending #444 resolved

* Bind event listners and cursor to the document

* Fix flex grow on document being reset when drawing

* Call onresize when the boundry is dragged

* Add min panel size

* Add explicit function return types

* Dispatch resize event

* Lock pointer instead of setting cursor on document

Co-authored-by: otdavies <oliver@psyfer.io>
Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Enhance the Navigate Tool zoom behavior (#461)

* Snap zoom

* Navigate zoom from centre

* Ctrl to snap zoom in navigate

* Use ctrl for global snap rotate

* Fix the rotation input on snap rotate

* Update hint to use ctrl

* Fix mouse centre on drag

* Click to zoom in

* Clean up centre zoom

* Update user input hints; tweak some variable names for clarity and standardization

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Fix rotation input (#472)

* Fix bounds with artboards for zoom-to-fit and scrollbar scaling (#473)

* - document load keeps postition
- zoom to fit
- scrollbars use artboard dimensions

* - review comments
- svg export uses all artboard bounds

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Fix NumberInput clamping regression with undefined bounds

* Remove Charcoal references from the code for now

* Switch VS Code's Vue extension from Vetur to Volar

* Add `npm start` script alias for `npm run serve`

* Migrate to using MoveSelectedLayersTo (#469)

* migrate to using MoveSelectedLayersTo

* Fix dragging a selected layer with multiple selected layers

* Fix CreatedLayer overriding selection

* Fix MoveSelectedLayersTo behaviour

* Squashed commit of the following:

commit 095d577a49f6b904ba3038327109860e5519f981
Author: Keavon Chambers <keavon@keavon.com>
Date:   Mon Jan 10 18:06:12 2022 -0800

    Fix NumberInput clamping regression with undefined bounds

commit 9f54a376c4ad20a60731bb4a4eca5a25001fcfd1
Author: mfish33 <32677537+mfish33@users.noreply.github.com>
Date:   Sun Jan 9 15:52:55 2022 -0800

    Fix bounds with artboards for zoom-to-fit and scrollbar scaling (#473)

    * - document load keeps postition
    - zoom to fit
    - scrollbars use artboard dimensions

    * - review comments
    - svg export uses all artboard bounds

    Co-authored-by: Keavon Chambers <keavon@keavon.com>

commit 61432de4801d63d62faa18aaa624b11a122a97b1
Author: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Date:   Sat Jan 8 21:06:15 2022 +0000

    Fix rotation input (#472)

* Fix insert with no nesting at end of panel

* Deselect other layers on paste

* Resolve logging

* Rename document_message_handler.rs to portfolio_message_handler.rs

* Rename DocumentsMessage to PortfolioMessage

* Rename document_file.rs to document_message_handler.rs

* Standardize FrontendMessage message names

* Sort messages and message handlers

* Massively reorganize and clean up the whole Rust codebase (#478)

* Massively reorganize and clean up the whole Rust codebase

* Additional changes during code review

* Modify all message enum data to use named struct values, not tuples (#479)

* Massively reorganize and clean up the whole Rust codebase

* Modify all message enum data to use named struct values, not tuples

* Change canvas artboard background color to be 1 shade lighter

* Tweak whitespace around `use` statements and other lint fixes

* Fix all remaining Vue/TS errors flagged in Volar

* Set the mouse cursor in the canvas based on the current tool and its state (#480)

* Add FrontendMouseCursor and DisplayMouseCursor

* Add update_cursor method to the Fsm trait and implement it for all tools

* Rename DisplayMouseCursor to UpdateMouseCursor

* Add 'To CSS Cursor Property' transform decorator and change the mouse cursor in the canvas based on the current tool and its state

* Implement update_cursor for Navigate tool properly

* Keep the cursor when dragging outside of the canvas

* Change the mouse cursor to 'zoom-in' when LMB dragging on canvas with Navigate tool

* Rename FrontendMouseCursor to MouseCursorIcon

* Rename 'event' to 'e' and replace v-on with @

* Change the definition of the MouseCursorIcon type in TS

* Replace switch with dictionary look-up

* Move the definition of MouseCursorIcon closer to where it's used

* Do not transform layers when transforming a parent folder (#481)

* Modify all message enum data to use named struct values, not tuples (#479)

* Massively reorganize and clean up the whole Rust codebase

* Modify all message enum data to use named struct values, not tuples

* Do not transform layers when transforming parent

* Reduce complexity to O(nlogn)

* Add TODO comment about performance

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Dennis <dennis@kobert.dev>

* Make the toggle overlays button functional (#484)

* Make the toggle overlays button functional

* Move state from the OverlaysMessageHandler to DocumentMessageHandler

* Code review fixes

* Add cursors and hints to global viewport navigation (#487)

* Add global nav cursors

* Update hints on global navigation

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Fix sorting of message enum variants

* Reverse layer panel entries (#489)

* Reverse layer panel entries

* Ctrl + Bracket moves layers in correct direction

* Fix dragging layers in tree

* Fix reverse in wrong place

* Remove log

* Fix sorting of message enum variants

* Fix hotkeys

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Generify functions in document.rs (#488)

* Generify functions in document.rs

* Add alignment overlays (#462)

* Add alignment overlays

* Made snapping / overlays not render extra times, made snapping distance larger

* Revert snap tolerance change until user testing can be done

* WIP conversion to messages

* Revert "WIP conversion to messages"

This reverts commit ddcc23865a4a93639a0e4c60db66c664da8ccc09.

* Overlay document always has (0,0) in top left

* Fix AA on overlay lines

* Merge branch 'master' into alignment-overlays

* Squashed commit of the following:

commit dbc19912ca62b85c512985c10c1799cec1014c44
Author: asyncth <97792158+asyncth@users.noreply.github.com>
Date:   Sun Jan 16 12:57:03 2022 +0500

    Set the mouse cursor in the canvas based on the current tool and its state (#480)

    * Add FrontendMouseCursor and DisplayMouseCursor

    * Add update_cursor method to the Fsm trait and implement it for all tools

    * Rename DisplayMouseCursor to UpdateMouseCursor

    * Add 'To CSS Cursor Property' transform decorator and change the mouse cursor in the canvas based on the current tool and its state

    * Implement update_cursor for Navigate tool properly

    * Keep the cursor when dragging outside of the canvas

    * Change the mouse cursor to 'zoom-in' when LMB dragging on canvas with Navigate tool

    * Rename FrontendMouseCursor to MouseCursorIcon

    * Rename 'event' to 'e' and replace v-on with @

    * Change the definition of the MouseCursorIcon type in TS

    * Replace switch with dictionary look-up

    * Move the definition of MouseCursorIcon closer to where it's used

commit 9b36e6a909ce54bc8bb0db8d11b0caed3eebec85
Author: Keavon Chambers <keavon@keavon.com>
Date:   Sat Jan 15 17:24:58 2022 -0800

    Fix all remaining Vue/TS errors flagged in Volar

commit 2cc39cdb3782dc3ab42a0cb33f54af577a10b5bd
Author: Keavon Chambers <keavon@keavon.com>
Date:   Sat Jan 15 12:55:51 2022 -0800

    Tweak whitespace around `use` statements and other lint fixes

commit fa390c3875c9c355dc9c63a1f738575fb780f3b0
Author: Keavon Chambers <keavon@keavon.com>
Date:   Sat Jan 15 06:35:06 2022 -0800

    Change canvas artboard background color to be 1 shade lighter

commit ea2d00348474976a6021d06978cbead497bc6e2c
Author: Keavon Chambers <keavon@keavon.com>
Date:   Fri Jan 14 20:54:38 2022 -0800

    Modify all message enum data to use named struct values, not tuples (#479)

    * Massively reorganize and clean up the whole Rust codebase

    * Modify all message enum data to use named struct values, not tuples

commit 9b6cbb5f50f1c2493a6fbbbd6b2e34e83ce72b38
Author: Keavon Chambers <keavon@keavon.com>
Date:   Fri Jan 14 14:58:08 2022 -0800

    Massively reorganize and clean up the whole Rust codebase (#478)

    * Massively reorganize and clean up the whole Rust codebase

    * Additional changes during code review

commit a535f5c1c19c56f53e1d4d8bed7acafb2fac956b
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 12 16:17:40 2022 -0800

    Sort messages and message handlers

commit e70858884dc57cf678cb47bf7f38098e08279c1b
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 12 14:16:13 2022 -0800

    Standardize FrontendMessage message names

commit 0b4934b4f3754ed8732c0a7d50d87b4624874c3e
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 12 12:45:07 2022 -0800

    Rename document_file.rs to document_message_handler.rs

commit ec7bf4a771a3028b07879d1131041bcd9742f666
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 12 12:19:14 2022 -0800

    Rename DocumentsMessage to PortfolioMessage

commit 0991312ba009f6a1452a9892e7d5a248a22939ed
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 12 11:44:49 2022 -0800

    Rename document_message_handler.rs to portfolio_message_handler.rs

commit c76c92e50028feed99fccf509385baea9442bbdf
Author: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Date:   Wed Jan 12 19:05:55 2022 +0000

    Migrate to using MoveSelectedLayersTo (#469)

    * migrate to using MoveSelectedLayersTo

    * Fix dragging a selected layer with multiple selected layers

    * Fix CreatedLayer overriding selection

    * Fix MoveSelectedLayersTo behaviour

    * Squashed commit of the following:

    commit 095d577a49f6b904ba3038327109860e5519f981
    Author: Keavon Chambers <keavon@keavon.com>
    Date:   Mon Jan 10 18:06:12 2022 -0800

        Fix NumberInput clamping regression with undefined bounds

    commit 9f54a376c4ad20a60731bb4a4eca5a25001fcfd1
    Author: mfish33 <32677537+mfish33@users.noreply.github.com>
    Date:   Sun Jan 9 15:52:55 2022 -0800

        Fix bounds with artboards for zoom-to-fit and scrollbar scaling (#473)

        * - document load keeps postition
        - zoom to fit
        - scrollbars use artboard dimensions

        * - review comments
        - svg export uses all artboard bounds

        Co-authored-by: Keavon Chambers <keavon@keavon.com>

    commit 61432de4801d63d62faa18aaa624b11a122a97b1
    Author: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
    Date:   Sat Jan 8 21:06:15 2022 +0000

        Fix rotation input (#472)

    * Fix insert with no nesting at end of panel

    * Deselect other layers on paste

    * Resolve logging

commit 574028375b4b0aea6ccd76414dd93272a72add5f
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 12 06:14:32 2022 -0800

    Add `npm start` script alias for `npm run serve`

commit 75e8fc6614d4b498b0beb93ac9313144160e7689
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 12 05:17:56 2022 -0800

    Switch VS Code's Vue extension from Vetur to Volar

commit 389b445ef16065412759c4e4fc1e10835ebb8bdb
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 12 03:56:28 2022 -0800

    Remove Charcoal references from the code for now

commit 095d577a49f6b904ba3038327109860e5519f981
Author: Keavon Chambers <keavon@keavon.com>
Date:   Mon Jan 10 18:06:12 2022 -0800

    Fix NumberInput clamping regression with undefined bounds

commit 9f54a376c4ad20a60731bb4a4eca5a25001fcfd1
Author: mfish33 <32677537+mfish33@users.noreply.github.com>
Date:   Sun Jan 9 15:52:55 2022 -0800

    Fix bounds with artboards for zoom-to-fit and scrollbar scaling (#473)

    * - document load keeps postition
    - zoom to fit
    - scrollbars use artboard dimensions

    * - review comments
    - svg export uses all artboard bounds

    Co-authored-by: Keavon Chambers <keavon@keavon.com>

commit 61432de4801d63d62faa18aaa624b11a122a97b1
Author: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Date:   Sat Jan 8 21:06:15 2022 +0000

    Fix rotation input (#472)

commit 3eeac79f5a811c10ab898471f41bd796c5cf16b0
Author: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Date:   Sat Jan 8 16:30:03 2022 +0000

    Enhance the Navigate Tool zoom behavior (#461)

    * Snap zoom

    * Navigate zoom from centre

    * Ctrl to snap zoom in navigate

    * Use ctrl for global snap rotate

    * Fix the rotation input on snap rotate

    * Update hint to use ctrl

    * Fix mouse centre on drag

    * Click to zoom in

    * Clean up centre zoom

    * Update user input hints; tweak some variable names for clarity and standardization

    Co-authored-by: Keavon Chambers <keavon@keavon.com>

commit a2c2f7fc9da5beb73f677e95d5b4095cd8851318
Author: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Date:   Sat Jan 8 16:02:02 2022 +0000

    Add support for resizing workspace panels (#443)

    * Resize panels

    * Removing move_selection test pending #444 resolved

    * Bind event listners and cursor to the document

    * Fix flex grow on document being reset when drawing

    * Call onresize when the boundry is dragged

    * Add min panel size

    * Add explicit function return types

    * Dispatch resize event

    * Lock pointer instead of setting cursor on document

    Co-authored-by: otdavies <oliver@psyfer.io>
    Co-authored-by: Keavon Chambers <keavon@keavon.com>

commit 54e91211158c3b6e3f6597fde85f0340a75f1667
Author: mfish33 <32677537+mfish33@users.noreply.github.com>
Date:   Sat Jan 8 07:50:08 2022 -0800

    Implement artboards and document version enforcement (#466)

    * - graphite document artboard implementation
    - autosave document load hitch fix
    - Autosave will delete saved files when graphite document version changes

    * formating

    * - top left 0,0
    - fixed hitch on first document
    - vue calls first render

    * Revert

    * Merge branch 'master' into artboards

    * Small bug fixes and code review tweaks

    Co-authored-by: Oliver Davies <oliver@psyfer.io>
    Co-authored-by: Keavon Chambers <keavon@keavon.com>

commit 11f15bd6afa7f355b79e2b296f9397c5cb5ad783
Author: Leonard Pauli <leonardpauli@me.com>
Date:   Sat Jan 8 14:25:24 2022 +0100

    Path Tool: Implement anchor point dragging (#451)

    * #82 path-tool: WIP selecting control point working

    * Fix bug where duplication with Ctrl+D doesn't properly duplicate (#423)

    * bug fix: duplication didn't properly duplicate

    * cargo fmt

    * changed the formatting slightly for readability

    * Small cleanups, changed color of handles upon selection

    * Fix changes from merge

    * Remove duplicate anchor points on top of one another

    * Fix possible issues with thumbnails not being updated from Graphene operations

    * path-tool: attempt to move control points on click

    * Add dragging for control points

    * Editing shape anchors functional. Handles next.

    * Comment cleanup & slight cleanup of closest_anchor(..)

    * Removing conflict with master

    * Tiny code tweaks

    Co-authored-by: Keavon Chambers <keavon@keavon.com>
    Co-authored-by: caleb <56044292+caleb-ad@users.noreply.github.com>
    Co-authored-by: otdavies <oliver@psyfer.io>
    Co-authored-by: Dennis <dennis@kobert.dev>

commit 05e8a98f468cb3a8814cf02e482805ed1616e357
Author: Keavon Chambers <keavon@keavon.com>
Date:   Fri Jan 7 23:13:33 2022 -0800

    Redesign the Layer Tree UI (#468)

commit 8e3d2372289872716ab2567da744a213f0c4d1f3
Author: Oliver Davies <oliver@psyfer.io>
Date:   Fri Jan 7 15:53:12 2022 -0800

    Ungroup layers (#465)

    * WIP handling corner cases, like ungrouping subfolders

    * Resolved hanging

    * Fix recursive ungrouping

    * Functional, corner case free Ungroup. Small Undo issue & warnings

    * Update layertree upon undo

    * Also update  layerdata upon redo

    * Add some polish

    * Resolved TODOs

    * Oops didn't save all after rename, ha.

    Co-authored-by: Dennis <dennis@kobert.dev>

commit c1c719294862e049c55c0ede72f2014ba7851dc4
Author: TrueDoctor <dennis@kobert.dev>
Date:   Fri Jan 7 04:15:08 2022 +0100

    Tidy up path handling in document_file (#464)

    * Tidy up path handling in document_file

    + Improve #455

    * Cargo Clippy lints

    * Rename to_vec to map_to_vec

    Co-authored-by: Oliver Davies <oliver@psyfer.io>

commit f4707f9b741973adddf769dee1b64effcc702805
Author: mfish33 <32677537+mfish33@users.noreply.github.com>
Date:   Thu Jan 6 18:45:37 2022 -0800

    Better decimal rounding in the NumberInput widget (#457)

    * better decimal rounding in NumberInput

    * - created function to reuse
    - used math instead of string manipulation

    * updated comment to be correct

    * updated comment

    * updated comment

commit 0219f060b8e13b7dc9e47335f130d1737b9a8529
Author: Keavon Chambers <keavon@keavon.com>
Date:   Wed Jan 5 05:40:32 2022 -0800

    Fix build script to use correct branch name

* Fix indentation

* Overlays fade in

* Fix formatting

* Add consts for snap visible and opacity

* Tweak constants for improved UX, rejigger imports

* Fix AA bounding box

* Snap only visible layers

* Add some comments

Co-authored-by: otdavies <oliver@psyfer.io>
Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Move scrollable behavior into LayoutRow/LayoutCol

* Clean up web code's use of display CSS properties, using <LayoutRow>/<LayoutCol> where intended

* Simplify point storage for pen tool (#500)

Store points as vectors instead of representing them as transforms to
avoid confusion and improve efficiency

* Add folder outline insert marker and clean up layer insertion Vue code (#497)

* Add folder insert outline

* Fix typo

* Use v-bind for insert folder class

* Remove v-bind prefix

* Convert to using v-if for the insert marker

* Simplify Vue-based insertion lines with pseudo elements
Regression I caused: can't insert in bottom of folder listing

* Fix the insertion-at-bottom-of-folder bug

* Apply folder insertion to the layer not its row

* Convert to using an absolutly positioned marker

* Remove v-bind prefix

* Remove other v-bind prefix

* Cleanup css

* Little code review nitpicks

* Better name for closest

* Rename js constants

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add folder outline insert marker and clean up layer insertion Vue code (#497)

* Add folder insert outline

* Fix typo

* Use v-bind for insert folder class

* Remove v-bind prefix

* Convert to using v-if for the insert marker

* Simplify Vue-based insertion lines with pseudo elements
Regression I caused: can't insert in bottom of folder listing

* Fix the insertion-at-bottom-of-folder bug

* Apply folder insertion to the layer not its row

* Convert to using an absolutly positioned marker

* Remove v-bind prefix

* Remove other v-bind prefix

* Cleanup css

* Little code review nitpicks

* Better name for closest

* Rename js constants

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add folder outline insert marker and clean up layer insertion Vue code (#497)

* Add folder insert outline

* Fix typo

* Use v-bind for insert folder class

* Remove v-bind prefix

* Convert to using v-if for the insert marker

* Simplify Vue-based insertion lines with pseudo elements
Regression I caused: can't insert in bottom of folder listing

* Fix the insertion-at-bottom-of-folder bug

* Apply folder insertion to the layer not its row

* Convert to using an absolutly positioned marker

* Remove v-bind prefix

* Remove other v-bind prefix

* Cleanup css

* Little code review nitpicks

* Better name for closest

* Rename js constants

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Implement layer renaming (#501)

* Implement layer renaming

* Fix sneaky typo in CSS

Co-authored-by: Moritz Vetter <16950410+HansAuger@users.noreply.github.com>

Co-authored-by: Moritz Vetter <16950410+HansAuger@users.noreply.github.com>

* Implement Freehand Tool (#503)

* Implement freehand tool

* Address review comments

* Consistent ordering of tools

* Add hotkey N for freehand tool

* Tweak freehand tool hint

* Implement the Text Tool and text layer MVP (#492)

* Add text tool

* Double click with the select tool to edit text

* Fix (I think?) transitioning to select tool

* Commit and abort text editing

* Transition to a contenteditable div and autosize

* Fix right click blocking

* Cleanup hints

* Ctrl + enter leaves text edit mode

* Render indervidual bounding boxes for text

* Re-format space indents

* Reflect font size in the textarea

* Fix change tool behaviour

* Remove starting text

* Populate the cache (caused doc load bug)

* Remove console log

* Chrome display the flashing text entry cursor

* Update overlay on input

* Cleanup input.ts

* Fix bounding boxes

* Apply review feedback

* Remove manual test

* Remove svg from gitignore

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Layout system implementation and applied to tool options bar (#499)

* initial layout system with tool options

* cargo fmt

* cargo fmt again

* document bar defined on the backend

* cargo fmt

* removed RC<RefCell>

* cargo fmt

* - fix increment behavior
- removed hashmap from layout message handler
- removed no op message from layoutMessage

* cargo fmt

* only send documentBar when zoom or rotation is updated

* ctrl-0 changes zoom properly

* Code review changes

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Fix overlays on document switching (#505)

* Fix overlays on document switching

* Fix generating new document

* Move messages

* Abort tool when deleteing active document

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Rename deployment script

* Clean up text input (#506)

* Fix firefox text input

* Fix descenders below bounding box

* Fix chromium empty text

* Descenders back below baseline

* Fix trailing newline on chromium

* Reinstate correct baseline height

* Fix highlighted new line on empty text

* Add comment for trailing new line removal

* Extract cleanupTextInput to a separate file

* Function import simplification

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Transformation cage (#502)

* Render corners and edges of selection box

* Refactor

* Add drag detection

* Implement the transform handles

* Implement rotation by dragging <40px from bounds

* Refine clustered handle behaviour

* Add cursors

* Add snap angle

* Fix MMB drag whilst in select tool

* Convert calculate_pivot into a seperate function

* rename start_vec to start_offset

* Fix typo

* Remove Undo transaction on <10px mouse move

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Double click on a SimpleShape to path edit (#507)

* Add log level selection to help menu (#511)

* Add log level selection to help menu

* Show keyboard shortcuts in loglevel menu items

* Bump follow-redirects from 1.14.5 to 1.14.7 in /frontend (#515)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.5 to 1.14.7.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.5...v1.14.7)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump nanoid from 3.1.30 to 3.2.0 in /frontend (#514)

Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.30 to 3.2.0.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.30...3.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Solve "Coming Soon" dialog from bubbled click event on sub-menu entries (#517)

* Fix shape not closed after using Fill Tool (#510)

* Always set shape property 'closed' on fill

* Remove closed property on Shape

* Make color mandatory in Fill

* Fix intersection for filled but open shapes

* Code style tweak

* Add TODO note to rework ClosePath check

* De duplicate Overlay render messages (#520)

* Set text fill color to the primary color (#521)

* Fix text has no fill

* Use primary color for text fill

* Use correct text color when editing

* Change fallback text color to gray

* Place new layers in tree based on layer selection (#526)

* place new layers based on layer selection

* Add the TextInput widget (#518)

* Separate out the number input from a generic field input

* Add TextInput widget

Co-authored-by: mfish33 <32677537+mfish33@users.noreply.github.com>

* Overhaul Path Tool (#498)

* First pass cleanup omw to handles

* Handles dragging with anchors, handles still not draggable and some bugs

* Dragging single side of handle works, need to create mirror case

* In progress addition of improved anchor / handle representation

* partially working

* Handle dragging working for non-end points, normal anchor drag bugged

* Fixed corner cases, fixed anchors without handles bug

* Add snapping

* Change path tool selection by clicking on shape

* Fixed path close point being draggable

* Variable length handle, firstpass of alt to stop mirroring

* Alt improved, not done. Only update structures when needed. Added snapping for selected shapes

* Can now undo path edits

* Do not maintain angle between non-mirrored handles

* Replaced segment based overlay setup with anchor based setup

* Cleanup, handle angle comparison bug remains. Investigating.

* Added OverlayPooler. May closely associate overlays to VectorManipulatorAnchors instead.

* Moved anchor / segment creation logic out of document_message_handler

* Overlays are now managed by VectorManipulatorShapes

* Fixed inconsistent handle mirroring.

* Clearly shows which point you have selected

* Removed OverlayPooler system

* Added more comments

* Removed all clones of the vector structures. A little uglier but better.

* Resolved Text path initialization bug with a workaround.

* Cleaned up comments

* More comment cleanup

* Fixed issue with quad handle dragging unwanted behavior, renamed VectorShapeManipulator

* In progress refactor to allow multi-selection

* In progress dragging multiple points, selection works, transform still has issues

* Added Multiselect, major refactor

* Commented out progress for selection change, bug with hop back on multiple shapes

* Removed debug og

* Resolved issue with merge

* Minor cleanup, added a few comments

* Review changes

* Resolved unclear comment

* Fixed snap back for now

* Add todo comment for future snap back fix

* Working situations where curve paths do not close. Thanks for points it out  @pkupper

* Tweaked selection size

* Fix curve start point dragability, renames, cleanup

* Separated into multiple files, applied @TrueDoctor review feedback

* Resolved tests failing due to doc generation

* Re-added closed, added concept of distance mirroring

* Added shift distance mirroring, removed debounce from anchor

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Thank you for the reviews @TrueDoctor and @pkupper

* Fix TextInput widget casting from string to number by mistake (#528)

* Implement the Crop Tool for artboard resizing (#519)

* Extract transformation cage to a seperate file

* Hook up tool

* Implement resize

* Draw artboards

* centre and constrain

* Bounding box is rotated

* Fix transform handle positions for artboard

* Drag layers

* Snapping

* Fix imports

* Cleanup

* Remove allocation from bounding_boxes

* Round artboard size and position

* Hints

* Fix rotated transform cage

* Code review changes

* Hints changes

Co-authored-by: Dennis <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Implement the Spline Tool (#512)

* Add Spline Tool

* Adapt to changes from master

* Apply review feedback

* Fixes

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Improve Path Tool hint text

* Polishing: standardize binding JS resize event (fixes non-integer AA rendering); remove "X" to delete; cleanup

* Allow deleting artboards (#533)

* Properly show document bar on initialization (#535)

* properly show document bar

* updated comments

* Add Pen Tool  (#536)

* First steps toward pen tool, similar to spline tool currently.

* Broken WIP

* Progress, but still glitchy

* Improvements, a little farther

* Pen tool functioning as expected

* Merged master

* Fixed commit bug and overlay flashing

* Reordered import statements

TODO: Resolve issue with last segment losing its handle position on confirm

* Implement the Properties panel with a transform section for layers (#527)

* initial layout system with tool options

* cargo fmt

* cargo fmt again

* document bar defined on the backend

* cargo fmt

* removed RC<RefCell>

* cargo fmt

* - fix increment behavior
- removed hashmap from layout message handler
- removed no op message from layoutMessage

* cargo fmt

* only send documentBar when zoom or rotation is updated

* ctrl-0 changes zoom properly

* unfinished layer hook in

* fix layerData name

* layer panel options bar

* basic x/y movment

* working transform section

* changed messages from tuples to structs

* hook up text input

* - fixed number input to be more clear
- fixed actions for properties message handler

* Add styling

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Boolean shape operations (#470)

* added BooleanUnion message for select tool, which is sent by the BooleanUnion button

* select to dispatches a BooleanUnion message
   - as far as I can tell the selected layers aren't stored anywhere

* Added neccesary messages and functions for boolean operation

* Intersection code, as yet untested
does not compile

* Updated intersection algorithm

* Fixed shapes_as_seen
   - should not be effected by root transform, should be effected by the shape transform
Working line intercepts

* updated intersection algorithm

…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[G], [R], and [S] key should grab, rotate, and scale the selected layers
3 participants