Compare commits

...

122 commits
i18n ... main

Author SHA1 Message Date
Baempaieo
09d8cb2966
Added translation using Weblate (Italian) 2024-10-06 19:36:02 +00:00
André Jaenisch
76eb6672b0
chore: update dependencies
We have some major version updates in our dependencies that should be
treated separately. This update also contains an audit fix to close
vulnerabilities.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-09-30 19:05:56 +02:00
Dirk
29bbe7355d
Translated using Weblate (German)
Currently translated at 46.3% (63 of 136 strings)

Translation: Anvil/Anvil
Translate-URL: https://translate.codeberg.org/projects/anvil/anvil/de/
2024-09-30 03:31:16 +00:00
André Jaenisch
4984938f40
chore: update all dependencies
I spotted an experimental vitest addon and configured most parts of it.
However due to given peer dependency in that addon I cannot install it.
Therefore everything was commented for now.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-08-21 08:30:49 +02:00
André Jaenisch
073bfaa2c9
fix: adding title and improve button labels
When I was reinstalling Orca to get it back working I noticed that Anvil
is not displaying any document.title. I did some research on how to
define it and added it on two pages. This is meant to discuss how we
want to structure the title. Once we settled on something it'll become
translateable, too.

Speaking of, when navigating through the Settings modal I noticed that
the Remove button for keys lacked context. So I added the key title for
screen readers. Nothing worse than deleting the wrong key!

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-08-21 08:29:18 +02:00
André Jaenisch
3f6c0e6fe4
chore: track screenshots for use in Weblate
We want to improve the translation experience by creating screenshots
that illustrate which part of the UI is to be translated.

There's one variant showing the keys and another one with the English
translation.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-08-20 08:28:22 +02:00
André Jaenisch
e95bb2e117
feat: add notifications to settings
This is currently a mock as we have no notification mechanism in place.
Also, I need to figure out how to talk to Vervis' API first.

That being said, this step allows for translations at least.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-08-15 17:51:09 +02:00
André Jaenisch
119b681d4d
chore: update REUSE
REUSE had a breaking change that changed the way they configure the
tool:
https://github.com/fsfe/reuse-tool/releases/tag/v4.0.0

This PR adjusts our code to get compliant again.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-08-15 17:44:46 +02:00
André Jaenisch
dd5bd6d96a
Translated using Weblate (German)
Currently translated at 49.2% (62 of 126 strings)

Translation: Anvil/Anvil
Translate-URL: https://translate.codeberg.org/projects/anvil/anvil/de/
2024-08-12 14:12:20 +00:00
André Jaenisch
5d9ffa8824
fix: proper dark mode
I missed a border. Easy to fix.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-08-12 15:05:55 +02:00
André Jaenisch
564d9bb6a7
test: update tests
I don't use events anymore but update a Svelte store.
Not sure how to test it.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-08-12 13:07:45 +02:00
André Jaenisch
c86902b2f8
fix: properly assign tokens or dark mode
When I was working on this I learned about

https://www.skeleton.dev/docs/tokens#color-pairing-chart

and how the different colour values of

https://www.skeleton.dev/docs/colors

relate to each other. I went off and augmented every colour class to the
respective dark mode according to the pairing.

There is no predefined mapping for text-white resp. bg-white to replace
it with black, so I had to fallback to dark:.
Likewise with the placeholder: assignments.

Another major aha moment came after studying

https://github.com/skeletonlabs/skeleton/blob/%40skeletonlabs/skeleton%402.10.2/packages/skeleton/src/lib/utilities/LightSwitch/lightswitch.ts

and realising, that I could put away my hack and instead use Svelte
stores - or rather the wrappers Skeleton provided for convenience.
This way, the LightSwitch I use in the Overlay popup now syncs up with
the Appearance radios in the Settings! Hooray!

I had to think a little bit harder how to handle Auto option. I feel
like it's not 100% where I would like to be but Skeleton is looking at
preferred colour scheme in a binary view and does not know anything
other than light or dark.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-08-09 18:23:05 +02:00
André Jaenisch
5af877bcaa
feat: add Appearance panel to Settings modal
This features two knobs: theming and indent.
I was curious whether I could actually hand the theme switching to the
parent, so I created an event dispatcher for it.

It works! But I had to hack the Svelte component a little.
I also need to sync it two the theme switcher in the popup and go over
every component that is focused on light mode only at the moment. To
limit the work I will constraint myself to the Profile page here. If the
theme is meant to apply to other pages as well, we will need to persist
the setting. That means a database in Anvil, I guess. I'm not willing to
take that step right now. It must come at some point (e.g. when talking
to Vervis to actually inform about changes made in Anvil).

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-08-09 08:32:15 +02:00
timedin
b5fed52bc5
Translated using Weblate (German)
Currently translated at 42.0% (50 of 119 strings)

Translation: Anvil/Anvil
Translate-URL: https://translate.codeberg.org/projects/anvil/anvil/de/
2024-08-08 13:18:24 +00:00
André Jaenisch
4d81bd5e0d
chore: add funding section to README
In July 2024 the first batch of donations was wired for working on
Anvil. As a token of gratitude and for the sake of transparency, the
project README should shout out to NLnet.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-08-07 11:10:23 +02:00
André Jaenisch
55602e359a
feat: add new settings view for Keys
Currently the SSH and GPG keys are hardcoded. In a refactoring those
will be passed down as prop to the component. But I would need to query
Vervis to receive the real keys. Likewise I am not talking to Vervis
when updating (remove, add) a key.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-08-06 09:36:27 +02:00
André Jaenisch
03c8334338
feat: add Account Settings view
This is not interacting with Vervis at this point in time.
I clarified that changes should be persisted on moving away from a view.
I'm going to implement that once I have all views in place.

On top of that, persisting changes to Vervis requires me to study the
now documented Vervis API in more detail. I'm going to postpone this for
now but will revisit it in a few weeks.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-31 10:58:36 +02:00
André Jaenisch
be727a6d9c
chore: update dependencies
Turns out most Storybook Addons expect React and won't be installable in
a Svelte(Kit) project. But I could figure out how to use the play
functions. So I have an example for it.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-30 12:55:35 +02:00
André Jaenisch
018bf809fc
docs: add story for MainMenu
This allows for studying the MainMenu in isolation.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-28 12:15:12 +02:00
André Jaenisch
f20587cf1f
feat: bringing it all together
This is now showing the MainMenu on the profile page which in turn
pulls in the Settings modal.

I wasn't able to register the modal on Storybook yet, which means
that there won't be any on the Profile template or page story.

The implementation in Skeleton is causing some accessibility
warnings. However, since there next version is taking a radical
different approach I'm inclined to let it be for now. We should
document it somewhere, I guess.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-27 14:12:08 +02:00
André Jaenisch
581ab76ca7
feat: extract SettingsProfile into component
This is taking care of the view when the Settings is selected for a profile.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-26 16:40:27 +02:00
André Jaenisch
841ddd5a17
refactor: extract sidebar to component
I realised that I must not show the sidebar everywhere. So to not move
code around I extracted it into its own component. This one is not
matching the design (because of the links etc.) but is a step in the
direction.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-22 09:46:57 +02:00
André Jaenisch
ead9d281d0
feat: extract SettingsSidebar into component
This is in need of at least one refactoring. Skeleton is redesigning
the AppRail we are using here. The layout is hard to style.
This implementation interacts with a drawer, but it will likely be
dropped in the final version.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-22 09:34:27 +02:00
André Jaenisch
5d1bada084
refactor: extract MainMenuDetails into component
This way, MainMenu is only responsible for aggregating the UI.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-12 08:02:24 +02:00
André Jaenisch
26b3fc3ff0
feat: extract MainMenuActions into component
This represents the lower part of the main menu with actions I can have
on a project.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-10 12:15:47 +02:00
André Jaenisch
67d7a70ec9
chore: add floating-ui as dependency
This is a hard requirement for Popups I'm going to use to implment the
specified Overlays.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-10 12:15:40 +02:00
André Jaenisch
0ca5d963f3
feat: extract MainMenuSummary into component
This is the top part of the main menu which includes the Avatar overlay.
I'm not quite sure how to label each part.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-09 20:49:58 +02:00
André Jaenisch
179db76b5a
refactor: extract OverlayAvatar into component
I'm going to break up my MainMenu into smaller components, starting with
the OverlayAvatar. Testing it taught me how to handle stores in Vitest.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-08 20:34:06 +02:00
André Jaenisch
c779fad4b1
refactor: extract first page into a component
It is a component now which allows for inspection in Storybook.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-07 13:57:33 +02:00
André Jaenisch
99a8ebea95
fix: ensure screen is full size
I noticed that I do not cover the whole height.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-07 13:56:03 +02:00
André Jaenisch
7484bfeb1a
refactor: extract Welcome page into component
This allows for proper testing and documentation in Storybook.
I also moved the image into its own component. This required me to
adjust the vitest.config.ts slightly because it wasn't finding the image
during tests.

Since components are fully translatable, this means we have new keys
now.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-06 18:29:39 +02:00
André Jaenisch
a8097d3363
fix: don't break the layout
I was so focused on the welcome screen that I accidentally broke the
profile.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-06 17:26:26 +02:00
André Jaenisch
0d1b0454ef
refactor: extract first page into a component
It is a component now which allows for inspection in Storybook.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-06 17:25:21 +02:00
André Jaenisch
c89f9d6f1b
feat: replace skull with Anvil logo
When I refactor the homepage I can also get closer to the design
specification.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-06 17:22:59 +02:00
André Jaenisch
b95702ad7d
chore: remove dead code
This markup was commented. In case we ever need it, git will have it
stored in the repo history.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-06 17:17:46 +02:00
André Jaenisch
7b4703b044
fix: remove doubled entry
I'm also annoyed that we mix CommonJS with ESM here but one step at a
time.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-06 17:17:09 +02:00
André Jaenisch
fe39bab2f0
chore: update dependencies
Always a good idea to start with the latest versions.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-06 17:13:17 +02:00
André Jaenisch
a1f5b69704
chore: add new locales to Storybook
In order for others to inspect their translations I have added new
locales to Storybook.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:35 +02:00
André Jaenisch
5297ea175f
docs: create stories for new components
I have added atoms, molecules and icons.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:35 +02:00
André Jaenisch
019c6cf90e
docs: create stories for new components
I also introduce Person24 as fallback avatar and grant it a new icon in
Storybook as consequence.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:35 +02:00
André Jaenisch
f807bf69b3
chore: update dependencies
I cannot upgrade ESLint to latest due to TypeScript parser dependency.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:35 +02:00
André Jaenisch
91f6e24280
fix: add stories for Projects
I noticed that I missed stories for one or two projects in Storybook.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:35 +02:00
André Jaenisch
769e3bcab3
feat: add new components to Storybook
I included stories for the new components introduced by the Projects
page.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:35 +02:00
André Jaenisch
07007b0016
chore: add license banner to stories
I dropped the examples while at it.
Since Svelte-Octicons are used as-is I have to declare the license as
MIT.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:35 +02:00
André Jaenisch
30edc92522
feat: link between stories
Right now this works with Template stories but not with Page stories to
collect feedback.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:35 +02:00
André Jaenisch
87af757874
feat: load Inter as Webfont
I received confirmation that Inter is meant to be used for the whole
application. Therefore I'm loading it from a remote server.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:35 +02:00
André Jaenisch
6e03027b4c
feat: apply locale and writing direction
FINALLY! I can look into translated UIs in Storybook with Svelte!

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:35 +02:00
André Jaenisch
dc707869b4
docs: write Story for LoginForm
As it is visible here, part of the layout is deferred to the parent
component. See Login template.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:35 +02:00
André Jaenisch
98f9f724ce
chore: update storybook dependencies
There is a v8 in the beta, so I update the dependencies to check whether
I need to adjust something.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:35 +02:00
André Jaenisch
390c54a2bf
docs: create stories for Login page
This is the second form I have touched. Here, I even have a light
validation implemented on the server.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:35 +02:00
André Jaenisch
b0366f26ed
feat: create stories for Profile
I also updated the icons to reflect all in use.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:35 +02:00
André Jaenisch
21a7fc1b54
docs: create Stories for new pages and templates
I also extracted the Icons we use into a story and looked into how I
could potentially allow for changing the locale.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:35 +02:00
André Jaenisch
a5897dc63c
docs: document color palettes
Right now it is using the default Skeleton.dev palette.
I feel like we need to adjust it to our needs.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:34 +02:00
André Jaenisch
49cbd6178e
fix: reenable scrolling
Otherwise information is lost.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:34 +02:00
André Jaenisch
f5e64cdd7d
docs: add Typography
I had to work around Storybook here thanks to Tailwind.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:34 +02:00
André Jaenisch
b4527b7fc0
docs: write stories for DisplayName
I'm curious whether the layout should be part of atoms…

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:34 +02:00
André Jaenisch
18f7c0da76
docs: write story for BlockOrReport.svelte
This component does not take any arguments at the moment.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:34 +02:00
André Jaenisch
10cab60d63
docs: create story for Created.svelte
This will need a refactor at some point by computing the formatted value
as reactive variable depending on the created_at and locale.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:34 +02:00
André Jaenisch
41d82656b3
docs: add story for profile picture case
I also check for accessibility now.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:34 +02:00
André Jaenisch
8ed9837fea
docs: write Storybook for Avatar
For some reason, the JSDoc annotation is not picked up yet. Need to
investigate more.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:34 +02:00
André Jaenisch
a350e43362
chore: build storybook and deploy to Codeberg Page
We can now deploy Storybook to Codeberg Pages!

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:34 +02:00
André Jaenisch
e248e0073d
chore: setup and configure default Storybook
I had to downgrade Vite because the Storybook builder does not support
v5 yet. Therefore this will be on a separate branch and updated as we
move along with the codebase.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:34 +02:00
André Jaenisch
be36d6af3b
fix: prevent dangling list item
By moving the fallback text into its own component I was able to move
the list element into the History molecule. Its API has changed
accordingly. I have written tests to prevent regressions.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-02 11:02:38 +02:00
Dirk
8ca9125fba
Translated using Weblate (German)
Currently translated at 100.0% (49 of 49 strings)

