Commit Graph
100 Commits
Author SHA1 Message Date
Keavon Chambers 767b1a01b1 Release Alpha Milestone 1! 2022-02-12 09:31:48 -08:00
Keavon Chambers c4fdc28449 Polishing: standardize binding JS resize event (fixes non-integer AA rendering); remove "X" to delete; cleanup 2022-02-10 02:29:45 -08:00
Keavon Chambers cb518c6ce0 Improve Path Tool hint text 2022-02-09 16:52:54 -08:00
Keavon Chambersandmfish33 99bf6c496f 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>
2022-02-09 12:16:44 -08:00
Keavon Chambers 4d232e6b46 Solve "Coming Soon" dialog from bubbled click event on sub-menu entries (#517) 2022-02-05 13:49:12 -08:00
Keavon Chambers dd36339605 Rename deployment script 2022-02-03 18:29:02 -08:00
Keavon ChambersandMoritz Vetter dae79caf15 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>
2022-01-29 11:04:15 -08:00
Keavon Chambers c215719598 Clean up web code's use of display CSS properties, using <LayoutRow>/<LayoutCol> where intended 2022-01-23 20:24:50 -08:00
Keavon Chambers 12ef88f261 Move scrollable behavior into LayoutRow/LayoutCol 2022-01-23 15:07:10 -08:00
Keavon Chambers 841f34e797 Fix sorting of message enum variants 2022-01-16 13:59:55 -08:00
Keavon Chambers 73448a4849 Make the toggle overlays button functional (#484)
* Make the toggle overlays button functional

* Move state from the OverlaysMessageHandler to DocumentMessageHandler

* Code review fixes
2022-01-16 09:40:47 -08:00
Keavon Chambers 34664e7c56 Fix all remaining Vue/TS errors flagged in Volar 2022-01-15 18:04:34 -08:00
Keavon Chambers ab0a55f6ce Tweak whitespace around use statements and other lint fixes 2022-01-15 12:55:51 -08:00
Keavon Chambers c46edfdc5b Change canvas artboard background color to be 1 shade lighter 2022-01-15 06:35:06 -08:00
Keavon Chambers b3cf1a42bd 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
2022-01-14 20:54:38 -08:00
Keavon Chambers 40d5960571 Massively reorganize and clean up the whole Rust codebase (#478)
* Massively reorganize and clean up the whole Rust codebase

* Additional changes during code review
2022-01-14 14:58:08 -08:00
Keavon Chambers f63424b676 Sort messages and message handlers 2022-01-12 16:17:40 -08:00
Keavon Chambers cf66f387d5 Standardize FrontendMessage message names 2022-01-12 14:16:13 -08:00
Keavon Chambers 4d9fcd0b77 Rename document_file.rs to document_message_handler.rs 2022-01-12 12:45:07 -08:00
Keavon Chambers b4885d40c1 Rename DocumentsMessage to PortfolioMessage 2022-01-12 12:19:14 -08:00
Keavon Chambers 600e97eb7c Rename document_message_handler.rs to portfolio_message_handler.rs 2022-01-12 11:57:36 -08:00
Keavon Chambers df9977194b Add npm start script alias for npm run serve 2022-01-12 06:14:32 -08:00
Keavon Chambers 97db01ebac Switch VS Code's Vue extension from Vetur to Volar 2022-01-12 05:17:56 -08:00
Keavon Chambers bb5d0e954c Remove Charcoal references from the code for now 2022-01-12 03:56:28 -08:00
Keavon Chambers a2f39f48e3 Fix NumberInput clamping regression with undefined bounds 2022-01-10 18:06:12 -08:00
Keavon Chambers f6bfe595f4 Redesign the Layer Tree UI (#468) 2022-01-07 23:13:33 -08:00
Keavon Chambers c9848a1661 Fix build script to use correct branch name 2022-01-05 05:42:30 -08:00
Keavon Chambers 9ec3f06027 Vue/TS bug and bad typing fixes 2022-01-02 20:02:35 -08:00
Keavon Chambers 7e0cbb60b4 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
2022-01-02 06:00:02 -08:00
Keavon Chambers 1954aceb0e Rename Editor's LayerData to LayerMetadata 2021-12-31 00:02:29 -08:00
Keavon Chambers 0482037bc6 Fix all clippy lint errors 2021-12-30 23:05:54 -08:00
eb96eafe60 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>
2021-12-30 09:48:39 -08:00
Keavon Chambers e13e9337f4 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
2021-12-24 01:46:03 -08:00
Keavon Chambers 6dd8e35461 Fix previous commit by mapping codes to keys 2021-12-23 16:09:04 -08:00
Keavon Chambers 0203efc868 Add a temporary solution to non-Latin keyboards being unusable 2021-12-23 13:29:02 -08:00
Keavon Chambers 80a3e41654 Make the Pen Tool confirm when leaving the tool 2021-12-21 18:48:21 -08:00
Keavon Chambers bf6b76a20a Skip the web page close confirmation when crashed or in debug mode 2021-12-21 18:43:02 -08:00
Keavon Chambers de7490ede0 Set Cargo.toml versions to 0.0.0 to avoid version confusion 2021-12-20 14:59:47 -08:00
Keavon Chambers 1e57f658dc Upgrade node packages (#413) 2021-12-20 13:09:24 -08:00
Keavon Chambers 6099c9a34e Skip cargo-about in CI to save 5 minutes (#409) 2021-12-20 02:22:19 -08:00
Keavon Chambers 3c1ed1a235 Make deployment switch branch from HEAD to master 2021-12-16 03:21:52 -08:00
Keavon Chambers c2195c2819 Add the Help > About Graphite dialog with build info
Closes #404
2021-12-16 02:49:36 -08:00
Keavon Chambers 7681efa056 Clean up JS message dispatcher and fix a bug thrown on empty-data messages
Fixes bug in #394
2021-12-16 02:49:12 -08:00
Keavon Chambers 739b41bdf7 Fix floating menus above scrollable content; they now respect content's preferred width at edges 2021-12-15 04:05:07 -08:00
Keavon Chambers d0045a6c99 Update the project readme 2021-12-06 16:53:44 -08:00
Keavon Chambers 2be32af44a Fix bug in last commit that broke when scrolling on SVG elements 2021-12-06 02:55:05 -08:00
Keavon Chambers c2253d3ce0 Enable vertical scroll wheel on horizontal scrollable containers 2021-12-05 20:05:45 -08:00
Keavon Chambers 6a30b46793 Switch CI and CD scripts to use npm ci instead of npm install 2021-12-05 19:22:57 -08:00
Keavon Chambers e0682e7fa2 Fix ESLint configuration triggering an error in the ESLint VS Code extension 2021-12-05 19:22:56 -08:00
Keavon Chambers 71e967d043 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.
2021-12-04 22:30:07 -08:00
Keavon Chambers c3ec2f76e9 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
2021-11-29 03:32:09 -08:00
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