Compare commits
122 commits
Author | SHA1 | Date | |
---|---|---|---|
|
09d8cb2966 | ||
|
76eb6672b0 | ||
|
29bbe7355d | ||
|
4984938f40 | ||
|
073bfaa2c9 | ||
|
3f6c0e6fe4 | ||
|
e95bb2e117 | ||
|
119b681d4d | ||
|
dd5bd6d96a | ||
|
5d9ffa8824 | ||
|
564d9bb6a7 | ||
|
c86902b2f8 | ||
|
5af877bcaa | ||
|
b5fed52bc5 | ||
|
4d81bd5e0d | ||
|
55602e359a | ||
|
03c8334338 | ||
|
be727a6d9c | ||
|
018bf809fc | ||
|
f20587cf1f | ||
|
581ab76ca7 | ||
|
841ddd5a17 | ||
|
ead9d281d0 | ||
|
5d1bada084 | ||
|
26b3fc3ff0 | ||
|
67d7a70ec9 | ||
|
0ca5d963f3 | ||
|
179db76b5a | ||
|
c779fad4b1 | ||
|
99a8ebea95 | ||
|
7484bfeb1a | ||
|
a8097d3363 | ||
|
0d1b0454ef | ||
|
c89f9d6f1b | ||
|
b95702ad7d | ||
|
7b4703b044 | ||
|
fe39bab2f0 | ||
|
a1f5b69704 | ||
|
5297ea175f | ||
|
019c6cf90e | ||
|
f807bf69b3 | ||
|
91f6e24280 | ||
|
769e3bcab3 | ||
|
07007b0016 | ||
|
30edc92522 | ||
|
87af757874 | ||
|
6e03027b4c | ||
|
dc707869b4 | ||
|
98f9f724ce | ||
|
390c54a2bf | ||
|
b0366f26ed | ||
|
21a7fc1b54 | ||
|
a5897dc63c | ||
|
49cbd6178e | ||
|
f5e64cdd7d | ||
|
b4527b7fc0 | ||
|
18f7c0da76 | ||
|
10cab60d63 | ||
|
41d82656b3 | ||
|
8ed9837fea | ||
|
a350e43362 | ||
|
e248e0073d | ||
|
be36d6af3b | ||
|
8ca9125fba | ||
|
d16fa9e1e2 | ||
|
548c05cfda | ||
|
35addf5a77 | ||
|
67b09e1233 | ||
|
8e92e49e19 | ||
|
664bf09ba5 | ||
|
5753e14721 | ||
|
e9c76418eb | ||
|
d3fc06a239 | ||
|
288ad752ad | ||
|
04e2287f08 | ||
|
7553cda85b | ||
|
c98a2f6117 | ||
|
0d7e02afdd | ||
|
acc76294f3 | ||
|
dda12368b3 | ||
|
54d2300467 | ||
|
0581a55c92 | ||
|
662dc71ede | ||
|
311e5123e7 | ||
|
bafd831696 | ||
|
eca61c975e | ||
|
908064639a | ||
|
3e4e725347 | ||
|
519c6a045a | ||
|
38e21b1456 | ||
|
59a9d5e49c | ||
|
c3307b5433 | ||
|
6ff7316748 | ||
|
1bb72c8eca | ||
|
05158eb10c | ||
|
e6c46448c9 | ||
|
9d96eb7a00 | ||
|
2252cf42fd | ||
|
08e739440e | ||
|
edfbcce5a2 | ||
|
e00e274873 | ||
|
fc2bb247e7 | ||
|
934d8cbdd1 | ||
|
e2160e1380 | ||
|
02347759bd | ||
|
fe999900ff | ||
|
1e52798e6a | ||
|
efc55bcd9d | ||
|
69e7a2a1ee | ||
|
0783a080e8 | ||
|
cfb58fa9c7 | ||
|
dd50af1764 | ||
|
db1b8822e8 | ||
|
6726421170 | ||
|
8d08c1dc8c | ||
|
c5e75a034a | ||
|
31a7512a0b | ||
|
23b96d9aaa | ||
|
4264975a16 | ||
|
0107a83f90 | ||
|
b3acfe0331 | ||
|
20a44974d5 |
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2023 Pere Lev
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
.DS_Store
|
||||
node_modules
|
||||
/build
|
||||
|
|
|
@ -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
|
@ -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
|
@ -0,0 +1,3 @@
|
|||
SPDX-FileCopyrightText: 2023 Pere Lev
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
4
.npmrc
|
@ -1 +1,5 @@
|
|||
# SPDX-FileCopyrightText: 2023 Pere Lev
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
engine-strict=true
|
||||
|
|
6
.nycrc.json
Normal 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
|
@ -0,0 +1,4 @@
|
|||
SPDX-FileCopyrightText: 2023 Pere Lev
|
||||
SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
@ -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
|
@ -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
|
@ -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
|
@ -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;
|
14
.storybook/preview-head.html
Normal 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
|
@ -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
|
@ -0,0 +1,3 @@
|
|||
SPDX-FileCopyrightText: 2023 Pere Lev
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
235
LICENSES/AGPL-3.0-or-later.txt
Normal 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
|
@ -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.
|
88
README.md
|
@ -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
|
@ -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
4
package-lock.json.license
Normal file
|
@ -0,0 +1,4 @@
|
|||
SPDX-FileCopyrightText: 2023 Pere Lev
|
||||
SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
95
package.json
|
@ -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
|
@ -0,0 +1,4 @@
|
|||
SPDX-FileCopyrightText: 2023 Pere Lev
|
||||
SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
@ -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 = {
|
||||
|
|
|
@ -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
|
@ -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
3
src-tauri/Cargo.lock.license
Normal 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
|
@ -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
|
@ -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
After Width: | Height: | Size: 2.4 KiB |
3
src-tauri/icons/128x128.png.license
Normal file
|
@ -0,0 +1,3 @@
|
|||
SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
BIN
src-tauri/icons/128x128@2x.png
Normal file
After Width: | Height: | Size: 23 KiB |
3
src-tauri/icons/128x128@2x.png.license
Normal 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
After Width: | Height: | Size: 537 B |
3
src-tauri/icons/32x32.png.license
Normal file
|
@ -0,0 +1,3 @@
|
|||
SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
BIN
src-tauri/icons/Square107x107Logo.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
3
src-tauri/icons/Square107x107Logo.png.license
Normal file
|
@ -0,0 +1,3 @@
|
|||
SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
BIN
src-tauri/icons/Square142x142Logo.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
3
src-tauri/icons/Square142x142Logo.png.license
Normal file
|
@ -0,0 +1,3 @@
|
|||
SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
BIN
src-tauri/icons/Square150x150Logo.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
3
src-tauri/icons/Square150x150Logo.png.license
Normal file
|
@ -0,0 +1,3 @@
|
|||
SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
BIN
src-tauri/icons/Square284x284Logo.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
3
src-tauri/icons/Square284x284Logo.png.license
Normal file
|
@ -0,0 +1,3 @@
|
|||
SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
BIN
src-tauri/icons/Square30x30Logo.png
Normal file
After Width: | Height: | Size: 524 B |
3
src-tauri/icons/Square30x30Logo.png.license
Normal file
|
@ -0,0 +1,3 @@
|
|||
SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
BIN
src-tauri/icons/Square310x310Logo.png
Normal file
After Width: | Height: | Size: 11 KiB |
3
src-tauri/icons/Square310x310Logo.png.license
Normal file
|
@ -0,0 +1,3 @@
|
|||
SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
BIN
src-tauri/icons/Square44x44Logo.png
Normal file
After Width: | Height: | Size: 537 B |
3
src-tauri/icons/Square44x44Logo.png.license
Normal file
|
@ -0,0 +1,3 @@
|
|||
SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
BIN
src-tauri/icons/Square71x71Logo.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
3
src-tauri/icons/Square71x71Logo.png.license
Normal file
|
@ -0,0 +1,3 @@
|
|||
SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
BIN
src-tauri/icons/Square89x89Logo.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
3
src-tauri/icons/Square89x89Logo.png.license
Normal file
|
@ -0,0 +1,3 @@
|
|||
SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
BIN
src-tauri/icons/StoreLogo.png
Normal file
After Width: | Height: | Size: 803 B |
3
src-tauri/icons/StoreLogo.png.license
Normal 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
3
src-tauri/icons/icon.icns.license
Normal 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
After Width: | Height: | Size: 37 KiB |
3
src-tauri/icons/icon.ico.license
Normal 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
After Width: | Height: | Size: 21 KiB |
3
src-tauri/icons/icon.png.license
Normal 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
|
@ -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
|
@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
3
src-tauri/tauri.conf.json.license
Normal file
|
@ -0,0 +1,3 @@
|
|||
SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
26
src/README.md
Normal 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
|
@ -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
|
||||
|
|
19
src/app.html
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
After Width: | Height: | Size: 5 KiB |
4
src/lib/assets/anvil.png.license
Normal file
|
@ -0,0 +1,4 @@
|
|||
SPDX-FileCopyrightText: 2023 Pere Lev
|
||||
SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
35
src/lib/components/atoms/AnvilLogo.svelte
Normal 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} />
|
|
@ -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} />
|
||||
|
|
|
@ -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>'
|
||||
}
|
||||
})}
|
||||
|
|
71
src/lib/components/atoms/CommitBody.svelte
Normal 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>
|
52
src/lib/components/atoms/CommitDate.svelte
Normal 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>
|
|
@ -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}
|
||||
|
|
|
@ -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}
|
||||
|
|
54
src/lib/components/atoms/HistoryFallback.svelte
Normal 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>
|
39
src/lib/components/atoms/MainMenuActions.svelte
Normal 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>
|
85
src/lib/components/atoms/MainMenuSummary.svelte
Normal 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>
|
58
src/lib/components/atoms/OverlayAvatar.svelte
Normal 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>
|
125
src/lib/components/atoms/SettingsSidebar.svelte
Normal 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>
|
111
src/lib/components/molecules/History.svelte
Normal 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>
|
27
src/lib/components/molecules/MainMenu.svelte
Normal 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>
|
128
src/lib/components/molecules/MainMenuDetails.svelte
Normal 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>
|
31
src/lib/components/molecules/MoreFilters.svelte
Normal 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>
|
50
src/lib/components/molecules/Pagination.svelte
Normal 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>
|
98
src/lib/components/molecules/Project.svelte
Normal 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>
|
31
src/lib/components/molecules/Projects.svelte
Normal 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>
|
41
src/lib/components/molecules/Search.svelte
Normal 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>
|
43
src/lib/components/molecules/Settings.svelte
Normal 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>
|
49
src/lib/components/molecules/SettingsAccount.svelte
Normal 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>
|
90
src/lib/components/molecules/SettingsAppearance.svelte
Normal 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>
|
129
src/lib/components/molecules/SettingsKeys.svelte
Normal 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>
|
98
src/lib/components/molecules/SettingsNotifications.svelte
Normal 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>
|
135
src/lib/components/molecules/SettingsProfile.svelte
Normal 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>
|
31
src/lib/components/molecules/Starred.svelte
Normal 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>
|
76
src/lib/components/molecules/Welcome.svelte
Normal 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>
|
117
src/lib/components/organisms/FileTable.svelte
Normal 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>
|