Translation: Anvil/Anvil
Translate-URL: https://translate.codeberg.org/projects/anvil/anvil/de/
2024-06-30 14:34:07 +02:00
André Jaenisch
d16fa9e1e2
style: space between history events
I checked PenPot again and noticed that there is spacing between each
entry. I could have changed the lists to a different element but that
would be another refactoring just to use Flexbox for styling. Instead I
went with some margin.

If I want to use Flexbox I should first move the fallback from Profile
into this component and turn it into another Atom.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-24 09:01:53 +02:00
André Jaenisch
548c05cfda
refactor: extract CommitDate into component
This way the History molecule is only concerned with mapping the list of
commits to the appropriate structure and iterating over it. The markup
is deferred to separate components now.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-23 15:39:51 +02:00
André Jaenisch
35addf5a77
refactor: extract commit body to an atom
In order to reduce the complexity of a component I broke out the body
part of a commit into its own component.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-23 15:16:48 +02:00
André Jaenisch
67b09e1233
test: correctly pass the property to component
The tests showed warning on an unknown property. Turns out I was holding
it wrong.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-23 15:00:27 +02:00
André Jaenisch
8e92e49e19
refactor: use objects for properties
I was reading warnings during the execution of tests and fixed them for
ImportProject templates and pages.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-23 14:53:46 +02:00
André Jaenisch
664bf09ba5
refactor: extract History into a molecule
This allows for easier testing. The component is still complex, so it
requires more refactoring into smaller parts. But I can now safely do
that since I have specified the expected behaviour with a test.

I already discovered a bug while writing the tests: I want to group by
date irrespective of the timestamp. Therefore I need to parse the date
from the ISO timestamp of a commit.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-23 13:33:41 +02:00
André Jaenisch
5753e14721
refactor: group commits by date and project
Yes, this means nested looping. But it also allows me to separate the
commits into a shape I need. I feel like this should not happen in
Vervis as it is something I as a consument of the data need.

I could have done this inside of the template but it feels ugly.

The main drawback I have with the current approach is that Svelte is not
capable of looping over objects so I have to turn that into a list of
nested Arrays. I might have done that in the function already but it is
easier to look up keys on an Object that to sift through Arrays.

The current implementation works. The next step is to extract it into a
component, test it and then I can refactor further.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-23 12:31:02 +02:00
André Jaenisch
e9c76418eb
feat: display commits as activity
I also learned how to pluralise. I'm curious whether Weblate can handle
that. It follows ICU standard at least.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-21 15:08:29 +02:00
André Jaenisch
d3fc06a239
feat: fetch commits from Vervis
I had to hardcode the path to the commits because it is not a property
on the repository object. There are empty repositories, which I handle
as well.

Next step is displaying them in the Activities.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-21 12:24:47 +02:00
André Jaenisch
288ad752ad
chore: update dependencies
I'm going to start a new feature and want to make sure I'm running on
the latest compatible versions.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-21 09:00:14 +02:00
André Jaenisch
04e2287f08
fix: restore new keys
For some reasons, the new keys got lost during a rebase.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-19 17:01:02 +02:00
André Jaenisch
7553cda85b
feat: display Repositories on Profile
When looking at the Memorandum of Understanding I realised that I should
display repositories instead of projects. So I reused the new component
to do just that.

I could not use a list here, because I need spacing between the
elements. If I were to apply Flexbox to lists it would change their
semantics. But plain divs lack all kinds of semantics. I went with the
next best thing and picked a section as container.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-19 16:59:46 +02:00
Eryk Michalak
c98a2f6117
Translated using Weblate (Polish)
Currently translated at 100.0% (46 of 46 strings)

Translation: Anvil/Anvil
Translate-URL: https://translate.codeberg.org/projects/anvil/anvil/pl/
2024-06-19 16:56:53 +02:00
André Jaenisch
0d7e02afdd
test: write tests for Project molecule
During testing I realised that the buttons are not accessible.
While I was adding text I also ensured that it can be translated.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-15 19:08:37 +02:00
André Jaenisch
acc76294f3
refactor: break Project into its own component
I feel like Fork-Star-Watch is a pattern that we will reuse.
Therefore the new component is a molecule.

I also look up the person as collaborator which works for the small test
set I used during development but will likely break in production for
others. That's good. It will show me more information I need to design
the component better. I lack that at the moment.

Ideally I would use a database here, but before I can set up one I
better understand the data model.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-15 18:19:11 +02:00
André Jaenisch
dda12368b3
chore: drop Profile.d.ts
Since I learned that I can't use TypeScript in conjunction with
Storybook, I have no more use for this file.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-15 17:58:00 +02:00
André Jaenisch
54d2300467
feat: include collaborators in project overview
This shows the avatar fallback because I have no way to know the avatar
in Vervis at the moment.

Also no username associated, that is, I would need to look it up. Should
work for getting the idea at the moment.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-15 12:45:46 +02:00
André Jaenisch
0581a55c92
feat: extend homepage.js with collaborators fetch
These are not implemented everywhere so I have to handle errors here.
But for what we want to build right now (projects overview) they are.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-15 12:45:46 +02:00
André Jaenisch
662dc71ede
feat: turn Vervis information into markup
This comes close to the design specification already. But I lack some
information in the Vervis responses.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-15 12:45:46 +02:00
André Jaenisch
311e5123e7
feat: query Vervis for information on a person
I discovered that Vervis understands Content Negotiation.
That is, once I figure out my peopleId I can navigate to the respective
paths and resceive JSON that is equal to the prettyjson'ed HTML views I
can see in the web browser.

I don't find everything I would like to have. Therefore I'm writing the
results to a file for now and read it in the profile so I can talk to
our designer how to move on with what we have right now.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-15 12:45:46 +02:00
André Jaenisch
bafd831696
refactor: break up ap/index.js
Now it is more obvious that I only handle the homepage from the library
and have the login as an implementation detail.

Once I figure out how to talk to Vervis' API I can drop Cheerio and use
ReST instead.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-15 12:45:45 +02:00
André Jaenisch
eca61c975e
refactor: turn ap.js into a directory
The file has grown and I want to break it apart into smaller files.
Therefore I rename the file in the first step and adjust the import
paths.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-15 12:45:45 +02:00
André Jaenisch
908064639a
chore: prettier formatting
I thought I had done this in the past but apparently the commit got
lost.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-14 18:04:45 +02:00
André Jaenisch
3e4e725347
feat: add bg and pl to language switcher
This should help translators see their efforts come to fruition.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-14 18:04:16 +02:00
André Jaenisch
519c6a045a
chore: add .license fails for REUSE
These locales were created using Weblate. Therefore the PR introducing
them was unaware of REUSE. I created the files manually.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-06-14 17:54:54 +02:00
Eryk Michalak
38e21b1456
Translated using Weblate (Polish)
Currently translated at 93.4% (43 of 46 strings)

Translation: Anvil/Anvil
Translate-URL: https://translate.codeberg.org/projects/anvil/anvil/pl/
2024-06-10 01:18:23 +00:00
Eryk Michalak
59a9d5e49c
Added translation using Weblate (Polish) 2024-06-09 00:37:10 +00:00
krlsk
c3307b5433
Translated using Weblate (Bulgarian)
Currently translated at 6.5% (3 of 46 strings)

Translation: Anvil/Anvil
Translate-URL: https://translate.codeberg.org/projects/anvil/anvil/bg/
2024-05-25 17:18:24 +00:00
krlsk
6ff7316748
Added translation using Weblate (Bulgarian) 2024-05-24 17:16:48 +00:00
André Jaenisch
1bb72c8eca
docs: explain the folder structure of src & tests
These will help onboarding new contributors, I hope.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-05-13 18:02:45 +02:00
André Jaenisch
05158eb10c
docs: propose update to README
A handful of things have changed since last year, so the README should
reflect that.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-05-10 21:18:23 +02:00
Dirk
e6c46448c9
Translated using Weblate (English)
Currently translated at 100.0% (46 of 46 strings)

Translation: Anvil/Anvil
Translate-URL: https://translate.codeberg.org/projects/anvil/anvil/en/
2024-05-04 11:18:24 +00:00
Dirk
9d96eb7a00
Translated using Weblate (German)
Currently translated at 100.0% (46 of 46 strings)

Translation: Anvil/Anvil
Translate-URL: https://translate.codeberg.org/projects/anvil/anvil/de/
2024-04-26 10:18:26 +00:00
André Jaenisch
2252cf42fd
feat: prepare for deployment
When trying to deploy the application to my own domain I noticed that
the adapter is wrong. Since I'm not hosting anything in „the Cloud” I
went with a plain Node.js server. Therefore I have to use a specific
adapter and also fix the type of the server response. This in turn
uncovered a bug in the Created component which I also fixed.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-04-12 15:53:14 +02:00
André Jaenisch
08e739440e
feat: new projects page
This is the page that will be reached after a new project was added or
imported unless there have been projects before already.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-03-15 11:19:14 +01:00
André Jaenisch
edfbcce5a2
refactor: drop lang="ts" from script elements
I noticed that tooling isn't capable of handling it.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-03-15 10:49:30 +01:00
André Jaenisch
e00e274873
fix: populate possible f2 servers
I figured out how to handle Objects in Svelte each blocks and can
therefore now pass the data through.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-03-14 10:33:48 +01:00
André Jaenisch
fc2bb247e7
chore: run prettier over Tauri conf
Basically some opinionated formatting.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-03-13 18:52:23 +01:00
André Jaenisch
934d8cbdd1
chore: declare REUSE copyright
Tauri introduced a set of icons. I downloaded the Anvil avatar from
Codeberg and scaled it up and down with GIMP before I tinified it using
tinypng online.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-03-10 15:05:13 +01:00
André Jaenisch
e2160e1380
chore: prevent target folder from being added
The documentation makes this recommendation.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-03-09 10:27:56 +01:00
André Jaenisch
02347759bd
chore: document tauri commands
In order to not have to remember the command I'm adding it as a npm
run-script.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-03-09 10:27:51 +01:00
André Jaenisch
fe999900ff
build: set up tauri
I was curious whether I could make it run. It works!

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-03-09 10:21:32 +01:00
André Jaenisch
1e52798e6a
chore: introduce REUSE
This required adding annotation to the whole project.
I need to double-check whether I have the license banner of AGPL in
place everywhere.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-03-06 16:03:12 +01:00
André Jaenisch
efc55bcd9d
chore: bump version
Some meaningful progress has been made that warrants a new version.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-03-06 11:47:38 +01:00
André Jaenisch
69e7a2a1ee
feat: parse HTML responses of Vervis
I can successfully log in with credentials I'm using on Vervis.
The response is then parsed into an object that could be consumed in the
rest of Anvil.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-03-05 13:46:32 +01:00
André Jaenisch
0783a080e8
feat: allow for linking between stories
In order to link between stories in Storybook I need to add some
attribute to elements, so that the events are prevented and navigation
can be handled by Storybook.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-03-03 15:24:24 +01:00
André Jaenisch
cfb58fa9c7
feat: use Inter font for heading and body
I hope I read the PenPot design correctly here.
Right now, I hotlink as documented by the font forge. We might want to
self-host down the road.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-03-01 12:40:09 +01:00
André Jaenisch
dd50af1764
refactor: extract form into organism
I want to explore how I could potentially reuse components. Therefore I
extract the form into a component. Given its complexity it could either
be a molecule or an organism. I went with the latter here.

