Commit Graph
100 Commits
Author SHA1 Message Date
Keavon Chambers b8b91c6a9c Upgrade rustfmt to 2021 edition 2021-11-02 20:08:39 -07:00
Keavon Chambers 8ddd7ebe88 Update various node dependencies (#391) 2021-11-01 02:57:08 -07:00
Keavon Chambers 0cce25b8bf Update notice for Safari users that BigInt64Array is now supported in 15 (#390) 2021-11-01 01:16:19 -07:00
Keavon Chambers ac2aede4b9 Replace vue-svg-loader dependency with simple JS file (fixes a security alert) (#389) 2021-11-01 00:49:44 -07:00
Keavon Chambers dc1b53b721 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>
# Conflicts:
#	Cargo.lock
2021-11-01 00:00:22 -07:00
Keavon ChambersandDennis Kobert f5e03df80b 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>
2021-09-11 17:15:51 -07:00
Keavon Chambers 88bb24a206 Add an intentional panic for debug 2021-09-11 09:46:55 -07:00
Keavon Chambers 946115973d Change scrollbar drag color 2021-09-11 08:17:05 -07:00
Keavon Chambers 763231d5ad Additional improvements to license notice formatting 2021-09-06 23:55:51 -07:00
Keavon Chambers ef73effe8a Auto-generate third-party license notices (#370)
Closes #294
Closes #371
2021-09-06 06:57:35 -07:00
Keavon Chambers 2cd4219842 Upgrade wasm-pack to 0.10.1 (#369)
Closes #167
2021-09-05 18:43:16 -07:00
Keavon Chambers afe36dda42 Postpone 0.1 launch in readme from Aug to early Sept 2021-09-01 06:18:43 -07:00
Keavon Chambers bfeb3e8637 Reorganize and clean up the WASM wrapper 2021-09-01 06:10:05 -07:00
Keavon Chambers 6e546aa726 Improve and clean up panic dialog code and wasm wrapper (#368)
Part of #357
2021-09-01 04:09:23 -07:00
Keavon Chambers 4f78c50010 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
2021-08-31 18:34:19 -07:00
Keavon Chambers dd7cee09d0 Additional WASM translation layer cleanup 2021-08-31 01:40:11 -07:00
Keavon ChambersandDennis Kobert 4629b7cd3d 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>
2021-08-29 08:27:49 -07:00
024ce9dcfa 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>
2021-08-29 00:10:54 -07:00
Keavon Chambers 641d534a58 Fix bug where swiching to the Fill Tool would trigger a fill operation 2021-08-27 05:06:41 -07:00
Keavon Chambers 98bc273a9c Minor code readability improvements 2021-08-27 03:43:03 -07:00
Keavon Chambers 7138580ea3 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
2021-08-27 02:19:30 -07:00
Keavon Chambers 8936fdfffa Update the readme 2021-08-15 02:40:30 -07:00
Keavon Chambers eff511b00d 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
2021-08-14 05:38:35 -07:00
Keavon ChambersandDennis Kobert d82e328a73 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>
2021-08-14 02:45:24 -07:00
Keavon Chambers 8551121793 Disallow snake_case variable names in frontend 2021-08-12 21:49:03 -07:00
Keavon Chambers 395e2b86ea Miscellaneous minor code cleanup
# Conflicts:
#	graphene/Cargo.toml
2021-08-12 20:34:36 -07:00
Keavon Chambers 3ae376e0e8 Replace promise with await in MenuList.vue 2021-08-12 19:25:57 -07:00
Keavon Chambers e494b43029 Add number labels to ruler marks 2021-08-12 02:55:00 -07:00
Keavon Chambers 71eed244d1 Update terminology in the docs 2021-08-12 00:39:29 -07:00
Keavon Chambers 99a7dbdb97 Clean up popovers: background color and placeholder text 2021-08-11 23:53:05 -07:00
Keavon Chambers e065046841 Revert "Fix floating menu positioning behavior when web page has scrollbars (#263) (#341)"
This reverts commit 02fd00da10.
2021-08-11 23:49:31 -07:00
Keavon Chambers e00b040ce1 Update npm dependencies 2021-08-10 20:25:21 -07:00
Keavon Chambers 8bdca0b301 Fix documentation links 2021-08-10 20:03:30 -07:00
Keavon Chambers a570ff22e8 Improve document zooming to work based on nice steps (#336)
* Improve document zooming to work based on nice steps

* Code review improvements
2021-08-10 16:21:18 -07:00
Keavon Chambers ca40e373bf Upgrade packages and a couple fix warnings 2021-08-09 18:41:29 -07:00
Keavon Chambers f73ee29fdd Add DisplayError to show user errors from the backend 2021-08-08 16:52:09 -07:00
Keavon Chambers 4b9c2eb793 Restructure project directories (#333)
`/client/web` -> `/frontend`
`/client/cli` -> *delete for now*
`/client/native` -> *delete for now*
`/core/editor` -> `/editor`
`/core/document` -> `/graphene`
`/core/renderer` -> `/charcoal`
`/core/proc-macro` -> `/proc-macros` *(now plural)*
2021-08-07 05:17:18 -07:00
Keavon Chambers f26a0e26b0 Refactor RadioInput widget (#332) 2021-08-07 03:15:40 -07:00
Keavon Chambers a9364f5122 Refactor document tab management from Panel.vue into utilities/documents.ts 2021-08-04 12:39:39 -07:00
Keavon ChambersandDennis Kobert bff82fe238 Add a selected_layers() function and refactor code to use it (#314)
* Add a selected_layers() function 

* Refactor AlignSelectedLayers

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2021-08-01 10:29:23 +02:00
Keavon Chambers 19398e1dc8 Add checkbox to MenuBarInput widget 2021-07-31 18:20:51 -07:00
Keavon Chambers 170cda7357 Add DialogModal and use it for close confirmations and "coming soon" features (#322)
Closes #269
Closes #196

* Add DialogModal and use it for close confirmations and "coming soon" features

* Code cleanup; add Enter key to accept emphasized dialog button
2021-07-31 14:30:31 -07:00
Keavon Chambers e1698c2783 Add TextButton widget (#321) 2021-07-31 04:58:25 -07:00
Keavon Chambers 8ed28daaf4 Fix two small bugs introduced in #311 2021-07-30 18:46:23 -07:00
Keavon Chambers 864a348e30 Add "Sides" label to Shape Tool's options bar number input 2021-07-30 15:45:49 -07:00
Keavon Chambers ba83cfd958 Add the ability for NumberInput widgets to display labels
Part of #313
2021-07-29 13:56:45 -07:00
Keavon Chambers ab651268d8 Layer opacity (#312)
Closes #187

* Add layer opacity input

* Improve Rust code cleanliness
2021-07-27 23:15:23 -07:00
Keavon Chambers a288d51543 Add features to NumberInput widget; refactor widgets and tool options (#311)
Closes #310

* Add features to NumberInput widget; refactor widgets and tool options

* Fix swap/reset working colors using @click instead of :action
2021-07-27 18:28:21 -07:00
Keavon Chambers 8c91683c5b Fix antialiasing caused by <svg> width/height 100% 2021-07-25 17:25:39 -07:00
Keavon Chambers f7d7257d50 Swap "Layer" and "Document" menu bar entries 2021-07-24 01:54:27 -07:00
Keavon Chambers 1821d3001a Fix inconsistent whitespace 2021-07-23 17:48:39 -07:00
Keavon Chambers 9daffb3dad Improve various code and docs spelling/grammar 2021-07-23 17:25:05 -07:00
Keavon Chambers 150b530a73 Fix tooltips in Document panel 2021-07-19 18:02:08 -07:00
Keavon Chambers 5b5388a1d6 Fix dropdown menu widget showing wrong active entry
Fixes #250
2021-07-19 15:03:08 -07:00
Keavon Chambers 209d71ddc2 Add (nonfunctional) rulers and scrollbars to the viewport (#279)
* Add nonfunctional rulers and scrollbars to viewport

* Switch from DOM divs to SVG lines

* Switch from SVG lines to a single SVG path

* Change variable names
2021-07-17 16:11:52 -07:00
Keavon Chambers 1e786750c5 Remove outdated todo comment 2021-07-17 03:36:35 -07:00
Keavon Chambers 0c25031ad1 Clean up widget type naming conventions 2021-07-16 15:57:42 -07:00
Keavon Chambers 60968431b4 Categorize frontend widgets to match design system 2021-07-16 15:37:35 -07:00
Keavon Chambers 59b817301d Edit readme with various updates and simplifications 2021-07-16 04:01:32 -07:00
Keavon Chambers a25fb40fd5 Remove CLI client stub 2021-07-15 03:44:57 -07:00
Keavon Chambers 8591dd2983 Adjust OptionalInput widget design to add back its right border 2021-07-15 01:01:05 -07:00
Keavon Chambers 761406537c Rename tool icons 2021-07-15 00:46:32 -07:00
Keavon Chambers 8a06e8e771 Switch all JS imports to absolute paths 2021-07-15 00:34:56 -07:00
Keavon Chambers 0b44a17a5d Make frontend request tab list on initialization 2021-07-15 00:07:21 -07:00
Keavon Chambers 34828a7837 Cleanup of variable naming 2021-07-14 20:11:51 -07:00
Keavon Chambers ca50e8f37d Add a fullscreen button and the keyboard lock API (#266)
Closes #249
2021-07-14 18:56:22 -07:00
Keavon Chambers 2aff782e70 Enforce downgraded dependency versions in package.json 2021-07-14 16:51:56 -07:00
Keavon Chambers 62092910ef Implement closing the current, and all, documents from the menu bar (#265)
Closes #261
Additional cleanup and refactoring with the way the backend relays the list of open documents to the frontend and prompts for confirmation.
2021-07-14 16:13:58 -07:00
Keavon Chambers d311ac6bfc Frontend refactor to move response handler, key input handling, and more into new utilities folder (#260)
Part of #124
2021-07-14 14:31:09 -07:00
Keavon Chambers 00d6c3a5d7 Clean up and polish some code from the previous commit (#255) 2021-07-13 00:52:45 -07:00
Keavon Chambers bc11e30785 Add a pull request template so GitHub reminds to reference issue numbers 2021-07-10 13:58:54 -07:00
Keavon Chambers f9337bf635 Downgrade wasm-pack and Vue-related dependencies which are causing issues
This reverts commit 744e3729d7.
2021-07-09 20:29:14 -07:00
Keavon Chambers 4ddb69d07e Improve panel tabs to fix pixel mislaignments and support MMB closing 2021-07-09 16:49:54 -07:00
Keavon Chambers e215495430 Improve readability of OptionalInput widget design styling 2021-07-09 16:02:36 -07:00
Keavon Chambers 12dac1c154 Add the checkbox input widget (#204)
* Add the checkbox input widget

* Add OptionalInput widget
2021-07-08 14:10:30 -07:00
Keavon Chambers 8eea3720f2 Fix horizontal scrollbar due to status bar negative margin 2021-07-05 00:38:18 -07:00
Keavon Chambers 2ce6ca0935 Downgrade @vue/compiler-sfc which breaks linting 2021-07-02 15:02:01 -07:00
Keavon Chambers 77021176b2 Update wasm-pack dependency and others, fixes #167 2021-07-02 13:51:00 -07:00
Keavon Chambers 55d2fc4408 Add styled scrollbars (#231) 2021-07-01 22:08:23 -07:00
Keavon Chambers 6db1d907c3 Fix bug where other panel tabs would switch the document panel tabs 2021-06-26 23:46:39 -07:00
Keavon Chambers 60cf084684 Separate Graphite header logo from menu bar 2021-06-25 00:38:32 -07:00
Keavon Chambers ce98060cc4 Add "Guide Mode" to viewport mode selector dropdown 2021-06-23 23:10:48 -07:00
Keavon Chambers 8a56d6cf46 Reduce the greediness of keyboard input redirection
Part of #124
2021-06-20 02:06:40 -07:00
Keavon Chambers 1c2e667769 Add info to README to help with a possible Windows compilation issue 2021-06-13 16:05:58 -07:00
Keavon Chambers 741a712972 Fix Layer Tree panel CSS to allow scrolling (#208) 2021-06-13 12:29:50 -07:00
Keavon Chambers ca712813c3 Add additional keyboard shortcut tooltips 2021-06-13 11:20:48 -07:00
Keavon Chambers f53c907c03 Change default document title to "Untitled Document" 2021-06-13 01:46:18 -07:00
Keavon Chambers 1686660306 Add a contributing section to the project README 2021-06-12 21:34:09 -07:00
Keavon Chambers ececca3858 Remove early sample "greet" code 2021-06-12 12:07:50 -07:00
Keavon Chambers a3b679e64d Improve UI behavior at smaller screen sizes so status bar overflows (#158)
Also includes various CSS flex-related cleanup throughout the UI.
Progress for #150
2021-06-08 00:54:24 -07:00
Keavon Chambers 91303459a9 Add the Dropdown Input widget (#168)
Fixes #135.

* Add the Dropdown Input widget

* Fix font loading race condition
2021-06-06 02:17:36 -07:00
Keavon Chambers eae2d70e93 Implement "Export" entry in File menu; add Copy/Paste icons in Edit menu 2021-06-01 19:49:04 -07:00
Keavon Chambers ad9feda054 Implement menu bar floating list menus (#163)
Progress towards #135
2021-05-31 11:51:32 -07:00
Keavon Chambers 83984700bf Generalize and rename overlays as "floating menus"
Progress towards #135.
2021-05-29 21:55:43 -07:00
Keavon Chambers 9f63c6e8ea Fix missing keyboard shortcut <P> for the Pen Tool 2021-05-27 22:10:48 -07:00
Keavon Chambers 6331325ae0 Minor CSS custom property rename for accuracy 2021-05-27 15:03:49 -07:00
Keavon Chambers c2314df8d5 Fix layer visibility icons incorrectly referenced in previous cleanup commit. 2021-05-27 09:26:38 -07:00
Keavon Chambers c205fec0d4 Move all icon SVG imports to the Icon component
This change also removes the need to specify the icon size.
2021-05-27 02:14:32 -07:00
Keavon Chambers 313a1dfc65 Standardize icon sizes and folder paths (closes #110) 2021-05-27 00:14:50 -07:00
Keavon Chambers 3fba54fad1 Fix popover positioning regression 2021-05-25 21:49:43 -07:00