Skip to content

Feature: savebutton #535

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

Open
wants to merge 82 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
82b8ef8
Merge pull request #488 from open-source-labs/dev
henry-sweat Nov 16, 2023
7ba45fd
9.0.0
henry-sweat Nov 16, 2023
179dc7a
Fixed canvas camera so that it is no longer inverted
mayson124 Jan 20, 2024
7f73726
Fixed directions of node keyboard movement
mayson124 Jan 22, 2024
1e100c2
1/22/24: Understanding the Codebase
isaacb0 Jan 23, 2024
81d96d0
Added option + tab functionality to allow cycling through nodes via j…
mayson124 Jan 23, 2024
610ddb5
Added option + tab functionality to allow cycling through nodes via j…
mayson124 Jan 23, 2024
cbdd44c
Merge pull request #1 from oslabs-beta/mayson/canvaskeyboardFunc
isaacb0 Jan 23, 2024
0b56b6d
Updated gitignore
isaacb0 Jan 23, 2024
bb87330
Merging changes from dev to isaac-feature-branch.
isaacb0 Jan 23, 2024
66029a0
1/23/24 - Typing, comments, and test rendering
isaacb0 Jan 24, 2024
9869e96
Added keyboard shortcut 'l' to toggle light and dark mode, added keyb…
mayson124 Jan 24, 2024
a75eb2c
Added a minimap toggle using the key 'm' and added the sandbox elemen…
mayson124 Jan 24, 2024
35eea8c
1/24/24
isaacb0 Jan 24, 2024
1815cb1
Added testing for accessibility. Updated playwright.config.ts file to…
chobo91 Jan 25, 2024
f3de564
Added sandbox elements to the dev canvas
mayson124 Jan 25, 2024
accd30b
1/25/24 - Successfully Saving Graph State to Local Storage
isaacb0 Jan 25, 2024
437ec56
Added controls toggle using the key 'c' and added ability to render e…
mayson124 Jan 25, 2024
31cfdf9
01/25/24 Added new key functionality
mayson124 Jan 25, 2024
e7a1f87
page.svelte
mayson124 Jan 25, 2024
460bff7
Delete README.md
mayson124 Jan 26, 2024
527c581
Delete package-lock.json
mayson124 Jan 26, 2024
3e28ce1
Delete package.json
mayson124 Jan 26, 2024
918d983
Merge pull request #3 from oslabs-beta/isaac-feature-branch
mayson124 Jan 26, 2024
df76e32
PR fix
mayson124 Jan 26, 2024
8deb507
Issac PR
mayson124 Jan 26, 2024
c2f6e7f
Merge pull request #4 from oslabs-beta/mayson/keyboardFunctionality
isaacb0 Jan 26, 2024
fc5b58f
Update Gitignore and Svelvet files
chobo91 Jan 26, 2024
84cc101
Feb 1, 2023
mayson124 Feb 1, 2024
67e2419
Feb 1, 2024 High Contrast Themes
mayson124 Feb 1, 2024
92bc7dc
2/1/24 Allow users to save the state of their camera position in comp…
isaacb0 Feb 2, 2024
76b638b
Merge remote-tracking branch 'origin/isaac-feature-branch' into isaac…
isaacb0 Feb 2, 2024
690c9b7
Feb 2, 2023
mayson124 Feb 2, 2024
9f4e90a
2/2/24 Recover package.json/readme
isaacb0 Feb 2, 2024
9b80775
Feb 2, 2024
mayson124 Feb 2, 2024
7170b9f
Merge remote-tracking branch 'origin/dev' into isaac-feature-branch
isaacb0 Feb 2, 2024
549e522
test commit
mayson124 Feb 3, 2024
c0c7b78
test commit
mayson124 Feb 3, 2024
5d8d0d0
2/3/24 Push Isaac's working local dev branch onto remote dev branch
isaacb0 Feb 3, 2024
028300c
test commit
mayson124 Feb 3, 2024
69dd4da
Update Playwright configuration and dependencies. Added drawer compon…
chobo91 Feb 5, 2024
33baeb6
Updated playwright test to retry test 2 times because some tests fail…
chobo91 Feb 5, 2024
ba4cd1f
Update playwright/test to fix some tests running into error.
chobo91 Feb 5, 2024
beb66aa
Commented out the alert button in +page.svelte
chobo91 Feb 5, 2024
35ede1b
Added ctrl button to tab through nodes feature and added styling to c…
mayson124 Feb 5, 2024
54de8ab
some styling did not get commited
mayson124 Feb 5, 2024
6617ba0
Added close button on custom theme input
mayson124 Feb 6, 2024
a61998f
Add keyboard navigation to DrawerController component
chobo91 Feb 6, 2024
bef18ee
Update Playwright configuration and add tests for DrawerController co…
chobo91 Feb 6, 2024
4247018
After fixing pre-commit errors.Fixed error with some dependencies not…
chobo91 Feb 6, 2024
23902f8
Merge branch 'dev' into solomon-feature-branch
chobo91 Feb 6, 2024
88a31df
Merge pull request #5 from oslabs-beta/solomon-feature-branch
mayson124 Feb 6, 2024
f52f69e
final commit before PR
mayson124 Feb 6, 2024
6163407
commit after Solomon PR
mayson124 Feb 6, 2024
352f24a
recommit
mayson124 Feb 6, 2024
950a7b7
2/6/24 Save Button and Traverse Function
isaacb0 Feb 6, 2024
222b680
Merge branch 'dev' into isaac-feature-branch
chobo91 Feb 6, 2024
30a8faa
Merge pull request #6 from oslabs-beta/isaac-feature-branch
chobo91 Feb 6, 2024
4929a57
bug fix
mayson124 Feb 6, 2024
fad83f6
Co-authored-by: Solomon Moon <[email protected]>
mayson124 Feb 6, 2024
377e364
minor styling changes to ContrastTheme
mayson124 Feb 6, 2024
5174466
final commit before PR
mayson124 Feb 6, 2024
dc6dd0b
Merge pull request #7 from oslabs-beta/mayson/highContrastTheme
Julianb12 Feb 6, 2024
a91ea2f
README update.
chobo91 Feb 7, 2024
e65b627
Added Contrast Theme component to
mayson124 Feb 7, 2024
4f08965
Merge pull request #8 from oslabs-beta/mayson/addContrastThemeDocs
chobo91 Feb 7, 2024
4800cd2
Final adjustments on README and added roadmap ideasCo-authored-by: Ju…
chobo91 Feb 7, 2024
8d97ed1
Final adjustments on README and added roadmap ideasCo-authored-by: Ju…
chobo91 Feb 7, 2024
9c1d226
Merge branch 'dev' into solomon/readme
chobo91 Feb 7, 2024
cc2afb4
Update roadmap.mdx
chobo91 Feb 7, 2024
6f5929e
Merge pull request #9 from oslabs-beta/solomon/readme
isaacb0 Feb 7, 2024
1709dfa
Merge pull request #10 from oslabs-beta/dev
chobo91 Feb 7, 2024
3853e92
Last minute final changes to README, changelog, roadmap and themetogg…
chobo91 Feb 7, 2024
26f8958
Last minute final changes to README, changelog, roadmap, reloadStore …
chobo91 Feb 7, 2024
92ebf1a
Merge pull request #502 from oslabs-beta/main
chobo91 Feb 7, 2024
3e86bca
2/7/24 Remove Flatted & Flatten libraries from project
isaacb0 Feb 8, 2024
0afdcb7
import ContrastTheme Co-authored-by: Julian Bos <[email protected]
chobo91 Feb 8, 2024
320ef41
import ContrastTheme after lintingCo-authored-by: Julian Bos <julianb…
chobo91 Feb 8, 2024
7d3ef19
Merge branch 'main' of https://github.com/open-source-labs/Svelvet
chobo91 Feb 8, 2024
b075441
Merge pull request #503 from oslabs-beta/main
isaacb0 Feb 8, 2024
bbf34d7
Updated README to link to our medium article. Updated after minor fix…
chobo91 Feb 9, 2024
bd69dc3
Merge pull request #504 from oslabs-beta/main
mayson124 Feb 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ vite.config.ts.timestamp-*
.VSCodeCounter
/.vscode
.vscode
.idea
.idea
svelvet-file-tree.txt
script.txt
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
# !/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run format && npm run lint && npm run test && npm run test:unit
npm run format && npm run lint && npm run test && npm run test:unit
42 changes: 39 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