I have to explore how I pass around Objects and Arrays in Svelte so that
I can move server logic up in the component tree.

When I reuse components, I potentially want to define the labels and
placeholders. Therefore the hard-coded strings have to become variables.
Eventually I will define the key on the template level and use the real
values on page level and pass it down. That would break tests currently
so I'm not doing it in this refactoring.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-02-28 20:13:33 +01:00
Laxystem
db1b8822e8
Translated using Weblate (Hebrew)
Currently translated at 80.0% (28 of 35 strings)

Translation: Anvil/Anvil
Translate-URL: https://translate.codeberg.org/projects/anvil/anvil/he/
2024-02-28 17:56:33 +00:00
Laxystem
6726421170
Translated using Weblate (Hebrew)
Currently translated at 48.5% (17 of 35 strings)

Translation: Anvil/Anvil
Translate-URL: https://translate.codeberg.org/projects/anvil/anvil/he/
2024-02-27 15:34:12 +00:00
Dirk
8d08c1dc8c
Translated using Weblate (German)
Currently translated at 100.0% (35 of 35 strings)

Translation: Anvil/Anvil
Translate-URL: https://translate.codeberg.org/projects/anvil/anvil/de/
2024-02-25 14:56:32 +00:00
André Jaenisch
c5e75a034a
refactor: use a Component for the route
This way I can expose the implementation to Storybook and add tests to
it.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-02-23 13:44:34 +01:00
André Jaenisch
31a7512a0b fix: use logical properties when possible
This way the design will adapt to the writing direction. If it is not
possible, use the ltr and rtl filter to adjust the design.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-02-23 12:41:16 +00:00
Dirk
23b96d9aaa
Translated using Weblate (German)
Currently translated at 100.0% (26 of 26 strings)

Translation: Anvil/Anvil
Translate-URL: https://translate.codeberg.org/projects/anvil/anvil/de/
2024-02-23 12:37:31 +00:00
André Jaenisch
4264975a16
fix: prevent XSS
I learned that I don't have to pass in the html thingy.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-02-21 18:13:27 +01:00
André Jaenisch
0107a83f90
chore: update translation keys
I don't think this is the right approach but I couldn't figure out how
to announce new keys to Weblate yet.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-02-20 14:03:59 +01:00
André Jaenisch
b3acfe0331
feat: include a language switcher
This also sets the direction of layout. I hope to be able to spot design
implementation failures faster this way.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-02-20 13:51:48 +01:00
André Jaenisch
20a44974d5
refactor: turn Profile page into a component
This way it is easier to inspect the design implementation.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-02-20 13:29:52 +01:00
246 changed files with 22672 additions and 2263 deletions

View file

@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2023 Pere Lev
#
# SPDX-License-Identifier: AGPL-3.0-or-later
.DS_Store
node_modules
/build

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2023 Pere Lev
//
// SPDX-License-Identifier: AGPL-3.0-or-later
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
@ -5,7 +9,8 @@ module.exports = {
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:svelte/recommended'
'plugin:svelte/recommended',
'plugin:storybook/recommended'
],
plugins: ['@typescript-eslint'],
ignorePatterns: ['*.cjs'],

11
.gitignore vendored
View file

@ -1,3 +1,8 @@
# SPDX-FileCopyrightText: 2023 Pere Lev
# SPDX-FileCopyrightText: 2024 André Jaenisch
#
# SPDX-License-Identifier: AGPL-3.0-or-later
.DS_Store
node_modules
/build
@ -9,3 +14,9 @@ node_modules
coverage
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
/storybook-static
# See https://tauri.app/v1/guides/development/development-cycle#2-start-tauri-development-window
src-tauri/target
account.json
.nyc_output

3
.node-version.license Normal file
View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Pere Lev
SPDX-License-Identifier: AGPL-3.0-or-later

4
.npmrc
View file

@ -1 +1,5 @@
# SPDX-FileCopyrightText: 2023 Pere Lev
#
# SPDX-License-Identifier: AGPL-3.0-or-later
engine-strict=true

6
.nycrc.json Normal file
View file

@ -0,0 +1,6 @@
{
"all": true,
"check-coverage": true,
"extends": "@istanbuljs/nyc-config-typescript",
"reporters": ["text", "json", "lcov"]
}

4
.nycrc.json.license Normal file
View file

@ -0,0 +1,4 @@
SPDX-FileCopyrightText: 2023 Pere Lev
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,3 +1,8 @@
# SPDX-FileCopyrightText: 2023 Pere Lev
# SPDX-FileCopyrightText: 2024 André Jaenisch
#
# SPDX-License-Identifier: AGPL-3.0-or-later
.DS_Store
node_modules
/build
@ -6,8 +11,10 @@ node_modules
.env
.env.*
!.env.example
/storybook-static
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
stories/*.mdx

4
.prettierrc.license Normal file
View file

@ -0,0 +1,4 @@
SPDX-FileCopyrightText: 2023 Pere Lev
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

18
.storybook/fix.css Normal file
View file

@ -0,0 +1,18 @@
/* Fix TailwindCSS
* Copyright (C) 2024 André Jaenisch
* SPDX-FileCopyrightText: 2024 André Jaenisch
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* Importing Tailwind has direct impact on some Storybook rules.
* Undo the most negative effects here. */
html,
body {
overflow: auto;
}

59
.storybook/main.ts Normal file
View file

@ -0,0 +1,59 @@
/* Configuration of Storybook.
* Copyright (C) 2024 André Jaenisch
* SPDX-FileCopyrightText: 2024 André Jaenisch
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { dirname, join, resolve } from 'node:path';
import type { StorybookConfig } from '@storybook/sveltekit';
import { mergeConfig } from 'vite';
const config: StorybookConfig = {
stories: ['../stories/**/*.mdx', '../stories/**/*.stories.ts'],
addons: [
'@storybook/addon-a11y',
'@storybook/addon-coverage',
'@storybook/addon-essentials',
'@storybook/addon-links',
'@storybook/addon-interactions',
'@storybook/addon-toolbar',
//'@storybook/experimental-addon-vitest',
'@storybook/test'
],
core: {
disableTelemetry: true
},
framework: {
name: '@storybook/sveltekit',
options: {}
},
docs: {
autodocs: 'tag'
},
async viteFinal(config) {
const allowFiles = config.server?.fs?.allow || [];
const storyFiles = resolve('stories');
return mergeConfig(config, {
alias: {
...config.alias,
$lib: resolve('..', 'src', 'lib')
},
server: {
...config.server,
fs: {
...config.server?.fs,
allow: [...allowFiles, storyFiles]
}
}
});
}
};
export default config;

View file

@ -0,0 +1,14 @@
<!--
Loading global styles for all Stories.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<link rel="preconnect" href="https://rsms.me/" />
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />

100
.storybook/preview.ts Normal file
View file

