Compare commits

..

10 Commits

19 changed files with 329 additions and 125 deletions

21
Dockerfile Normal file
View File

@@ -0,0 +1,21 @@
FROM node:23-slim AS base
LABEL Author="eisterman"
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
COPY . /app
WORKDIR /app
FROM base AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build
FROM base
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/build /app/build
EXPOSE 3000
ENTRYPOINT ["node", "build"]

View File

@@ -1,38 +1,8 @@
# sv # Svelte-Kit RE Charge.re
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli). ### Missing in TODO:
## Creating a project - [ ] Localizzazione
- [ ] Opzione per selezione lingue
If you're seeing this, you've probably already done this step. Congrats! - [ ] Aggiornamento paraglide
- [ ] Pagina di "attesa 30 secondi avvio carica"
```bash
# create a new project in the current directory
npx sv create
# create a new project in my-app
npx sv create my-app
```
## Developing
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
```bash
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
```
## Building
To create a production version of your app:
```bash
npm run build
```
You can preview the production build with `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.

View File

@@ -18,7 +18,7 @@
"@iconify/svelte": "^4.2.0", "@iconify/svelte": "^4.2.0",
"@melt-ui/pp": "^0.3.2", "@melt-ui/pp": "^0.3.2",
"@melt-ui/svelte": "^0.86.5", "@melt-ui/svelte": "^0.86.5",
"@sveltejs/adapter-auto": "^4.0.0", "@sveltejs/adapter-node": "^5.2.12",
"@sveltejs/enhanced-img": "^0.4.4", "@sveltejs/enhanced-img": "^0.4.4",
"@sveltejs/kit": "^2.16.0", "@sveltejs/kit": "^2.16.0",
"@sveltejs/vite-plugin-svelte": "^5.0.0", "@sveltejs/vite-plugin-svelte": "^5.0.0",

139
pnpm-lock.yaml generated
View File

@@ -36,9 +36,9 @@ importers:
'@melt-ui/svelte': '@melt-ui/svelte':
specifier: ^0.86.5 specifier: ^0.86.5
version: 0.86.5(svelte@5.25.3) version: 0.86.5(svelte@5.25.3)
'@sveltejs/adapter-auto': '@sveltejs/adapter-node':
specifier: ^4.0.0 specifier: ^5.2.12
version: 4.0.0(@sveltejs/kit@2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2))) version: 5.2.12(@sveltejs/kit@2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))
'@sveltejs/enhanced-img': '@sveltejs/enhanced-img':
specifier: ^0.4.4 specifier: ^0.4.4
version: 0.4.4(rollup@4.37.0)(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)) version: 0.4.4(rollup@4.37.0)(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2))
@@ -528,6 +528,33 @@ packages:
resolution: {integrity: sha512-ct43jurbe7lsUX5eIrj4ijO3j/6zIPp7CDnFWXDs7UPAbw1Pu1iH3oAmFdP4jcskKJBURH5M9oTtyeiUXyHX8Q==} resolution: {integrity: sha512-ct43jurbe7lsUX5eIrj4ijO3j/6zIPp7CDnFWXDs7UPAbw1Pu1iH3oAmFdP4jcskKJBURH5M9oTtyeiUXyHX8Q==}
engines: {node: '>=18.16.0'} engines: {node: '>=18.16.0'}
'@rollup/plugin-commonjs@28.0.3':
resolution: {integrity: sha512-pyltgilam1QPdn+Zd9gaCfOLcnjMEJ9gV+bTw6/r73INdvzf1ah9zLIJBm+kW7R6IUFIQ1YO+VqZtYxZNWFPEQ==}
engines: {node: '>=16.0.0 || 14 >= 14.17'}
peerDependencies:
rollup: ^2.68.0||^3.0.0||^4.0.0
peerDependenciesMeta:
rollup:
optional: true
'@rollup/plugin-json@6.1.0':
resolution: {integrity: sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==}
engines: {node: '>=14.0.0'}
peerDependencies:
rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
peerDependenciesMeta:
rollup:
optional: true
'@rollup/plugin-node-resolve@16.0.1':
resolution: {integrity: sha512-tk5YCxJWIG81umIvNkSod2qK5KyQW19qcBF/B78n1bjtOON6gzKoVeSzAE8yHCZEDmqkHKkxplExA8KzdJLJpA==}
engines: {node: '>=14.0.0'}
peerDependencies:
rollup: ^2.78.0||^3.0.0||^4.0.0
peerDependenciesMeta:
rollup:
optional: true
'@rollup/pluginutils@5.1.4': '@rollup/pluginutils@5.1.4':
resolution: {integrity: sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==} resolution: {integrity: sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==}
engines: {node: '>=14.0.0'} engines: {node: '>=14.0.0'}
@@ -664,10 +691,10 @@ packages:
peerDependencies: peerDependencies:
acorn: ^8.9.0 acorn: ^8.9.0
'@sveltejs/adapter-auto@4.0.0': '@sveltejs/adapter-node@5.2.12':
resolution: {integrity: sha512-kmuYSQdD2AwThymQF0haQhM8rE5rhutQXG4LNbnbShwhMO4qQGnKaaTy+88DuNSuoQDi58+thpq8XpHc1+oEKQ==} resolution: {integrity: sha512-0bp4Yb3jKIEcZWVcJC/L1xXp9zzJS4hDwfb4VITAkfT4OVdkspSHsx7YhqJDbb2hgLl6R9Vs7VQR+fqIVOxPUQ==}
peerDependencies: peerDependencies:
'@sveltejs/kit': ^2.0.0 '@sveltejs/kit': ^2.4.0
'@sveltejs/enhanced-img@0.4.4': '@sveltejs/enhanced-img@0.4.4':
resolution: {integrity: sha512-BlBTGfbLUgHa+zSVrsGLOd+noCKWfipoOjoxE26bAAX97v7zh5eiCAp1KEdpkluL05Tl3+nR14gQdPsATyZqoA==} resolution: {integrity: sha512-BlBTGfbLUgHa+zSVrsGLOd+noCKWfipoOjoxE26bAAX97v7zh5eiCAp1KEdpkluL05Tl3+nR14gQdPsATyZqoA==}
@@ -798,6 +825,9 @@ packages:
'@types/leaflet@1.9.17': '@types/leaflet@1.9.17':
resolution: {integrity: sha512-IJ4K6t7I3Fh5qXbQ1uwL3CFVbCi6haW9+53oLWgdKlLP7EaS21byWFJxxqOx9y8I0AP0actXSJLVMbyvxhkUTA==} resolution: {integrity: sha512-IJ4K6t7I3Fh5qXbQ1uwL3CFVbCi6haW9+53oLWgdKlLP7EaS21byWFJxxqOx9y8I0AP0actXSJLVMbyvxhkUTA==}
'@types/resolve@1.20.2':
resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==}
'@types/validator@13.12.2': '@types/validator@13.12.2':
resolution: {integrity: sha512-6SlHBzUW8Jhf3liqrGGXyTJSIFe4nqlJ5A5KaMZ2l/vbM3Wh3KSybots/wfWVzNLK4D1NZluDlSQIbIEPx6oyA==} resolution: {integrity: sha512-6SlHBzUW8Jhf3liqrGGXyTJSIFe4nqlJ5A5KaMZ2l/vbM3Wh3KSybots/wfWVzNLK4D1NZluDlSQIbIEPx6oyA==}
@@ -967,6 +997,9 @@ packages:
resolution: {integrity: sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw==} resolution: {integrity: sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw==}
engines: {node: '>= 6'} engines: {node: '>= 6'}
commondir@1.0.1:
resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==}
concat-map@0.0.1: concat-map@0.0.1:
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
@@ -1193,6 +1226,9 @@ packages:
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin] os: [darwin]
function-bind@1.1.2:
resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}
glob-parent@5.1.2: glob-parent@5.1.2:
resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
engines: {node: '>= 6'} engines: {node: '>= 6'}
@@ -1223,6 +1259,10 @@ packages:
resolution: {integrity: sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==} resolution: {integrity: sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==}
engines: {node: '>=8'} engines: {node: '>=8'}
hasown@2.0.2:
resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
engines: {node: '>= 0.4'}
human-id@4.1.1: human-id@4.1.1:
resolution: {integrity: sha512-3gKm/gCSUipeLsRYZbbdA1BD83lBoWUkZ7G9VFrhWPAU76KwYo5KR8V28bpoPm/ygy0x5/GCbpRQdY7VLYCoIg==} resolution: {integrity: sha512-3gKm/gCSUipeLsRYZbbdA1BD83lBoWUkZ7G9VFrhWPAU76KwYo5KR8V28bpoPm/ygy0x5/GCbpRQdY7VLYCoIg==}
hasBin: true hasBin: true
@@ -1252,6 +1292,10 @@ packages:
is-arrayish@0.3.2: is-arrayish@0.3.2:
resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==}
is-core-module@2.16.1:
resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==}
engines: {node: '>= 0.4'}
is-extglob@2.1.1: is-extglob@2.1.1:
resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
@@ -1260,10 +1304,16 @@ packages:
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
is-module@1.0.0:
resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==}
is-number@7.0.0: is-number@7.0.0:
resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
engines: {node: '>=0.12.0'} engines: {node: '>=0.12.0'}
is-reference@1.2.1:
resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==}
is-reference@3.0.3: is-reference@3.0.3:
resolution: {integrity: sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==} resolution: {integrity: sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==}
@@ -1477,6 +1527,9 @@ packages:
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
engines: {node: '>=8'} engines: {node: '>=8'}
path-parse@1.0.7:
resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
picocolors@1.1.1: picocolors@1.1.1:
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
@@ -1552,6 +1605,11 @@ packages:
resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
engines: {node: '>=4'} engines: {node: '>=4'}
resolve@1.22.10:
resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==}
engines: {node: '>= 0.4'}
hasBin: true
reusify@1.1.0: reusify@1.1.0:
resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==}
engines: {iojs: '>=1.0.0', node: '>=0.10.0'} engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
@@ -1626,6 +1684,10 @@ packages:
resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
engines: {node: '>=8'} engines: {node: '>=8'}
supports-preserve-symlinks-flag@1.0.0:
resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
engines: {node: '>= 0.4'}
svelte-check@4.1.5: svelte-check@4.1.5:
resolution: {integrity: sha512-Gb0T2IqBNe1tLB9EB1Qh+LOe+JB8wt2/rNBDGvkxQVvk8vNeAoG+vZgFB/3P5+zC7RWlyBlzm9dVjZFph/maIg==} resolution: {integrity: sha512-Gb0T2IqBNe1tLB9EB1Qh+LOe+JB8wt2/rNBDGvkxQVvk8vNeAoG+vZgFB/3P5+zC7RWlyBlzm9dVjZFph/maIg==}
engines: {node: '>= 18.0.0'} engines: {node: '>= 18.0.0'}
@@ -2212,6 +2274,34 @@ snapshots:
'@poppinss/macroable@1.0.4': '@poppinss/macroable@1.0.4':
optional: true optional: true
'@rollup/plugin-commonjs@28.0.3(rollup@4.37.0)':
dependencies:
'@rollup/pluginutils': 5.1.4(rollup@4.37.0)
commondir: 1.0.1
estree-walker: 2.0.2
fdir: 6.4.3(picomatch@4.0.2)
is-reference: 1.2.1
magic-string: 0.30.17
picomatch: 4.0.2
optionalDependencies:
rollup: 4.37.0
'@rollup/plugin-json@6.1.0(rollup@4.37.0)':
dependencies:
'@rollup/pluginutils': 5.1.4(rollup@4.37.0)
optionalDependencies:
rollup: 4.37.0
'@rollup/plugin-node-resolve@16.0.1(rollup@4.37.0)':
dependencies:
'@rollup/pluginutils': 5.1.4(rollup@4.37.0)
'@types/resolve': 1.20.2
deepmerge: 4.3.1
is-module: 1.0.0
resolve: 1.22.10
optionalDependencies:
rollup: 4.37.0
'@rollup/pluginutils@5.1.4(rollup@4.37.0)': '@rollup/pluginutils@5.1.4(rollup@4.37.0)':
dependencies: dependencies:
'@types/estree': 1.0.7 '@types/estree': 1.0.7
@@ -2305,10 +2395,13 @@ snapshots:
dependencies: dependencies:
acorn: 8.14.1 acorn: 8.14.1
'@sveltejs/adapter-auto@4.0.0(@sveltejs/kit@2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))': '@sveltejs/adapter-node@5.2.12(@sveltejs/kit@2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))':
dependencies: dependencies:
'@rollup/plugin-commonjs': 28.0.3(rollup@4.37.0)
'@rollup/plugin-json': 6.1.0(rollup@4.37.0)
'@rollup/plugin-node-resolve': 16.0.1(rollup@4.37.0)
'@sveltejs/kit': 2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)) '@sveltejs/kit': 2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2))
import-meta-resolve: 4.1.0 rollup: 4.37.0
'@sveltejs/enhanced-img@0.4.4(rollup@4.37.0)(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2))': '@sveltejs/enhanced-img@0.4.4(rollup@4.37.0)(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2))':
dependencies: dependencies:
@@ -2440,6 +2533,8 @@ snapshots:
dependencies: dependencies:
'@types/geojson': 7946.0.16 '@types/geojson': 7946.0.16
'@types/resolve@1.20.2': {}
'@types/validator@13.12.2': '@types/validator@13.12.2':
optional: true optional: true
@@ -2646,6 +2741,8 @@ snapshots:
has-own-prop: 2.0.0 has-own-prop: 2.0.0
repeat-string: 1.6.1 repeat-string: 1.6.1
commondir@1.0.1: {}
concat-map@0.0.1: {} concat-map@0.0.1: {}
consola@3.4.0: {} consola@3.4.0: {}
@@ -2900,6 +2997,8 @@ snapshots:
fsevents@2.3.3: fsevents@2.3.3:
optional: true optional: true
function-bind@1.1.2: {}
glob-parent@5.1.2: glob-parent@5.1.2:
dependencies: dependencies:
is-glob: 4.0.3 is-glob: 4.0.3
@@ -2920,6 +3019,10 @@ snapshots:
has-own-prop@2.0.0: {} has-own-prop@2.0.0: {}
hasown@2.0.2:
dependencies:
function-bind: 1.1.2
human-id@4.1.1: {} human-id@4.1.1: {}
ignore@5.3.2: {} ignore@5.3.2: {}
@@ -2939,14 +3042,24 @@ snapshots:
is-arrayish@0.3.2: {} is-arrayish@0.3.2: {}
is-core-module@2.16.1:
dependencies:
hasown: 2.0.2
is-extglob@2.1.1: {} is-extglob@2.1.1: {}
is-glob@4.0.3: is-glob@4.0.3:
dependencies: dependencies:
is-extglob: 2.1.1 is-extglob: 2.1.1
is-module@1.0.0: {}
is-number@7.0.0: {} is-number@7.0.0: {}
is-reference@1.2.1:
dependencies:
'@types/estree': 1.0.7
is-reference@3.0.3: is-reference@3.0.3:
dependencies: dependencies:
'@types/estree': 1.0.7 '@types/estree': 1.0.7
@@ -3120,6 +3233,8 @@ snapshots:
path-key@3.1.1: {} path-key@3.1.1: {}
path-parse@1.0.7: {}
picocolors@1.1.1: {} picocolors@1.1.1: {}
picomatch@2.3.1: {} picomatch@2.3.1: {}
@@ -3173,6 +3288,12 @@ snapshots:
resolve-from@4.0.0: {} resolve-from@4.0.0: {}
resolve@1.22.10:
dependencies:
is-core-module: 2.16.1
path-parse: 1.0.7
supports-preserve-symlinks-flag: 1.0.0
reusify@1.1.0: {} reusify@1.1.0: {}
rollup@4.37.0: rollup@4.37.0:
@@ -3284,6 +3405,8 @@ snapshots:
dependencies: dependencies:
has-flag: 4.0.0 has-flag: 4.0.0
supports-preserve-symlinks-flag@1.0.0: {}
svelte-check@4.1.5(picomatch@4.0.2)(svelte@5.25.3)(typescript@5.8.2): svelte-check@4.1.5(picomatch@4.0.2)(svelte@5.25.3)(typescript@5.8.2):
dependencies: dependencies:
'@jridgewell/trace-mapping': 0.3.25 '@jridgewell/trace-mapping': 0.3.25

View File

@@ -15,8 +15,8 @@
</script> </script>
{#if show} {#if show}
<div class="fixed inset-0 h-screen w-screen z-20 pointer-events-auto flex flex-col justify-end items-center"> <div class="visible fixed inset-0 h-screen w-screen z-20 pointer-events-auto flex flex-col justify-end items-center">
<button type="button" class="bg-base-100/50 w-full grow z-20" <button type="button" class="bg-base-100/50 absolute inset-0 h-full w-full"
transition:fade={{duration:200}} transition:fade={{duration:200}}
onclick={closeOverlay} onclick={closeOverlay}
aria-label="Close Overlay" aria-label="Close Overlay"

View File

@@ -0,0 +1,60 @@
<script lang="ts">
import {
melt,
type Toast,
type ToastsElements,
} from '@melt-ui/svelte';
import type { ToastData } from "$lib/ToastSystem/types";
import { onMount } from "svelte";
interface Props {
elements: ToastsElements,
toast: Toast<ToastData>,
}
const { elements, toast }: Props = $props();
const { content, title, description, close } = $derived(elements);
const { data, id, getPercentage } = $derived(toast);
const alertClass = $derived.by(() => {
switch (data.type) {
case "success":
return 'alert-success';
case "warning":
return 'alert-warning';
case "error":
return 'alert-error';
case "info":
return 'alert-info';
default:
return '';
}
});
let percentage = $state(0);
onMount(() => {
let frame: number;
const updatePercentage = () => {
percentage = getPercentage();
frame = requestAnimationFrame(updatePercentage);
};
frame = requestAnimationFrame(updatePercentage);
return () => cancelAnimationFrame(frame);
});
</script>
<div use:melt={$content(id)} class="relative w-[70%] visible">
<div class="absolute w-full flex flex-col px-2">
<progress class="progress h-1 w-full" value={percentage} max="100"></progress>
</div>
<div class={["alert", alertClass]}>
<button use:melt={$close(id)} aria-label="close notification" class="absolute right-2 top-0">x</button>
<h3 use:melt={$title(id)} class="font-bold">
{data.title}
</h3>
<div use:melt={$description(id)}>
{data.description}
</div>
</div>
</div>

View File

@@ -0,0 +1,23 @@
<script lang="ts" module>
import { createToaster } from '@melt-ui/svelte';
import type { ToastData } from "$lib/ToastSystem/types";
const {
elements,
helpers,
states: { toasts },
actions: { portal }
} = createToaster<ToastData>();
export const addToast = helpers.addToast;
</script>
<script>
import Toast from "$lib/ToastSystem/Toast.svelte";
</script>
<div use:portal
class="fixed w-screen h-screen top-0 z-50 pb-4 flex flex-col-reverse justify-start items-center gap-2 invisible">
{#each $toasts as toast (toast.id)}
<Toast {elements} {toast}/>
{/each}
</div>

View File

@@ -0,0 +1,5 @@
export type ToastData = {
title: string
description: string
type: 'info' | 'success' | 'warning' | 'error',
}

View File

@@ -1,38 +0,0 @@
<script lang="ts" module>
import { createToaster, melt } from '@melt-ui/svelte';
export type ToastData = {
title: string
description: string
color: string
}
// TODO: Change color with type e setta classe
// TODO: Usa getPercentage per mostrare la loading bar sugli alert!
const {
elements: { content, title, description, close },
helpers,
states: { toasts },
actions: { portal }
} = createToaster<ToastData>();
export const addToast = helpers.addToast;
</script>
<div use:portal class="fixed w-screen top-0 z-50 m-4 flex flex-col items-center gap-2 pointer-events-none">
{#each $toasts as { id, data } (id)}
<div use:melt={$content(id)} class="pointer-events-auto alert alert-info relative w-[70%]">
<div>
<h3 use:melt={$title(id)} class="font-bold">
{data.title}
<!-- <span style:color={data.color}></span>-->
</h3>
<div use:melt={$description(id)}>
{data.description}
</div>
</div>
<button use:melt={$close(id)} aria-label="close notification" class="absolute right-2 top-0">x</button>
</div>
{/each}
</div>

View File

@@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import '../app.css'; import '../app.css';
import Toaster from "$lib/Toaster.svelte"; import Toaster from "$lib/ToastSystem/Toaster.svelte";
let { children } = $props(); let { children } = $props();
</script> </script>

View File

@@ -85,8 +85,8 @@
</Map> </Map>
{/await} {/await}
</div> </div>
<div class="z-20 mt-16 grow pointer-events-none"> <div class="z-20 mt-16 grow invisible">
<div class="flex justify-center items-center h-full pointer-events-none"> <div class="flex justify-center items-center h-full">
{@render children()} {@render children()}
</div> </div>
</div> </div>

View File

@@ -1,8 +1,8 @@
<script lang="ts"> <script lang="ts">
import { scale } from 'svelte/transition'; import { scale } from 'svelte/transition';
import { goto } from "$app/navigation"; import { goto, invalidate } from "$app/navigation";
import BSlideOverlay from "$lib/BSlideOverlay.svelte"; import BSlideOverlay from "$lib/BSlideOverlay.svelte";
import { addToast } from '$lib/Toaster.svelte'; import { addToast } from '$lib/ToastSystem/Toaster.svelte';
let { data } = $props(); let { data } = $props();
@@ -13,37 +13,43 @@
if (startingCharge) return; if (startingCharge) return;
startingCharge = true; startingCharge = true;
try { try {
// TODO: StartCharge fetch request const response = await fetch(`/api/public/1/chargecontroller/${data.qrcode}/start_charge/`, {
// const response = await fetch(`/api/public/1/chargecontroller/${data.qrcode}/start_charge/`, { method: 'POST',
// method: 'POST', headers: {
// headers: { 'Accept': 'application/json',
// 'Accept': 'application/json', }
// } });
// }); if (response.ok) {
console.log("nop"); addToast({
await goto(`/${data.qrcode}/status`); closeDelay: 5000,
data: {
title: 'Charge Started',
description: '',
type: 'success',
}
});
await invalidate('app:chargecontroller');
await goto(`/${data.qrcode}/status`);
} else {
addToast({
closeDelay: 5000,
data: {
title: 'Error',
description: response.statusText ?? 'unknown',
type: 'error',
}
});
}
} finally { } finally {
startingCharge = false; startingCharge = false;
} }
} }
function test() {
addToast({
closeDelay: 50000,
data: {
title: 'Success',
description: 'The resource was created!',
color: 'green'
},
});
}
</script> </script>
<div class="grid grid-rows-6 h-full w-full"> <div class="grid grid-rows-6 h-full w-full">
<div class="row-start-5 col-start-1 flex flex-col justify-center items-center"> <div class="row-start-5 col-start-1 flex flex-col justify-center items-center">
<div class="pointer-events-auto"> <div class="visible">
<button class="btn btn-primary btn-lg uppercase" onclick={() => showOverlay = true}>Attivare la Ricarica</button> <button class="btn btn-primary btn-lg uppercase" onclick={() => showOverlay = true}>Attivare la Ricarica</button>
<button class="btn btn-secondary" onclick={test}>Test</button>
</div> </div>
</div> </div>
<BSlideOverlay bind:show={showOverlay} closable={!startingCharge}> <BSlideOverlay bind:show={showOverlay} closable={!startingCharge}>

View File

@@ -3,11 +3,12 @@ import { redirect } from "@sveltejs/kit";
export const load: PageLoad = async ({ parent }) => { export const load: PageLoad = async ({ parent }) => {
const parentData = await parent(); const parentData = await parent();
if (parentData.user === null) return redirect(303, `${parentData.qrcode}/login`); if (parentData.user === null) return redirect(303, `/${parentData.qrcode}/login`);
else { else {
if (!parentData.chargePermission.includes(parentData.qrcode)) { if (!parentData.chargePermission.includes(parentData.qrcode)) {
return redirect(303, `${parentData.qrcode}/forbidden`); return redirect(303, `/${parentData.qrcode}/forbidden`);
} }
} }
if (parentData.chargecontroller.active_charge !== null) return redirect(303, `/${parentData.qrcode}/status`);
return parentData; return parentData;
}; };

View File

@@ -1,9 +1,19 @@
<script lang="ts"> <script lang="ts">
import * as L from 'leaflet'; import * as L from 'leaflet';
import 'leaflet/dist/leaflet.css'; import 'leaflet/dist/leaflet.css';
import lmiUrl from 'leaflet/dist/images/marker-icon.png';
import lmi2Url from 'leaflet/dist/images/marker-icon-2x.png';
import lmsUrl from 'leaflet/dist/images/marker-shadow.png';
import { onMount, type Snippet } from "svelte"; import { onMount, type Snippet } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements"; import type { SvelteHTMLElements } from "svelte/elements";
if (import.meta.env.MODE === 'production') {
// Fix bundling bug for leaflet default marker icon on production
L.Icon.Default.prototype.options.iconUrl = lmiUrl;
L.Icon.Default.prototype.options.iconRetinaUrl = lmi2Url;
L.Icon.Default.prototype.options.shadowUrl = lmsUrl;
}
type Props = { type Props = {
x: number, x: number,
y: number, y: number,

View File

@@ -1,4 +1,4 @@
<div class="pointer-events-auto bg-red-500/50 h-full w-full flex justify-center items-center"> <div class="visible bg-red-500/50 h-full w-full flex justify-center items-center">
<div class="card card-border bg-base-100"> <div class="card card-border bg-base-100">
<div class="card-body items-center"> <div class="card-body items-center">
<h2 class="card-title">Forbidden</h2> <h2 class="card-title">Forbidden</h2>

View File

@@ -56,7 +56,7 @@
const { message, enhance, submitting } = form; const { message, enhance, submitting } = form;
</script> </script>
<div class="pointer-events-auto bg-gray-300/50 h-full w-full flex justify-center items-center"> <div class="visible bg-gray-300/50 h-full w-full flex justify-center items-center">
<div class="card bg-base-100 w-fit shadow-md"> <div class="card bg-base-100 w-fit shadow-md">
<form class="card-body" method="POST" use:enhance> <form class="card-body" method="POST" use:enhance>
<h2 class="card-title">Accesso Utente</h2> <h2 class="card-title">Accesso Utente</h2>

View File

@@ -2,6 +2,7 @@
import { onMount } from "svelte"; import { onMount } from "svelte";
import { goto, invalidate } from "$app/navigation"; import { goto, invalidate } from "$app/navigation";
import { scale } from 'svelte/transition'; import { scale } from 'svelte/transition';
import { addToast } from '$lib/ToastSystem/Toaster.svelte';
import BatteryIcon from "$lib/icons/BatteryIcon.svelte"; import BatteryIcon from "$lib/icons/BatteryIcon.svelte";
import BSlideOverlay from "$lib/BSlideOverlay.svelte"; import BSlideOverlay from "$lib/BSlideOverlay.svelte";
@@ -32,16 +33,40 @@
if (stoppingCharge) return; if (stoppingCharge) return;
stoppingCharge = true; stoppingCharge = true;
try { try {
// TODO: StopCharge fetch request const response = await fetch(`/api/public/1/chargecontroller/${data.qrcode}/stop_charge/`, {
console.log("nop"); method: 'POST',
await goto(`/${data.qrcode}`); headers: {
'Accept': 'application/json',
}
});
if (response.ok) {
addToast({
closeDelay: 5000,
data: {
title: 'Charge Stopped',
description: '',
type: 'success',
}
});
await invalidate('app:chargecontroller');
await goto(`/${data.qrcode}`);
} else {
addToast({
closeDelay: 5000,
data: {
title: 'Error',
description: response.statusText ?? 'unknown',
type: 'error',
}
});
}
} finally { } finally {
stoppingCharge = false; stoppingCharge = false;
} }
} }
</script> </script>
<div class="pointer-events-auto bg-green-700/80 h-full w-full flex flex-col justify-center items-center gap-12"> <div class="visible bg-green-700/80 h-full w-full flex flex-col justify-center items-center gap-12">
<div> <div>
<BatteryIcon/> <BatteryIcon/>
</div> </div>

View File

@@ -3,6 +3,7 @@ import { redirect } from "@sveltejs/kit";
export const load: PageLoad = async ({ parent }) => { export const load: PageLoad = async ({ parent }) => {
const parentData = await parent(); const parentData = await parent();
if (parentData.user === null) return redirect(303, `${parentData.qrcode}/login`); if (parentData.user === null) return redirect(303, `/${parentData.qrcode}/login`);
if (parentData.chargecontroller.active_charge === null) return redirect(303, `/${parentData.qrcode}`);
return parentData; return parentData;
}; };

View File

@@ -1,5 +1,5 @@
import {preprocessMeltUI, sequence} from "@melt-ui/pp"; import {preprocessMeltUI, sequence} from "@melt-ui/pp";
import adapter from '@sveltejs/adapter-auto'; import adapter from '@sveltejs/adapter-node';
import {vitePreprocess} from '@sveltejs/vite-plugin-svelte'; import {vitePreprocess} from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config}*/ /** @type {import('@sveltejs/kit').Config}*/
const config = { const config = {
@@ -7,9 +7,6 @@ const config = {
// for more information about preprocessors // for more information about preprocessors
preprocess: sequence([vitePreprocess(), preprocessMeltUI()]), preprocess: sequence([vitePreprocess(), preprocessMeltUI()]),
kit: { kit: {
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
adapter: adapter() adapter: adapter()
} }
}; };