Svelvet is a lightweight Svelte component library for building interactive node-based user interfaces and diagrams.

[⚡ Website](https://www.svelvet.io/) | [📚 Documentation](https://svelvet.mintlify.app) | [⌨️ Blog](https://medium.com/@rathnaganjigunta/introducing-svelvet-8-new-features-for-a-user-friendly-svelte-component-library-c9b966c5eb75) | [💬 Twitter](https://twitter.com/SvelvetOSLabs) | [💼 LinkedIn](https://www.linkedin.com/company/svelvet/)
[⚡ Website](https://www.svelvet.io/) | [📚 Documentation](https://svelvet.mintlify.app) | [⌨️ Blog](https://medium.com/@julianb1212_35672/svelvet-10-0-new-features-for-accessibility-and-improved-performance-3caaab9e54e9) | [💬 Twitter](https://twitter.com/SvelvetOSLabs) | [💼 LinkedIn](https://www.linkedin.com/company/svelvet/)

</div>
<br>
Expand All @@ -25,6 +25,34 @@ Shout out to our contributors! Here's what's new:

### Changelog

<details>
<summary>🛸 v10.0.0 🛸</summary>

- **Features**:

- **Accessibility Enhancement**: Now users can navigate the canvas using the keyboard.
- Press `'l'` to turn on light/dark mode.
- Press `'d'` to show drawer component, and `'D'` to open/close drawer component.
- Press `Option + Tab || Ctrl + Tab` for Node selection.
- Press `'m'` to toggle the minimap component.
- Press `'c'` to toggle control component.
- Press `'e'` to bring up editor component.
- **Persistent Canvas State**: Added the ability to save the state persistently to local storage.
- **High Contrast Mode**: Introduced a new high contrast accessibility component tailored for the visually impaired.

- **Refactoring**:

- **Improved Keyboard Accessibility**: Enhanced the keyboard accessibility of the drawer component through refactoring.

- **Documentation**:

- **Updated Guidance**: Documentation now includes instructions on utilizing keyboard accessibility features.

- **Miscellaneous**:
- **Test Enhancements**: Added comprehensive testing for drawer components.
- **Maintenance**: Updated Playwright tests and configuration for improved stability.

</details>
<details><summary>🚀 v9.0.0 🚀</summary>
<ul>
<li>feat: migrated Svelvet library from Svelte 3 to Svelte 4</li>
Expand Down Expand Up @@ -266,6 +294,10 @@ npm run test:unit [filename]

## The Svelvet Team

- Mason Lee • [LinkedIn](https://www.linkedin.com/in/maysonlee/) • [Github](https://github.com/mayson124)
- Isaac Bocage • [LinkedIn](https://www.linkedin.com/in/isaac-bocage-15711715a/) • [Github](https://github.com/isaacb0)
- Julian Bos • [LinkedIn](https://www.linkedin.com/in/julian-bos-2ab287145/) • [Github](https://github.com/Julianb12)
- Solomon Moon • [LinkedIn](https://www.linkedin.com/in/solomon-moon-aaab7818a/) • [Github](https://github.com/chobo91)
- Henry Sweat • [LinkedIn](https://www.linkedin.com/in/henry-sweat/) • [Github](https://github.com/henry-sweat)
- Jeremy David • [LinkedIn](https://www.linkedin.com/in/jeremy-david-66jc/) • [Github](https://github.com/Jdave1125)
- John Costello • [LinkedIn](https://www.linkedin.com/in/johnlcostello/) • [Github](https://github.com/johnlcos)
Expand Down Expand Up @@ -309,15 +341,19 @@ npm run test:unit [filename]
## How to Contribute

Please refer to the [roadmap](https://svelvet.mintlify.app/roadmap) for the full list of ideas for iteration. <br>
Some ideas inspired by v9.0.0 include:
Some ideas inspired by v10.0.0 include:

- **Example Showcase:** we've added a new section to the documentation which will contain example sandboxes of features and potential usecases of Svelvet. If you would like to contribute to the showcase with an example of how you’re using Svelvet, reach out to the team with your project via [Github discussion](https://github.com/open-source-labs/Svelvet/discussions/categories/project-showcase).

- **Importing/Exporting canvas as JSON:** we had planned to look into this as a way to maintain state through a page refresh.

- **Additional Data Input Components:** we plan on creating additional input/parameter components that integrate with our data flow system and can be used when composing custom Nodes.

- **Extensive Test Converage:** We expect to have full E2E and unit test coverage relatively soon.
- **Extensive Test Converage:** We expect to have full E2E and unit test coverage relatively soon. Especially the newly added features in contrast themes.

- **Accessibility Linter:** We aim to ensure our components are accessible and compliant with accessibility standards. Implementation of an accessibility linter would streamline the process of identifying and rectifying accessibility issues within our components.

- **Persistent Canvas State** saveStore.ts and reloadStore.ts lay the foundation for the save feature. They work together to get the state object of the canvas by turning it into a JSON string for storage and then parsing it into a JSON object for reconstruction. But they need further development as they only save the camera position and theme. Specifically, the traverse function in saveStore.ts needs to properly detect and expand each element inside the canvas (graph) state object. A good place to start on this would be addressing the anchors and edges property of the graph's state object. Use the "nodes" property on this object for reference on how this data should be unraveled and stored. Additionally, the createGraph function is used in reloadStore.ts to render a graph onMount of the Svelvet component according to the state object that was saved last in local storage on the user's browser. This implementation is simplified, however, so it only recreates the graph from partially saved data.

GET CREATIVE!! Svelvet is an amazing project that has so much room to grow.

Expand Down
28 changes: 28 additions & 0 deletions docs/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@ sidebarTitle: 'Changelog'
description: 'New features, bug fixes, and improvements organized by release'
---

## February 7, 2024

**🛸 Svelvet `10.0.0` 🛸**

- Features:

- Accessibility Enhancement: Now users can navigate the canvas using the keyboard.
- Press `'l'` to turn on light/dark mode.
- Press `'d'` to show drawer component, and `'D'` to open/close drawer component.
- Press `Option + Tab || Ctrl + Tab` for Node selection.
- Press `'m'` to toggle the minimap component.
- Press `'c'` to toggle control component.
- Press `'e'` to bring up editor component.
- Persistent Canvas State: Added the ability to save the state persistently to local storage.
- High Contrast Mode: Introduced a new high contrast accessibility component tailored for the visually impaired.

- Refactoring:

- Improved Keyboard Accessibility: Enhanced the keyboard accessibility of the drawer component through refactoring.

- Documentation:

- Updated Guidance: Documentation now includes instructions on utilizing keyboard accessibility features.

- Miscellaneous:
- Test Enhancements: Added comprehensive testing for drawer components.
- Maintenance: Updated Playwright tests and configuration for improved stability.

## November 16, 2023

**🚀 Svelvet `9.0.0` 🚀**
Expand Down
38 changes: 38 additions & 0 deletions docs/components/contrasttheme.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: 'Contrast Theme'
sidebarTitle: 'Contrast Theme'
description: 'Optional Component that allows users with visual impairments to customize the theme'
---

## Description

To render the Theme Toggle component, simply pass the contrast prop to the Svelvet component. This will generate a select menu offering 8 preset themes tailored for individuals with diverse visual conditions, featuring common color combinations. Additionally, the component includes a custom option, empowering users to tailor the theme according to their specific requirements.

<Note>When passing the component to Svelvet, you must specify slot="contrast"</Note>

```HTML
<script lang="ts">
import { Svelvet, Node, ContrastTheme } from 'svelvet';

</script>

<body>
<Svelvet width={400} height={400}>
<Node />
<ThemeToggle slot="contrast" />
</Svelvet>
</body>
```

<ResponseField name="bgColor" type="CSS Color String" default="theme dependent">
Color of background.
</ResponseField>
<ResponseField name="textColor" type="CSS Color String" default="theme dependent">
Color of text.
</ResponseField>
<ResponseField name="nodeColor" type="CSS Color String" default="theme dependent">
Color of node.
</ResponseField>
<ResponseField name="edgeColor" type="CSS Color String" default="theme dependent">
Color of edge.
</ResponseField>
2 changes: 1 addition & 1 deletion docs/components/themetoggle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: 'Optional component offering ability to dynamically toggle between

## Description

The Theme Toggle component can be rendered by passing the `toggle` prop to the Svelvet component. By default, this will toggle between light and dark themes. For additional customization, import the component and pass the entire thing as a child of Svelvet
The Theme Toggle component can be rendered by passing the `toggle` prop to the Svelvet component. By default, this will toggle between light and dark themes. For additional customization, import the component and pass the entire thing as a child of Svelvet. As of version 10 update, a save button was added to the Theme Toggle component. This button saves the state of the canvas as a JSON string to local storage and reconstructs the graph based on this data.

<Note>When passing the component to Svelvet, you must specify slot="toggle"</Note>

Expand Down
3 changes: 2 additions & 1 deletion docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
"components/minimap",
"components/controls",
"components/background",
"components/themetoggle"
"components/themetoggle",
"components/contrasttheme"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions docs/roadmap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ What we're working on and thinking about.

### Persistent Canvas state

We will be exposing functions that can be used to capture and restore the state of the canvas including node positions, dimensions and data flow state. We may also expose a boolean that can be set on the Svelvet component to automatically save canvas state to local storage.
saveStore.ts and reloadStore.ts lay the foundation for the save feature. They work together to get the state object of the canvas byt turning it into a JSON string for storage and then parsing it into a JSON object for reconstruction. But they need further development as they only save the camera position and theme. Specifically, the traverse function in saveStore.ts needs to properly detect and expand each element inside the canvas (graph) state object. A good place to start on this would be addressing the anchors and edges property of the graph's state object. Use the "nodes" property on this object for reference on how this data should be unraveled and stored. Additionally, the createGraph function is used in reloadStore.ts to render a graph onMount of the Svelvet component according to the state object that was saved last in local storage on the user's browser. This implementation is simplified, however, so it only recreates the graph from partially saved data.

### Improving Window Resize Logic

Expand Down Expand Up @@ -51,7 +51,7 @@ Currently, when Nodes are rotated, their positioning updates in an unintuitive m

### Extensive Test Coverage

Test coverage is fairly comprehensive, covering most components. The exception to this is testing on the [Drawer](../components/drawer) component.
Test coverage is fairly comprehensive, covering most components. The exception to this is testing on the [Drawer](../components/drawer) component. We would also like the test the high contrast themes.

### Example Showcase

Expand Down
Loading