@ -0,0 +1,100 @@
/* Registering of global Storybook decorators.
* Copyright (C) 2024 André Jaenisch
* SPDX-FileCopyrightText: 2024 André Jaenisch
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { computePosition, autoUpdate, offset, shift, flip, arrow } from '@floating-ui/dom';
import { initializeStores, storePopup } from '@skeletonlabs/skeleton';
import type { Preview } from '@storybook/svelte';
import { init, locale, register } from 'svelte-i18n';
import { mapLocaleToDir } from '../src/lib/i18n/index.ts';
// See src/routes/+layout.svelte
// Order is important!
import '../src/theme.postcss';
//import '@skeletonlabs/skeleton/styles/skeleton.css';
import '../src/app.postcss';
import './fix.css';
register('bg', () => import('../src/lib/i18n/locales/bg.json'));
register('de', () => import('../src/lib/i18n/locales/de.json'));
register('en', () => import('../src/lib/i18n/locales/en.json'));
register('he', () => import('../src/lib/i18n/locales/he.json'));
register('pl', () => import('../src/lib/i18n/locales/pl.json'));
init({ fallbackLocale: 'en', initialLocale: 'en' });
locale.set('en');
function withI18n(storyFn, context) {
const l = context.globals.locale;
locale.set(l);
document.dir = mapLocaleToDir(l);
return storyFn();
}
function withStores(storyFn) {
// Globally initialize stores for Skeleton.dev contexts
initializeStores();
return storyFn();
}
function withPopup(storyFn) {
storePopup.set({ computePosition, autoUpdate, offset, shift, flip, arrow });
return storyFn();
}
const preview: Preview = {
globalTypes: {
locale: {
description: 'Internationalization locale',
defaultValue: 'en',
toolbar: {
icon: 'globe',
items: [
{
value: 'bg',
title: 'Bulgarian'
},
{
value: 'de',
title: 'German'
},
{
value: 'en',
title: 'English'
},
{
value: 'he',
title: 'Hebrew'
},
{
value: 'pl',
title: 'Polish'
}
]
}
}
},
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i
}
}
}
};
export const decorators = [withI18n, withPopup, withStores];
export default preview;

3
.vscode/settings.json.license vendored Normal file
View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Pere Lev
SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -0,0 +1,235 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.
A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.
The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.
An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based on the Program.
To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements.
You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see <http://www.gnu.org/licenses/>.

9
LICENSES/MIT.txt Normal file
View file

@ -0,0 +1,9 @@
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -1,3 +1,9 @@
<!--
SPDX-FileCopyrightText: 2023 Pere Lev
SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Anvil
/!\ work in progress!
@ -25,7 +31,12 @@ It's meant to be deployed in 3 ways:
3. Hosted app served by federated forge servers as their default UI, supporting
both multi-page mode with pre-rendered pages and regular single-page mode
Status (May 2023): Implementation is in very early initial stages.
Status (May 2024): Implementation is in very early initial stages.
You can build Anvil with Tauri to a native app.
Since Progressive Enhancement philosophy is followed the security model of the
web browsers make it hard to have a completely client-side application. We will
look into this in a future point in time again.
Tech stack:
@ -33,10 +44,10 @@ Tech stack:
- TypeScript
- Tailwind
- Skeleton.dev
- Tauri
Soon also:
- Tauri
- ActivityPub
- ForgeFed
@ -61,16 +72,35 @@ npm run dev -- --open
Quick overview of the structure of the codebase:
This repo was started via `npm create skeleton-app@latest` with the "Welcome"
template.
More components can be added using
[`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
- `.reuse` - This folder holds configuration for [REUSE](https://reuse.software/)
- `.vscode` - This folder holds configuration for Visual Studio Code
- `LICENSES` - Used in conjunction with REUSE
- `src` - The source code of the web application (server and client)
- `src-tauri` - Glue code for Tauri to turn it into a native application
- `static` - Static assets (FavIcon)
- `tests` - Mainly Svelte component tests for the client
- `.eslintignore` and `.eslintrc.cjs` - ESLint ignore and configuration files
- `.gitignore` - Files and folders not to be subjected to version control
- `.node-version` - Minimum of supported NodeJS version
- `*.license` - Files to be used in conjunction with REUSE
- `.npmrc` - NPM configuration file
- `.prettierignore` and `.prettierrc` - Prettier ignore and configuration files
- `COPYING` - License of this project under AGPL
- `package-lock.json` and `package.json` - NPM package lockfile for dependencies
and meta information about this project
- `playwright.config.ts` - Playwright End-to-End test configuration
- `postcss.config.cjs` - PostCSS postprocessor configuration file
- `README.md` - This document
- `svelte.config.js` - Svelte configuration file
- `tailwind.config.js` - Tailwind CSS configuration file
- `tsconfig.json` - TypeScript configuration file
- `vite.config.ts` - Vite bundler configuration file
- `vitest.config.ts` - Vitest test runner configuration file
## Building
We haven't yet installed [adapters](https://kit.svelte.dev/docs/adapters) for
the target environments. Coming soon.
We have installed the [Node servers adapters](https://kit.svelte.dev/docs/adapter-node) for
the target environment. There is no cloud-native build target at this point.
To create a production version of the app:
@ -84,6 +114,46 @@ To preview the production build:
npm run preview
```
## Deployment
There is a [demo instance](https://anvil.demo.jaenis.ch/) available.
Log in with credentials from [fig](https://fig.fr33domlover.site/) to test it
with real data or use any other credentials you like (to see test data).
If you want to run an instance yourself, adapt the
[SystemD service file](https://kit.svelte.dev/docs/adapter-node#socket-activation)
to your setup. For example, running behind a reverse proxy on port 8080
on https://anvil.domain.example/ would look similiar to this:
```
[Service]
Environment=NODE_ENV=production IDLE_TIMEOUT=60 ORIGIN=https://anvil.domain.example PORT=8080
ExecStart=/usr/bin/node /opt/anvil
```
This assumes the repository was cheked out and the
[build artifacts](https://kit.svelte.dev/docs/adapter-node#deploying) reside in
`/opt/anvil`. See
[SvelteKit documentation on environment variables](https://kit.svelte.dev/docs/adapter-node#environment-variables-origin-protocolheader-hostheader-and-port-header)
to learn more.
## Storybook
Find a [component library online](https://anvil.codeberg.page/Anvil/).
This is loosely kept in sync with the main branch because there is a dependency
mismatch between Storybook dependencies and what we want to use.
## Software freedoms (a.k.a license)
GNU AGPL v3 or later. For the legal detail, see [`COPYING`](COPYING).
## Funding
This project is funded through the
[NGI Zero Entrust Fund](https://nlnet.nl/entrust), a fund established by
[NLnet](https://nlnet.nl) with financial support from the European Commission's
[Next Generation Internet](https://ngi.eu) program. Learn more at the
[NLnet project page](https://nlnet.nl/project/ForgeFed-RPC).
[<img src="https://nlnet.nl/logo/banner.png" alt="NLnet foundation logo" width="20%" />](https://nlnet.nl)
[<img src="https://nlnet.nl/image/logos/NGI0Entrust_tag.svg" alt="NGI Zero Entrust Logo" width="20%" />](https://nlnet.nl/entrust)

8
REUSE.toml Normal file
View file

@ -0,0 +1,8 @@
# SPDX-FileCopyrightText: 2024 André Jaenisch
# SPDX-License-Identifier: AGPL-3.0-or-later
version = 1
SPDX-PackageName = "Anvil"
SPDX-PackageSupplier = "Pere Lev <pere@towards.vision>"
SPDX-PackageDownloadLocation = "https://codeberg.org/Anvil/Anvil"
annotations = []

7514
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,4 @@
SPDX-FileCopyrightText: 2023 Pere Lev
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,51 +1,82 @@
{
"name": "anvil",
"version": "0.0.3",
"version": "0.0.14",
"private": true,
"scripts": {
"dev": "vite dev",
"dev:tauri": "tauri dev",
"build": "vite build",
"build:tauri": "tauri build",
"build:tauri:debug": "tauri build --debug",
"preview": "vite preview",
"test": "playwright test",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"tauri": "tauri",
"test:unit": "vitest",
"test:unit:coverage": "vitest --coverage",
"test:unit:coverage": "vitest run --coverage",
"lint": "prettier --check . && eslint .",
"format": "prettier --write ."
"format": "prettier --write .",
"storybook": "STORYBOOK_DISABLE_TELEMETRY=1 storybook dev -p 6006",
"build-storybook": "STORYBOOK_DISABLE_TELEMETRY=1 storybook build",
"deploy-storybook": "gh-pages -d storybook-static -b pages -r git@codeberg.org:Anvil/Anvil.git",
"predeploy-storybook": "npm run build-storybook"
},
"devDependencies": {
"@playwright/test": "1.41.2",
"@skeletonlabs/skeleton": "2.8.0",
"@skeletonlabs/tw-plugin": "0.3.1",
"@sveltejs/adapter-auto": "3.1.1",
"@sveltejs/kit": "2.5.0",
"@sveltejs/vite-plugin-svelte": "3.0.2",
"@tailwindcss/forms": "0.5.7",
"@tailwindcss/typography": "0.5.10",
"@testing-library/jest-dom": "6.4.2",
"@testing-library/svelte": "4.1.0",
"@types/node": "20.11.17",
"@typescript-eslint/eslint-plugin": "7.0.1",
"@typescript-eslint/parser": "7.0.1",
"@vitest/coverage-v8": "1.2.2",
"autoprefixer": "10.4.17",
"@istanbuljs/nyc-config-typescript": "1.0.2",
"@playwright/test": "1.47.1",
"@skeletonlabs/skeleton": "2.10.2",
"@skeletonlabs/tw-plugin": "0.4.0",
"@storybook/addon-a11y": "8.3.0",
"@storybook/addon-coverage": "1.0.4",
"@storybook/addon-essentials": "8.3.0",
"@storybook/addon-interactions": "8.3.0",
"@storybook/addon-links": "8.3.0",
"@storybook/blocks": "8.3.0",
"@storybook/builder-vite": "8.3.0",
"@storybook/svelte": "8.3.0",
"@storybook/sveltekit": "8.3.0",
"@storybook/test": "8.3.0",
"@sveltejs/adapter-node": "5.2.2",
"@sveltejs/kit": "2.5.27",
"@sveltejs/vite-plugin-svelte": "3.1.2",
"@tailwindcss/forms": "0.5.9",
"@tailwindcss/typography": "0.5.15",
"@tauri-apps/cli": "1.6.2",
"@testing-library/jest-dom": "6.5.0",
"@testing-library/svelte": "5.2.1",
"@types/node": "22.5.5",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"@vitest/coverage-istanbul": "2.1.1",
"autoprefixer": "10.4.20",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-svelte": "2.35.1",
"jsdom": "24.0.0",
"postcss": "8.4.35",
"prettier": "3.2.5",
"prettier-plugin-svelte": "3.2.1",
"svelte": "4.2.10",
"svelte-check": "3.6.4",
"eslint-plugin-storybook": "0.8.0",
"eslint-plugin-svelte": "2.44.0",
"gh-pages": "6.1.1",
"jsdom": "24.1.1",
"postcss": "8.4.47",
"prettier": "3.3.3",
"prettier-plugin-svelte": "3.2.6",
"react": "18.3.1",
"react-dom": "18.3.1",
"storybook": "8.3.0",
"svelte": "4.2.19",
"svelte-check": "3.8.5",
"svelte-i18n": "4.0.0",
"svelte-octicons": "18.7.1",
"tailwindcss": "3.4.1",
"tslib": "2.6.2",
"typescript": "5.3.3",
"vite": "5.1.1",
"vitest": "1.2.2"
"svelte-octicons": "18.9.0",
"tailwindcss": "3.4.11",
"tslib": "2.7.0",
"typescript": "5.6.2",
"vite": "5.4.5",
"vitest": "2.1.1"
},
"type": "module"
"type": "module",
"dependencies": {
"@floating-ui/dom": "1.6.11",
"@fontsource/spline-sans-mono": "5.1.0",
"axios": "1.7.7",
"cheerio": "1.0.0"
}
}

4
package.json.license Normal file
View file

@ -0,0 +1,4 @@
SPDX-FileCopyrightText: 2023 Pere Lev
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2023 Pere Lev
//
// SPDX-License-Identifier: AGPL-3.0-or-later
import type { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2023 Pere Lev
//
// SPDX-License-Identifier: AGPL-3.0-or-later
module.exports = {
plugins: {
tailwindcss: {},

7
src-tauri/.gitignore vendored Normal file
View file

@ -0,0 +1,7 @@
# SPDX-FileCopyrightText: 2024 André Jaenisch
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# Generated by Cargo
# will have compiled files and executables
/target/

3667
src-tauri/Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

37
src-tauri/Cargo.toml Normal file
View file

@ -0,0 +1,37 @@
# Configuration for Tauri app
# Copyright (C) 2024 André Jaenisch
# SPDX-FileCopyrightText: 2024 André Jaenisch
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
[package]
name = "app"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""
default-run = "app"
edition = "2021"
rust-version = "1.60"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[build-dependencies]
tauri-build = { version = "1.5.1", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.6.1", features = [] }
[features]
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.
# If you use cargo directly instead of tauri's cli you can use this feature flag to switch between tauri's `dev` and `build` modes.
# DO NOT REMOVE!!
custom-protocol = [ "tauri/custom-protocol" ]

15
src-tauri/build.rs Normal file
View file

@ -0,0 +1,15 @@
/* Build configuration for Tauri.
* Copyright (C) 2024 André Jaenisch
* SPDX-FileCopyrightText: 2024 André Jaenisch
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
fn main() {
tauri_build::build()
}

BIN
src-tauri/icons/128x128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

BIN
src-tauri/icons/32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

Binary file not shown.

After

Width:  |  Height:  |  Size: 803 B

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

BIN
src-tauri/icons/icon.icns Normal file

Binary file not shown.

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

BIN
src-tauri/icons/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

BIN
src-tauri/icons/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

20
src-tauri/src/main.rs Normal file
View file

@ -0,0 +1,20 @@
/* Entry point for Tauri.
* Copyright (C) 2024 André Jaenisch
* SPDX-FileCopyrightText: 2024 André Jaenisch
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
fn main() {
tauri::Builder::default()
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

66
src-tauri/tauri.conf.json Normal file
View file

@ -0,0 +1,66 @@
{
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
"build": {
"beforeBuildCommand": "npm run build",
"beforeDevCommand": "npm run dev",
"devPath": "http://localhost:5173",
"distDir": "../build"
},
"package": {
"productName": "anvil",
"version": "0.1.0"
},
"tauri": {
"allowlist": {
"all": false
},
"bundle": {
"active": true,
"category": "DeveloperTool",
"copyright": "",
"deb": {
"depends": []
},
"externalBin": [],
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
],
"identifier": "com.tauri.dev",
"longDescription": "",
"macOS": {
"entitlements": null,
"exceptionDomain": "",
"frameworks": [],
"providerShortName": null,
"signingIdentity": null
},
"resources": [],
"shortDescription": "",
"targets": "all",
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
}
},
"security": {
"csp": null
},
"updater": {
"active": false
},
"windows": [
{
"fullscreen": false,
"height": 600,
"resizable": true,
"title": "anvil",
"width": 800
}
]
}
}

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

26
src/README.md Normal file
View file

@ -0,0 +1,26 @@
<!--
SPDX-FileCopyrightText: 2023 Pere Lev
SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Source
These files here provide the server and client code of Anvil.
We try to use TypeScript for an additional level of understandability.
However, components cannot use TypeScript and have to be written in JavaScript
in order to work with the component library. Otherwise their annotation cannot
be parsed.
- `lib` - Files that can be referenced by [`$lib`](https://kit.svelte.dev/docs/modules#$lib).
We use them for Svelte components,
[internationalisation](https://www.npmjs.com/package/svelte-i18n) and
[server-only modules](https://kit.svelte.dev/docs/modules#$lib-$lib-server).
This approach allows us to also surface a component library.
- `routes` - [SvelteKit routing](https://kit.svelte.dev/docs/routing)
- `README.md` - This document.
- `app.d.ts` - [SvelteKit App type definitions](https://kit.svelte.dev/docs/types#app)
- `app.html` - [SvelteKit page template](https://kit.svelte.dev/docs/project-structure)
- `app.postcss` - Global styles.
- `hooks.server.ts` - [SvelteKit server hooks](https://kit.svelte.dev/docs/hooks#server-hooks)
- `theme.postcss` - Theming.

11
src/app.d.ts vendored
View file

@ -1,3 +1,14 @@
// Type definition for App.
// Copyright (C) 2023 Pere Lev
// SPDX-FileCopyrightText: 2023 Pere Lev
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
// and what to do when importing types

View file

@ -1,12 +1,29 @@
<!--
Base template for all pages.
Copyright (C) 2023 Pere Lev
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2023 Pere Lev
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width" />
<link rel="preconnect" href="https://rsms.me/" />
%sveltekit.head%
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
</head>
<body data-sveltekit-preload-data="hover" data-theme="skeleton">
<div style="display: contents" class="h-full overflow-hidden">%sveltekit.body%</div>
<div class="flex flex-col h-full">%sveltekit.body%</div>
</body>
</html>

View file

@ -1,3 +1,15 @@
/* Global styles for the SvelteKit app.
* Copyright (C) 2023 Pere Lev
* SPDX-FileCopyrightText: 2023 Pere Lev
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@tailwind base;
@tailwind components;
@tailwind utilities;
@ -6,5 +18,18 @@
/*place global styles here */
html,
body {
@apply h-full overflow-hidden;
@apply h-full overflow-hidden bg-white;
}
:root {
font-family: Inter, sans-serif;
font-feature-settings:
'liga' 1,
'calt' 1; /* fix for Chrome */
}
@supports (font-variation-settings: normal) {
:root {
font-family: InterVariable, sans-serif;
}
}

View file

@ -1,3 +1,15 @@
/* Hook to update the locale on server requests.
* Copyright (C) 2024 André Jaenisch
* SPDX-FileCopyrightText: 2024 André Jaenisch
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import type { Handle } from '@sveltejs/kit';
import { locale } from 'svelte-i18n';

BIN
src/lib/assets/anvil.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

View file

@ -0,0 +1,4 @@
SPDX-FileCopyrightText: 2023 Pere Lev
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -0,0 +1,35 @@
<!--
AnvilLogo atom.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { _ } from 'svelte-i18n';
// c.f. https://kit.svelte.dev/docs/images#vite-s-built-in-handling
import logo from '$lib/assets/anvil.png';
// c.f. https://svelte.dev/repl/a4c53f9b5be64674a5341054490e639b?version=3.16.4
/**
* Allow defining classList from outside.
*/
let klass = '';
export { klass as class };
/**
* Translation keys.
*/
export let i18n = {
alt: ''
};
</script>
<img src={logo} alt={$_(i18n.alt)} class={klass} />

View file

@ -1,15 +1,30 @@
<script lang="ts">
<!--
Avatar atom.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { Avatar } from '@skeletonlabs/skeleton';
/**
* URL to Avatar image.
* @type {string | undefined}
*/
export let avatar: string | undefined = '';
export let avatar = '';
/**
* Name to derive initials from if no avatar is given.
* @type {string | undefined}
*/
export let displayName: string | undefined = '';
export let displayName = '';
</script>
<Avatar src={avatar} alt={displayName} width="w-32" rounded="rounded-full" initials={displayName} />

View file

@ -1,3 +1,25 @@
<button type="button" class="underline">block</button>
or
<button type="button" class="underline">report</button>
<!--
BlockOrReport atom.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { _ } from 'svelte-i18n';
</script>
{@html $_('page.profile.activities.block_or_report', {
values: {
blockElementOpen: '<button type="button" class="underline">',
blockElementClose: '</button>',
reportElementOpen: '<button type="button" class="underline">',
reportElementClose: '</button>'
}
})}

View file

@ -0,0 +1,71 @@
<!--
CommitBody atom.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { _, date } from 'svelte-i18n';
import { Copy16, FileDirectory16 } from 'svelte-octicons';
/**
* The commit to display.
*/
export let commit = {
name: ''
};
const i18n = {
actions: {
browse: 'page.profile.history.activities.commits.actions.browse',
copy: 'page.profile.history.activities.commits.actions.copy'
},
relative_time: 'page.profile.history.activities.commits.relative_time'
};
</script>
<div class="flex w-full justify-between gap-4 border border-surface-100-800-token">
<!-- Detail text -->
<div class="flex flex-col flex-1">
<span class="text-surface-500-400-token">{commit.name}</span>
<span class="text-surface-400-500-token"
>{$_(i18n.relative_time, {
values: { relativeTime: $date(new Date(commit.committed)) }
})}</span
>
</div>
<!-- SHA -->
<div class="flex">
<button
type="button"
class="btn-icon border border-surface-100-800-token rounded bg-white dark:bg-black self-start"
>
<Copy16 fill="currentColor" />
<span class="sr-only">{$_(i18n.actions.copy)}</span>
</button>
<!-- Since I cannot successfully define font-mono here, enforce a minimum width for equally sized buttons -->
<button
type="button"
class="btn border border-surface-100-800-token rounded bg-white dark:bg-black min-w-32 self-start"
>
{commit.hash.slice(0, 8)}
</button>
</div>
<!-- Browse -->
<div>
<button
type="button"
class="btn-icon border border-surface-100-800-token rounded bg-white dark:bg-black"
>
<FileDirectory16 fill="currentColor" />
<span class="sr-only">{$_(i18n.actions.browse)}</span>
</button>
</div>
</div>

View file

@ -0,0 +1,52 @@
<!--
CommitDate atom.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { _, date } from 'svelte-i18n';
import { GitCommit24, Repo24 } from 'svelte-octicons';
/**
* The commit date as ISOString.
*/
export let commitDate = '1970-01-01';
/**
* Number of commits on this repo at this date.
*/
export let numberOfCommits = 0;
/**
* The name of the repo the commit is associated with.
*/
export let repoName = '';
const i18n = {
numberOfCommits: 'page.profile.history.activities.commits.number'
};
</script>
<div class="flex gap-6 -ms-6">
<span class="bg-white dark:bg-black">
<GitCommit24 fill="currentColor" />
</span>
<span class="flex gap-6 -ms-3">
<!-- Pluralisation: https://lokalise.com/blog/svelte-i18n/#Pluralization_with_Svelte_i18n -->
{$date(new Date(commitDate))} - {$_(i18n.numberOfCommits, {
values: { number: numberOfCommits }
})}
<span class="flex gap-2">
<Repo24 fill="currentColor" />
{repoName}
</span>
</span>
</div>

View file

@ -1,15 +1,32 @@
<script lang="ts">
/**
* Formatted datetime according to the locale.
*/
export let created_at_formatted: string | null = '';
<!--
Created atom.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
/**
* Date object for created time.
* @type {Date | null}
*/
export let created_at: Date | null = null;
export let created_at = null;
/**
* Locale to format the datetime according to.
*/
export let locale = 'en';
$: created_at_formatted = new Intl.DateTimeFormat(locale).format(created_at);
</script>
{#if created_at && created_at_formatted}
<span>created <date datetime={created_at}>{@html created_at_formatted}</date></span>
<span>created <time datetime={created_at?.toISOString()}>{@html created_at_formatted}</time></span
>
{/if}

View file

@ -1,17 +1,43 @@
<script lang="ts">
<!--
DisplayName atom.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { _ } from 'svelte-i18n';
/**
* Under which name shall the person be known?
* @type {string}
*/
export let displayName: string = '';
export let displayName = '';
/**
* Translation keys.
*/
export let i18n = {
heading: ''
};
/**
* How to correctly address this person.
* @type {string}
*/
export let pronoun: string = '';
export let pronoun = '';
</script>
<h1 class="h1 font-semibold text-4xl leading-tight">
<span class="sr-only">Profile for </span>
{@html displayName}
<span class="sr-only">{$_(i18n.heading)}</span>
{displayName}
</h1>
<p class="leading-normal my-1">({@html pronoun})</p>
{#if pronoun}
<p class="leading-normal my-1">({pronoun})</p>
{/if}

View file

@ -0,0 +1,54 @@
<!--
HistoryFallback atom.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { _, date } from 'svelte-i18n';
import { NorthStar24 } from 'svelte-octicons';
/**
* Service with which username was created on the instance.
*/
export let created_with = '';
/**
* Instance to show in fallback.
*/
export let instance = '';
/**
* Username to show in fallback.
*/
export let username = '';
</script>
<!-- Commit day -->
<span class="relative">
<span class="absolute ltr:-left-3 rtl:-right-3">
<NorthStar24 fill="currentColor" />
</span>
<span class="ms-4">
{$date(new Date('2023-04-23'))} - {$_('page.profile.history.activities.setup.summary')}
</span>
</span>
<!-- Commits -->
<span class="ms-6 mt-8">
<span class="border box-decoration-clone px-4 py-2 leading-10">
{$_('page.profile.history.activities.setup.description', {
values: {
created_with,
instance,
username
}
})}
</span>
</span>

View file

@ -0,0 +1,39 @@
<!--
Main menu actions atom.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { _ } from 'svelte-i18n';
import { EyeClosed24, RepoForked24, Star24, TriangleDown24 } from 'svelte-octicons';
</script>
<div class="flex gap-4">
<div
class="flex flex-1 align-center justify-center gap-2 bg-white dark:bg-black border-surface-200-700-token"
>
<RepoForked24 fill="currentColor" />
<span class="sr-only">{$_('page.profile.menu.actions.fork')}</span>
</div>
<div
class="flex flex-1 align-center justify-center gap-2 bg-white dark:bg-black border-surface-200-700-token"
>
<Star24 fill="currentColor" />
<span class="sr-only">{$_('page.profile.menu.actions.star')}</span>
</div>
<div
class="flex flex-1 align-center justify-center gap-2 bg-white dark:bg-black border-surface-200-700-token"
>
<EyeClosed24 fill="currentColor" />
<span class="sr-only">{$_('page.profile.menu.actions.watch')}</span>
<TriangleDown24 fill="currentColor" />
</div>
</div>

View file

@ -0,0 +1,85 @@
<!--
Main menu summary atom.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { popup } from '@skeletonlabs/skeleton';
import { _ } from 'svelte-i18n';
import { Bell24, GitPullRequest24, IssueOpened24, Person24 } from 'svelte-octicons';
import OverlayAvatar from './OverlayAvatar.svelte';
const popupClick = {
event: 'click',
target: 'overlayAvatar',
placement: 'bottom'
};
</script>
<div class="flex items-center content-stretch justify-start gap-4 ps-1">
<button
type="button"
class="btn btn-icon text-white dark:text-black bg-surface-400-500-token rounded-full"
use:popup={popupClick}
>
<Person24 fill="currentColor" />
<span class="sr-only">{$_('page.profile.menu.buttons.avatar')}</span>
</button>
<div class="flex flex-1 justify-around content-stretch bg-white dark:bg-black">
<div class="flex items-center content-stretch gap-1 bg-white dark:bg-black">
<button class="btn btn-icon rounded-full">
<IssueOpened24 fill="currentColor" />
<span>
{@html $_('page.profile.menu.buttons.issues', {
values: {
number: 3,
blockElementOpen: '<span class="sr-only">',
blockElementClose: '</span>'
}
})}
</span>
</button>
</div>
<div class="flex items-center content-stretch gap-1 bg-white dark:bg-black">
<button class="btn btn-icon rounded-full">
<GitPullRequest24 fill="currentColor" />
<span>
{@html $_('page.profile.menu.buttons.prs', {
values: {
number: 1,
blockElementOpen: '<span class="sr-only">',
blockElementClose: '</span>'
}
})}
</span>
</button>
</div>
<div class="flex items-center content-stretch gap-1 bg-white dark:bg-black">
<button class="btn btn-icon rounded-full">
<Bell24 fill="currentColor" />
<span>
{@html $_('page.profile.menu.buttons.notifications', {
values: {
number: 2,
blockElementOpen: '<span class="sr-only">',
blockElementClose: '</span>'
}
})}
</span>
</button>
</div>
</div>
</div>
<div class="card p-4 bg-transparent" data-popup="overlayAvatar">
<OverlayAvatar />
</div>

View file

@ -0,0 +1,58 @@
<!--
Overlay avatar atom.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { getModalStore, LightSwitch } from '@skeletonlabs/skeleton';
import { _ } from 'svelte-i18n';
import { Gear24, Info24, Moon24, Person24, SignOut24 } from 'svelte-octicons';
const modal = {
type: 'component',
component: 'settings'
};
const modalStore = getModalStore();
function openSettingsOnClick() {
modalStore.trigger(modal);
}
</script>
<div
class="flex flex-col bg-white dark:bg-black border-surface-300-600 border-rounded drop-shadow px-4 py-2"
>
<div class="bg-white dark:bg-black flex gap-4">
<Person24
fill="currentColor"
class="text-white dark:text-black bg-surface-400-500-token rounded-full"
/>
<span class="text-surface-500-400-token -mb-2">{$_('overlay.avatar.profile')}</span>
</div>
<div class="bg-white dark:bg-black flex gap-4">
<Gear24 fill="currentColor" />
<button type="button" class="text-surface-500-400-token -mb-2" on:click={openSettingsOnClick}
>{$_('overlay.avatar.settings')}</button
>
</div>
<div class="bg-white dark:bg-black flex gap-4">
<Moon24 fill="currentColor" />
<span class="text-surface-500-400-token -mb-2">{$_('overlay.avatar.dark_mode')}</span>
<LightSwitch />
</div>
<div class="bg-white dark:bg-black flex gap-4">
<Info24 fill="currentColor" />
<span class="text-surface-500-400-token -mb-2">{$_('overlay.avatar.about_anvil')}</span>
</div>
<div class="bg-white dark:bg-black flex gap-4">
<SignOut24 fill="currentColor" />
<span class="text-surface-500-400-token -mb-2">{$_('overlay.avatar.sign_out')}</span>
</div>
</div>

View file

@ -0,0 +1,125 @@
<!--
SettingsSidebar atom.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { AppRail, AppRailAnchor, AppRailTile } from '@skeletonlabs/skeleton';
import { createEventDispatcher } from 'svelte';
import { _, locale, locales } from 'svelte-i18n';
import { Bell24, Gear24, Key24, Paintbrush24, Person24 } from 'svelte-octicons';
let currentTile = 0;
const dispatcher = createEventDispatcher();
function onTileChanged(ev) {
dispatcher('switch-settings', ev.target.value);
}
</script>
<AppRail aspectRatio="auto" gap="gap-8" height="h-auto" width="w-[230px]" spacing="my-2">
<svelte:fragment slot="lead">
<AppRailTile
regionLabel="!text-3xl text-surface-500-400-token bg-surface-100-800-token float-start w-full text-start ps-8 pt-8 -my-2"
>{$_('settings.headline')}</AppRailTile
>
</svelte:fragment>
<AppRailTile
bind:group={currentTile}
name="profile"
value="profile"
on:change={onTileChanged}
regionLabel="float-start ps-2 py-1 font-normal text-surface-500-400-token !text-xl"
regionLead="float-start ps-8 text-surface-500-400-token"
title={$_('settings.profile.label')}
>
<svelte:fragment slot="lead">
<Person24 fill="currentColor" class="inline" />
</svelte:fragment>
<span>{$_('settings.profile.label')}</span>
</AppRailTile>
<AppRailTile
bind:group={currentTile}
name="account"
value="account"
on:change={onTileChanged}
regionLabel="float-start ps-2 py-1 font-normal text-surface-500-400-token !text-xl"
regionLead="float-start ps-8 text-surface-500-400-token"
title={$_('settings.account.label')}
>
<svelte:fragment slot="lead">
<Gear24 fill="currentColor" class="inline" />
</svelte:fragment>
<span>{$_('settings.account.label')}</span>
</AppRailTile>
<AppRailTile
bind:group={currentTile}
name="ssh_gpg_keys"
value="ssh_gpg_keys"
on:change={onTileChanged}
regionLabel="float-start ps-2 py-1 font-normal text-surface-500-400-token !text-xl"
regionLead="float-start ps-8 text-surface-500-400-token"
title={$_('settings.ssh_gpg_keys.label')}
>
<svelte:fragment slot="lead">
<Key24 fill="currentColor" class="inline" />
</svelte:fragment>
<span>{$_('settings.ssh_gpg_keys.label')}</span>
</AppRailTile>
<AppRailTile
bind:group={currentTile}
name="appearance"
value="appearance"
on:change={onTileChanged}
regionLabel="float-start ps-2 py-1 font-normal text-surface-500-400-token !text-xl"
regionLead="float-start ps-8 text-surface-500-400-token"
title={$_('settings.appearance.label')}
>
<svelte:fragment slot="lead">
<Paintbrush24 fill="currentColor" class="inline" />
</svelte:fragment>
<span>{$_('settings.appearance.label')}</span>
</AppRailTile>
<AppRailTile
bind:group={currentTile}
name="notifications"
value="notifications"
on:change={onTileChanged}
regionLabel="float-start ps-2 py-1 font-normal text-surface-500-400-token !text-xl"
regionLead="float-start ps-8 text-surface-500-400-token"
title={$_('settings.notifications.label')}
>
<svelte:fragment slot="lead">
<Bell24 fill="currentColor" class="inline" />
</svelte:fragment>
<span>{$_('settings.notifications.label')}</span>
</AppRailTile>
<svelte:fragment slot="trail">
<select bind:value={$locale} class="select">
{#each $locales as locale}
<option value={locale}>{locale}</option>
{/each}
</select>
<AppRailAnchor
href="https://matrix.to/#/#general-forgefed:matrix.batsense.net"
target="_blank"
rel="noreferrer"
>
Matrix
</AppRailAnchor>
<AppRailAnchor href="https://forgefed.org" target="_blank" rel="noreferrer">
ForgeFed
</AppRailAnchor>
<AppRailAnchor href="https://codeberg.org/anvil/anvil" target="_blank" rel="noreferrer">
Code
</AppRailAnchor>
</svelte:fragment>
</AppRail>

View file

@ -0,0 +1,111 @@
<!--
History molecule.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { _ } from 'svelte-i18n';
import CommitBody from '../atoms/CommitBody.svelte';
import CommitDate from '../atoms/CommitDate.svelte';
import HistoryFallback from '../atoms/HistoryFallback.svelte';
/**
* Array of commits to display by date and project.
*/
export let commitsMap = [];
/**
* Required context for populating the template.
*/
export let data = {
user: {
created_with: '',
instance: '',
username: ''
}
};
/**
* Array of followings to look up.
*/
export let followingsMap = [];
/* Since I group commits by date and project I need to create a structure. */
const groupCommitsByDateAndProject = function (commitsMap) {
const groupByDateAndProject = {};
commitsMap
// Some commits couldn't be fetched from Vervis
.filter((commit) => Boolean(commit.id))
.forEach((commit) => {
const { committed, context } = commit;
// Committed is formatted as ISO date. Group by date no matter the time
const date = committed.slice(0, committed.indexOf('T'));
// Ensure key exists
if (!groupByDateAndProject[date]) {
groupByDateAndProject[date] = {};
}
// Ensure Array exists
if (!groupByDateAndProject[date][context]) {
groupByDateAndProject[date][context] = [];
}
groupByDateAndProject[date][context].push(commit);
});
return groupByDateAndProject;
};
const getRepoNameById = function (repoId) {
const candidate = followingsMap.find((following) => following.id === repoId);
return candidate?.name || '';
};
</script>
<h2 class="h2 font-semibold leading-tight text-base">
{$_('page.profile.history.heading')}
</h2>
<ul>
{#if commitsMap.length > 0}
{#each Object.entries(groupCommitsByDateAndProject(commitsMap)) as commitsByDateAndProject}
{#each Object.entries(commitsByDateAndProject[1]) as commitsByProject}
<li class="mb-8">
<!-- Indent the whole block by 6 -->
<div class="flex flex-col gap-6 ps-6">
<CommitDate
commitDate={commitsByDateAndProject[0]}
numberOfCommits={commitsByProject[1].length}
repoName={getRepoNameById(commitsByProject[0])}
/>
<ul>
{#each commitsByProject[1] as commit}
<li class="ltr:border-l-2 rtl:border-r-2 ms-2">
<CommitBody {commit} />
</li>
{/each}
</ul>
</div>
</li>
{/each}
{/each}
{:else}
<li class="flex flex-col ltr:border-l-2 rtl:border-r-2 ms-2">
<HistoryFallback
created_with={data.user.created_with}
instance={data.user.instance}
username={data.user.username}
/>
</li>
{/if}
</ul>

View file

@ -0,0 +1,27 @@
<!--
Main menu molecule.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { _ } from 'svelte-i18n';
import MainMenuActions from '../atoms/MainMenuActions.svelte';
import MainMenuSummary from '../atoms/MainMenuSummary.svelte';
import MainMenuDetails from './MainMenuDetails.svelte';
</script>
<div
class="flex flex-col gap-6 h-full px-8 py-6 bg-surface-50-900-token border-surface-200-700-token"
>
<MainMenuSummary />
<MainMenuDetails />
<MainMenuActions />
</div>

View file

@ -0,0 +1,128 @@
<!--
Main menu details molecule.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { _ } from 'svelte-i18n';
import {
ChevronDown24,
Code24,
CommentDiscussion24,
FileDirectory24,
GitBranch24,
GitCommit24,
GitPullRequest24,
IssueOpened24,
ListUnordered24,
Person24,
PersonAdd24,
Repo24,
Tag24,
TriangleDown24
} from 'svelte-octicons';
</script>
<div class="flex -mx-2">
<div
class="flex flex-1 gap-2 bg-surface-50-900-token border-surface-300-600-token drop-shadow p-2"
>
<Repo24 fill="currentColor" />
<span class="text-primary-600 semibold flex-1 self-center"> Project Name </span>
<TriangleDown24 fill="currentColor" />
</div>
</div>
<div class="flex flex-col -mt-6">
<div
class="flex flex-col bg-white dark:bg-black border-surface-300-600-token rounded-border px-4"
>
<div class="flex gap-4 bg-white dark:bg-black">
<Code24 fill="currentColor" />
<span class="text-surface-500-400-token -mb-2 flex-1"
>{$_('page.profile.menu.details.repository')}</span
>
<ChevronDown24 fill="currentColor" />
</div>
<div class="flex flex-col ps-4">
<div class="flex gap-4 bg-white dark:bg-black">
<FileDirectory24 fill="currentColor" />
<span class="text-surface-500-400-token -mb-2 flex-1"
>{$_('page.profile.menu.details.files')}</span
>
</div>
<div class="flex gap-4 bg-white dark:bg-black">
<GitBranch24 fill="currentColor" />
<span class="text-surface-500-400-token -mb-2 flex-1"
>{$_('page.profile.menu.details.branches')}</span
>
</div>
<div class="flex gap-4 bg-white dark:bg-black">
<GitCommit24 fill="currentColor" />
<span class="text-surface-500-400-token -mb-2 flex-1"
>{$_('page.profile.menu.details.commits')}</span
>
</div>
<div class="flex gap-4 bg-white dark:bg-black">
<Tag24 fill="currentColor" />
<span class="text-surface-500-400-token -mb-2 flex-1"
>{$_('page.profile.menu.details.tags')}</span
>
</div>
</div>
<div class="flex gap-4 bg-white dark:bg-black">
<IssueOpened24 fill="currentColor" />
<span class="text-surface-500-400-token -mb-2 flex-1"
>{$_('page.profile.menu.details.issues')}</span
>
<span class="text-surface-500-400-token text-center bg-secondary-200 rounded-full min-w-6"
>2</span
>
</div>
<div class="flex gap-4 bg-white dark:bg-black">
<GitPullRequest24 fill="currentColor" />
<span class="text-surface-500-400-token -mb-2 flex-1"
>{$_('page.profile.menu.details.merge_requests')}</span
>
<span
class="text-surface-500-400-token text-center bg-secondary-200 rounded-full min-w-6 self-baseline"
>2</span
>
</div>
<div class="flex gap-4 bg-white dark:bg-black">
<Person24 fill="currentColor" />
<span class="text-surface-500-400-token -mb-2 flex-1"
>{$_('page.profile.menu.details.people')}</span
>
<ChevronDown24 fill="currentColor" />
</div>
<div class="flex flex-col ps-4">
<div class="flex gap-4 bg-white dark:bg-black">
<PersonAdd24 fill="currentColor" />
<span class="text-surface-500-400-token -mb-2 flex-1"
>{$_('page.profile.menu.details.roles')}</span
>
</div>
<div class="flex gap-4 bg-white dark:bg-black">
<CommentDiscussion24 fill="currentColor" />
<span class="text-surface-500-400-token -mb-2 flex-1"
>{$_('page.profile.menu.details.moderation')}</span
>
</div>
</div>
<div class="flex gap-4 bg-white dark:bg-black">
<ListUnordered24 fill="currentColor" />
<span class="text-surface-500-400-token -mb-2 flex-1"
>{$_('page.profile.menu.details.overview')}</span
>
<ChevronDown24 fill="currentColor" />
</div>
</div>
</div>

View file

@ -0,0 +1,31 @@
<!--
Form to select more filters.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { TriangleDown24 } from 'svelte-octicons';
import { _ } from 'svelte-i18n';
/**
* Translation keys.
*/
export let i18n = {
submit: ''
};
</script>
<form class="bg-surface-100-800-token h-8 flex flex-col justify-center px-4">
<button type="submit" class="flex submit text-surface-400-500-token">
{$_(i18n.submit)}
<TriangleDown24 fill="currentColor" class="ms-4 self-center" />
</button>
</form>

View file

@ -0,0 +1,50 @@
<!--
Pagination for a page.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { ChevronLeft24, ChevronRight24 } from 'svelte-octicons';
import { _ } from 'svelte-i18n';
/**
* Translation keys.
*/
export let i18n = {
next: '',
previous: ''
};
</script>
<nav class="flex gap-4 items-center justify-center">
<a href="?page=-1" class="flex gap-2 text-primary-500">
<ChevronLeft24 fill="currentColor" />
{$_(i18n.previous)}
</a>
<a href="?page=1" class="text-surface-500-400-token">1</a>
<a href="?page=2" class="text-surface-500-400-token">2</a>
<a href="?page=3" class="text-surface-500-400-token">3</a>
<a
href="?page=4"
class="bg-primary-500 text-white dark:text-black rounded h-8 w-8 flex justify-center items-center"
>
4
</a>
<a href="?page=5" class="text-surface-500-400-token">5</a>
<a href="?page=6" class="text-surface-500-400-token">6</a>
<span></span>
<a href="?page=17" class="text-surface-500-400-token">17</a>
<a href="?page=18" class="text-surface-500-400-token">18</a>
<a href="?page=+1" class="flex gap-2 text-primary-500">
{$_(i18n.next)}
<ChevronRight24 fill="currentColor" />
</a>
</nav>

View file

@ -0,0 +1,98 @@
<!--
A single project on the profile.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { _ } from 'svelte-i18n';
import {
EyeClosed16,
Person24,
Repo24,
RepoForked16,
Star16,
TriangleDown16
} from 'svelte-octicons';
/**
* Translation keys.
*/
export let i18n = {
buttons: {
fork: 'page.profile.projects.actions.fork',
star: 'page.profile.projects.actions.star',
watch: 'page.profile.projects.actions.watch'
}
};
/**
* Collaborators to this project.
*/
export let collaborators = [];
/**
* A software project.
*/
export let project = {
name: '',
summary: ''
};
</script>
<div class="flex bg-white dark:bg-black border border-surface-100-800-token p-4">
<!-- Left -->
<div class="flex flex-col flex-grow ps-10">
<!-- Name + Icon -->
<div class="flex -ms-10">
<Repo24 fill="currentColor" />
{project.name}
<!-- Members -->
<ul class="ms-2 gap-4">
{#each collaborators as member}
<li title={member.preferredUsername}>
<div class="bg-surface-500-400-token text-white dark:text-black rounded-full">
<Person24 fill="currentColor" />
</div>
</li>
{/each}
</ul>
</div>
<!-- Description -->
<!-- Compensate padding with negative margin -->
<div class="flex -ms-4">
{project.summary}
</div>
<!-- Tags -->
<div class="flex"></div>
</div>
<!-- Right -->
<div class="flex flex-col">
<!-- Star Fork Watch -->
<div class="flex gap-4">
<button type="button" class="btn-icon border rounded-none">
<span class="sr-only">{$_(i18n.buttons.fork)}</span>
<RepoForked16 fill="currentColor" />
</button>
<button type="button" class="btn-icon border rounded-none">
<span class="sr-only">{$_(i18n.buttons.star)}</span>
<Star16 fill="currentColor" />
</button>
<button type="button" class="btn-icon border rounded-none">
<span class="sr-only">{$_(i18n.buttons.watch)}</span>
<EyeClosed16 fill="currentColor" />
<TriangleDown16 fill="currentColor" />
</button>
</div>
<!-- FIXME: Mark up as translatable once I figured out the
timestamp needed here -->
<div class="self-end">Updated somewhen</div>
</div>
</div>

View file

@ -0,0 +1,31 @@
<!--
Filter for more projects.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { Filter24 } from 'svelte-octicons';
import { _ } from 'svelte-i18n';
/**
* Translation keys.
*/
export let i18n = {
submit: ''
};
</script>
<form>
<button type="submit" class="flex submit text-surface-400-500-token">
<Filter24 fill="currentColor" class="ms-4 self-center" />
{$_(i18n.submit)}
</button>
</form>

View file

@ -0,0 +1,41 @@
<!--
Form for searching a project.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { Search24 } from 'svelte-octicons';
import { _ } from 'svelte-i18n';
/**
* Translation keys.
*/
export let i18n = {
placeholder: '',
submit: ''
};
</script>
<form class="w-96">
<div class="flex input">
<Search24 fill="currentColor" class="ms-4 self-center" />
<input
id="search"
name="search"
type="search"
class="bg-surface-200-700-token border-none"
placeholder={$_(i18n.placeholder)}
/>
<button type="submit" class="submit bg-surface-400-500-token text-white dark:text-black w-40">
{$_(i18n.submit)}
</button>
</div>
</form>

View file

@ -0,0 +1,43 @@
<!--
Settings molecule.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import SettingsAccount from './SettingsAccount.svelte';
import SettingsAppearance from './SettingsAppearance.svelte';
import SettingsKeys from './SettingsKeys.svelte';
import SettingsNotifications from './SettingsNotifications.svelte';
import SettingsSidebar from '../atoms/SettingsSidebar.svelte';
import SettingsProfile from './SettingsProfile.svelte';
let activeSetting = 'profile';
function onTileChanged(ev) {
activeSetting = ev.detail;
}
</script>
<div class="flex bg-surface-50-900-token min-h-[900px]">
<SettingsSidebar on:switch-settings={onTileChanged} />
{#if activeSetting === 'profile'}
<SettingsProfile />
{:else if activeSetting === 'account'}
<SettingsAccount />
{:else if activeSetting === 'ssh_gpg_keys'}
<SettingsKeys />
{:else if activeSetting === 'appearance'}
<SettingsAppearance />
{:else if activeSetting === 'notifications'}
<SettingsNotifications />
{/if}
</div>

View file

@ -0,0 +1,49 @@
<!--
SettingsAccount molecule.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { _ } from 'svelte-i18n';
</script>
<div class="flex flex-col flex-1 gap-4 pe-8 pb-8 ps-8 pt-20 bg-surface-100-800-token">
<div class="flex text-surface-500-400-token text-xl font-semibold">
{$_('settings.account.headline')}
</div>
<div class="flex flex-col gap-6">
<div>
<span class="text-surface-500-400-token font-semibold">{$_('settings.account.f2.label')}</span
>
<input
type="text"
placeholder={$_('settings.account.f2.placeholder')}
class="input bg-white dark:bg-black placeholder:text-surface-300 dark:placeholder:text-surface-600"
/>
</div>
<div class="flex flex-col gap-1">
<span class="text-surface-500-400-token font-semibold"
>{$_('settings.account.password.label')}</span
>
<input type="password" class="input bg-white dark:bg-black" />
<a>{$_('settings.account.password.reset')}</a>
</div>
<div>
<span class="text-surface-500-400-token font-semibold"
>{$_('settings.account.verification.label')}</span
>
<input type="text" class="input bg-white dark:bg-black" />
</div>
<div class="flex justify-end">
<button class="btn variant-filled-warning">{$_('settings.account.delete')}</button>
</div>
</div>
</div>

View file

@ -0,0 +1,90 @@
<!--
SettingsAppearance molecule.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { modeCurrent, getModeOsPrefers, setModeCurrent } from '@skeletonlabs/skeleton';
import { _ } from 'svelte-i18n';
export let activeTheme = 'auto';
modeCurrent.subscribe(function (isLight) {
activeTheme = isLight ? 'light' : 'dark';
});
function onThemeSwitched({ target }) {
const { value } = target;
let theme = value === 'light';
if (value === 'auto') {
theme = getModeOsPrefers();
}
setModeCurrent(theme);
}
</script>
<div class="flex flex-col flex-1 gap-6 pe-8 pb-8 ps-8 pt-20 bg-surface-100-800-token">
<div class="text-surface-500-400-token text-xl font-semibold">
{$_('settings.appearance.headline')}
</div>
<div class="flex flex-col gap-2">
<div class="text-surface-500-400-token font-semibold py-1">
{$_('settings.appearance.theme.headline')}
</div>
<div class="flex gap-8">
<label class="label flex items-center space-x-2">
<input
type="radio"
class="me-2"
name="theme"
value="light"
checked={activeTheme === 'light'}
on:change={onThemeSwitched}
/>
{$_('settings.appearance.theme.light')}
</label>
<label class="label flex items-center space-x-2">
<input
type="radio"
class="me-2"
name="theme"
value="dark"
checked={activeTheme === 'dark'}
on:change={onThemeSwitched}
/>
{$_('settings.appearance.theme.dark')}
</label>
<label class="label flex items-center space-x-2">
<input
type="radio"
class="me-2"
name="theme"
value="auto"
checked={activeTheme === 'auto'}
on:change={onThemeSwitched}
/>
{$_('settings.appearance.theme.auto')}
</label>
</div>
</div>
<div class="flex flex-col gap-2">
<div class="text-surface-500-400-token font-semibold py-1">
{$_('settings.appearance.tab_indent.headline')}
</div>
<p class="text-sm">{$_('settings.appearance.tab_indent.intro')}</p>
<input
type="text"
class="input bg-white dark:bg-black text-center text-surface-500-400-token max-w-16"
name="tab_indent"
value="4"
/>
</div>
</div>

View file

@ -0,0 +1,129 @@
<!--
SettingsKeys molecule.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import '@fontsource/spline-sans-mono';
import { _ } from 'svelte-i18n';
import { Key24 } from 'svelte-octicons';
const gpg_keys = [
{
title: 'Work key',
fingerprint: 'CB9E C70F 2421 AF06 7D72 F980 8287 6A15 311B 1F84'
}
];
const ssh_keys = [
{
title: 'MyLaptop',
fingerprint: '25:c7:06:3f:87:49:5d:95:96:3d:a8'
},
{
title: 'Desktop',
fingerprint: '87:49:5d:95:96:3d:a8:25:c7:06:3f'
}
];
</script>
<div class="flex flex-col flex-1 gap-4 pe-8 pb-8 ps-8 pt-20 bg-surface-100-800-token">
<div class="flex text-surface-500-400-token text-xl font-semibold">
{$_('settings.ssh_gpg_keys.headline')}
</div>
<div class="flex flex-col gap-6">
<div class="flex flex-col gap-1">
<div class="flex text-surface-500-400-token font-semibold py-1">
{$_('settings.ssh_gpg_keys.ssh.headline')}
</div>
<div class="flex flex-col gap-2">
<!-- Nesting required to trigger last: class -->
{#each ssh_keys as key}
<div
class="flex border-b border-surface-200 last:border-b-0 items-center justify-between gap-4 pb-2"
>
<Key24 fill="currentColor" />
<span class="text-surface-500-400-token flex-1 shrink-0">{key.title}</span>
<code class="text-surface-500-400-token shrink-0">{key.fingerprint}</code>
<button type="button" class="btn font-semibold variant-filled-warning"
>{@html $_('settings.ssh_gpg_keys.ssh.remove', {
values: {
key: key.title,
srOnlyElementOpen: '<span class="sr-only">',
srOnlyElementClose: '</span>'
}
})}</button
>
</div>
{/each}
</div>
<input
type="text"
class="input bg-white dark:bg-black placeholder:text-surface-300 dark:placeholder:text-surface-600"
placeholder={$_('settings.ssh_gpg_keys.ssh.title.placeholder')}
/>
<textarea
placeholder={$_('settings.ssh_gpg_keys.ssh.key.placeholder')}
rows="4"
class="bg-white dark:bg-black placeholder:text-surface-300 dark:placeholder:text-surface-600"
></textarea>
<button
type="button"
class="btn font-semibold text-white dark:text-black variant-filled-success self-end"
>{$_('settings.ssh_gpg_keys.ssh.add')}</button
>
</div>
<div class="flex flex-col gap-1">
<div class="flex text-surface-500-400-token font-semibold py-1">
{$_('settings.ssh_gpg_keys.gpg.headline')}
</div>
<div class="flex flex-col gap-2">
<!-- Nesting required to trigger last: class -->
{#each gpg_keys as key}
<div
class="flex border-b border-surface-200 last:border-b-0 items-center justify-between gap-4 pb-2"
>
<Key24 fill="currentColor" />
<span class="text-surface-500-400-token flex-1 shrink-0">{key.title}</span>
<code class="text-surface-500-400-token font-medium shrink-0 w-[245px]"
>{key.fingerprint}</code
>
<button type="button" class="btn font-semibold variant-filled-warning"
>{@html $_('settings.ssh_gpg_keys.gpg.remove', {
values: {
key: key.title,
srOnlyElementOpen: '<span class="sr-only">',
srOnlyElementClose: '</span>'
}
})}</button
>
</div>
{/each}
</div>
<input
type="text"
class="input bg-white dark:bg-black placeholder:text-surface-300 dark:placeholder:text-surface-600"
placeholder={$_('settings.ssh_gpg_keys.gpg.title.placeholder')}
/>
<textarea
placeholder={$_('settings.ssh_gpg_keys.gpg.key.placeholder')}
rows="4"
class="bg-white dark:bg-black placeholder:text-surface-300 dark:placeholder:text-surface-600"
></textarea>
<button
type="button"
class="btn font-semibold text-white dark:text-black variant-filled-success self-end"
>{$_('settings.ssh_gpg_keys.gpg.add')}</button
>
</div>
</div>
</div>

View file

@ -0,0 +1,98 @@
<!--
SettingsNotifications molecule.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { SlideToggle } from '@skeletonlabs/skeleton';
import { _ } from 'svelte-i18n';
import { Eye24, EyeClosed24, Mention24 } from 'svelte-octicons';
const username = 'jane';
const instance = 'server.com';
let defaultNofication = 'mentioned';
let isNotifiedOnMention = false;
let labelYes = 'On';
let labelNo = 'Off';
</script>
<div class="flex flex-col flex-1 gap-6 pe-8 pb-8 ps-8 pt-20 bg-surface-100-800-token">
<div class="text-surface-500-400-token text-xl font-semibold">
{$_('settings.notifications.headline')}
</div>
<div class="flex flex-col gap-2">
<div class="text-surface-500-400-token font-semibold py-1">
{$_('settings.notifications.mentions.headline')}
</div>
<p class="text-sm leading-tight">
{@html $_('settings.notifications.mentions.intro', {
values: { blockElementOpen: '<strong>', blockElementClose: '</strong>', instance, username }
})}
</p>
<SlideToggle
class="flex gap-8"
name="mentions"
active="bg-primary-500"
size="sm"
bind:checked={isNotifiedOnMention}
>
{#if isNotifiedOnMention}
{$_('settings.notifications.mentions.labelYes')}
{:else}
{$_('settings.notifications.mentions.labelNo')}
{/if}
</SlideToggle>
</div>
<div class="flex flex-col gap-2">
<div class="text-surface-500-400-token font-semibold py-1">
{$_('settings.notifications.default.headline')}
</div>
<p class="text-sm text-surface-500-400-token leading-tight">
{$_('settings.notifications.default.intro')}
</p>
<div class="flex flex-col gap-2">
<label class="label flex items-center gap-2">
<input
type="radio"
class="me-2"
name="theme"
value="light"
checked={defaultNofication === 'all'}
/>
<Eye24 fill="currentColor" />
{$_('settings.notifications.default.notification.all')}
</label>
<label class="label flex items-center gap-2">
<input
type="radio"
class="me-2"
name="theme"
value="dark"
checked={defaultNofication === 'off'}
/>
<EyeClosed24 fill="currentColor" />
{$_('settings.notifications.default.notification.off')}
</label>
<label class="label flex items-center gap-2">
<input
type="radio"
class="me-2"
name="theme"
value="auto"
checked={defaultNofication === 'mentioned'}
/>
<Mention24 fill="currentColor" />
{$_('settings.notifications.default.notification.mentioned')}
</label>
</div>
</div>
</div>

View file

@ -0,0 +1,135 @@
<!--
SettingsProfile molecule.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { _ } from 'svelte-i18n';
import { Person24, Upload16, XCircleFill12 } from 'svelte-octicons';
</script>
<div class="flex flex-col flex-1 gap-4 pe-8 pb-8 ps-8 pt-20 bg-surface-100-800-token">
<div class="flex text-surface-500-400-token text-xl font-semibold">
{$_('settings.profile.headline')}
</div>
<div class="flex flex-col gap-6">
<div class="text-surface-500-400-token font-semibold">
{$_('settings.profile.avatar.headline')}
</div>
<div class="flex flex-col px-2">
<div class="flex gap-4">
<Person24
fill="currentColor"
class="h-16 w-16 text-white dark:text-surface-300 bg-surface-400-500-token rounded-full"
/>
<button
type="button"
class="btn flex gap-4 justify-between px-4 text-surface-900-50-token bg-surface-50-900-token border-surface-100-800-token"
>
<Upload16 fill="currentColor" />
<span>{$_('settings.profile.avatar.upload')}</span>
</button>
</div>
<div>
<button type="button" class="btn p-0 text-warning-700">
<XCircleFill12 fill="currentColor" />
<span>{$_('settings.profile.avatar.remove')}</span>
</button>
</div>
</div>
<div>
<div class="flex gap-8">
<div class="flex flex-col gap-2 grow">
<span class="text-surface-500-400-token font-semibold"
>{$_('settings.profile.name.label')}</span
>
<input
type="text"
placeholder={$_('settings.profile.name.placeholder')}
class="input bg-white dark:bg-black placeholder:text-surface-300 dark:placeholder:text-surface-400"
/>
</div>
<div class="flex flex-col gap-2 flex-1 shrink basis-40">
<span class="text-surface-500-400-token font-semibold"
>{$_('settings.profile.pronouns.label')}</span
>
<input type="text" class="input bg-white dark:bg-black" />
</div>
</div>
</div>
<div>
<div class="flex flex-col gap-2">
<span class="text-surface-500-400-token font-semibold"
>{$_('settings.profile.bio.label')}</span
>
<textarea
placeholder={$_('settings.profile.bio.placeholder')}
rows="4"
class="placeholder:text-surface-300 dark:placeholder:text-surface-400 bg-white dark:bg-black"
></textarea>
</div>
</div>
<div class="flex flex-col">
<div class="text-surface-500-400-token font-semibold">
{$_('settings.profile.extra.headline')}
</div>
<div class="text-surface-500-400-token">{$_('settings.profile.extra.hint')}</div>
<div class="flex gap-2 py-1">
<input
type="text"
class="input bg-white dark:bg-black shrink basis-40 placeholder:text-surface-300 dark:placeholder:text-surface-400"
placeholder={$_('settings.profile.extra.label.placeholder')}
/>
<input
type="text"
class="input bg-white dark:bg-black grow placeholder:text-surface-300 dark:placeholder:text-surface-400"
placeholder={$_('settings.profile.extra.content.placeholder')}
/>
</div>
<div class="flex gap-2 py-1">
<input
type="text"
class="input bg-white dark:bg-black shrink basis-40 placeholder:text-surface-300 dark:placeholder:text-surface-400"
placeholder={$_('settings.profile.extra.label.placeholder')}
/>
<input
type="text"
class="input bg-white dark:bg-black grow placeholder:text-surface-300 dark:placeholder:text-surface-400"
placeholder={$_('settings.profile.extra.content.placeholder')}
/>
</div>
<div class="flex gap-2 py-1">
<input
type="text"
class="input bg-white dark:bg-black shrink basis-40 placeholder:text-surface-300 dark:placeholder:text-surface-400"
placeholder={$_('settings.profile.extra.label.placeholder')}
/>
<input
type="text"
class="input bg-white dark:bg-black grow placeholder:text-surface-300 dark:placeholder:text-surface-400"
placeholder={$_('settings.profile.extra.content.placeholder')}
/>
</div>
<div class="flex gap-2 py-1">
<input
type="text"
class="input bg-white dark:bg-black shrink basis-40 placeholder:text-surface-300 dark:placeholder:text-surface-400"
placeholder={$_('settings.profile.extra.label.placeholder')}
/>
<input
type="text"
class="input bg-white dark:bg-black grow placeholder:text-surface-300 dark:placeholder:text-surface-400"
placeholder={$_('settings.profile.extra.content.placeholder')}
/>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,31 @@
<!--
Filter for more favourites.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { Filter24 } from 'svelte-octicons';
import { _ } from 'svelte-i18n';
/**
* Translation keys.
*/
export let i18n = {
submit: ''
};
</script>
<form>
<button type="submit" class="flex submit text-surface-400-500-token">
<Filter24 fill="currentColor" class="ms-4 self-center" />
{$_(i18n.submit)}
</button>
</form>

View file

@ -0,0 +1,76 @@
<!--
Welcome molecule.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import { _ } from 'svelte-i18n';
import AnvilLogo from '../atoms/AnvilLogo.svelte';
/**
* Translation keys.
*/
export let i18n = {
create: '',
headline: '',
intro: '',
login: '',
logo: {
alt: ''
},
reset: ''
};
/**
* Allow for linking stories in Storybook.
*/
export let sbCreate = '';
/**
* Allow for linking stories in Storybook.
*/
export let sbLogin = '';
/**
* Allow for linking stories in Storybook.
*/
export let sbReset = '';
</script>
<main class="flex h-full">
<div
class="max-w-[400px] mx-auto flex flex-col self-center justify-start items-center content-stretch bg-surface-50-900-token border border-rounded border-surface-200-700-token drop-shadow p-8"
>
<AnvilLogo i18n={i18n.logo} class="items-center w-[77px]" />
<h1 class="font-semibold text-4xl text-surface-500-400-token">{$_(i18n.headline)}</h1>
<p class="text-surface-500-400-token">{$_(i18n.intro)}</p>
<div class="space-y-3">
<div>
<a href="/account/create" class="btn variant-filled-primary" data-sb-kind={sbCreate}
>{$_(i18n.create)}</a
>
</div>
<div>
<a
href="/account/login"
class="btn text-primary-500 font-semibold variant-filled-ghost"
data-sb-kind={sbLogin}>{$_(i18n.login)}</a
>
</div>
</div>
<div class="text-center">
<a href="/" class="btn bg-initial text-surface-500-400-token" data-sb-kind={sbReset}
>{$_(i18n.reset)}</a
>
</div>
</div>
</main>

View file

@ -0,0 +1,117 @@
<!--
FileTable organism.
Copyright (C) 2024 André Jaenisch
SPDX-FileCopyrightText: 2024 André Jaenisch
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<script>
import {
EyeClosed16,
RepoForked16,
Repo24,
Star16,
TriangleDown16,
TriangleDown24
} from 'svelte-octicons';
import { _ } from 'svelte-i18n';
/**
* Translation keys.
*/
export let i18n = {
heading: {
lastUpdated: '',
name: ''
},
table: {
updated: ''
}
};
/**
* Available projects.
*/
export let projects = [];
</script>
<table class="w-4/5 min-w-96 px-4 mx-auto">
<thead>
<tr class="flex justify-between gap-4 bg-surface-100-800-token h-8">
<th class="flex text-surface-400-500-token mx-4">
{$_(i18n.heading.name)}
<TriangleDown24 fill="currentColor" />
</th>
<th class="text-surface-400-500-token mx-4">
{$_(i18n.heading.lastUpdated)}
</th>
</tr>
</thead>
<tbody>
{#each projects as project}
<tr class="flex justify-between gap-4 bg-white dark:bg-black border">
<td class="flex mx-4 gap-4">
<Repo24 fill="currentColor" />
<div class="flex flex-col">
<div class="flex">
<span class="text-primary-500">{project.name}</span>
{#each project.members as member}
<a href="/people/{member.slug}">
<img src={member.avatar} alt={member.name} />
</a>
{/each}
</div>
<div class="text-surface-400-500-token">
{project.description}
</div>
<div class="flex gap-2">
{#each project.tags as tag}
<a href={tag.link} class="bg-primary-100 text-primary-500 rounded-full px-2">
{tag.name}
</a>
{/each}
</div>
</div>
</td>
<td>
<div class="flex flex-col px-4 py-4">
<div class="flex justify-between gap-4">
<button
type="submit"
class="bg-white dark:bg-black text-surface-200-700-token rounded border px-4 py-2"
>
<RepoForked16 fill="currentColor" />
</button>
<button
type="submit"
class="bg-white dark:bg-black text-surface-200-700-token rounded border px-4 py-2"
>
<Star16 fill="currentColor" />
</button>
<button
type="submit"
class="bg-white dark:bg-black text-surface-200-700-token rounded border px-4 py-2 flex"
>
<EyeClosed16 fill="currentColor" />
<TriangleDown16 fill="currentColor" />
</button>
</div>
<div class="text-surface-400-500-token">
{$_(i18n.table.updated, {
values: {
relativeTime: project.lastUpdated.toISOString()
}
})}
</div>
</div>
</td>
</tr>
{/each}
</tbody>
</table>

Some files were not shown because too many files have changed in this diff Show more