⬆️ Upgraded SvelteKit
This commit is contained in:
+32
-32
@@ -15,67 +15,67 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@beyonk/svelte-mapbox": "^8.1.4",
|
"@beyonk/svelte-mapbox": "^8.1.4",
|
||||||
"@felte/reporter-tippy": "^1.1.2",
|
"@felte/reporter-tippy": "^1.1.3",
|
||||||
"@felte/validator-yup": "^1.0.8",
|
"@felte/validator-yup": "^1.0.9",
|
||||||
"@fontsource/marck-script": "^4.5.9",
|
"@fontsource/marck-script": "^4.5.10",
|
||||||
"@sentry/browser": "^7.5.1",
|
"@sentry/browser": "^7.11.1",
|
||||||
"@sentry/tracing": "^7.5.1",
|
"@sentry/tracing": "^7.11.1",
|
||||||
"@sveltejs/adapter-auto": "next",
|
"@sveltejs/adapter-auto": "next",
|
||||||
"@sveltejs/adapter-node": "^1.0.0-next.83",
|
"@sveltejs/adapter-node": "^1.0.0-next.86",
|
||||||
"@sveltejs/kit": "next",
|
"@sveltejs/kit": "next",
|
||||||
"@tailwindcss/typography": "^0.5.3",
|
"@tailwindcss/typography": "^0.5.4",
|
||||||
"@types/cookie": "^0.5.1",
|
"@types/cookie": "^0.5.1",
|
||||||
"@types/js-cookie": "^3.0.2",
|
"@types/js-cookie": "^3.0.2",
|
||||||
"@types/luxon": "^2.3.2",
|
"@types/luxon": "^2.4.0",
|
||||||
"@types/ua-parser-js": "^0.7.36",
|
"@types/ua-parser-js": "^0.7.36",
|
||||||
"@types/yup": "^0.29.14",
|
"@types/yup": "^0.29.14",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
"@typescript-eslint/eslint-plugin": "^5.33.1",
|
||||||
"@typescript-eslint/parser": "^5.30.5",
|
"@typescript-eslint/parser": "^5.33.1",
|
||||||
"@uppy/compressor": "^0.3.0",
|
"@uppy/compressor": "^0.3.3",
|
||||||
"@uppy/core": "^2.3.1",
|
"@uppy/core": "^2.3.3",
|
||||||
"@uppy/dashboard": "^2.3.0",
|
"@uppy/dashboard": "^2.4.2",
|
||||||
"@uppy/drop-target": "^1.1.3",
|
"@uppy/drop-target": "^1.1.4",
|
||||||
"@uppy/image-editor": "^1.3.0",
|
"@uppy/image-editor": "^1.4.2",
|
||||||
"@uppy/svelte": "^1.0.8",
|
"@uppy/svelte": "^1.0.9",
|
||||||
"@uppy/xhr-upload": "^2.1.2",
|
"@uppy/xhr-upload": "^2.1.3",
|
||||||
"autoprefixer": "^10.4.7",
|
"autoprefixer": "^10.4.8",
|
||||||
"cookie": "^0.5.0",
|
"cookie": "^0.5.0",
|
||||||
"crypto-js": "^4.1.1",
|
"crypto-js": "^4.1.1",
|
||||||
"cssnano": "^5.1.12",
|
"cssnano": "^5.1.13",
|
||||||
"eslint": "^8.19.0",
|
"eslint": "^8.22.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-svelte3": "^4.0.0",
|
"eslint-plugin-svelte3": "^4.0.0",
|
||||||
"felte": "^1.2.2",
|
"felte": "^1.2.3",
|
||||||
"highlight.js": "^11.5.1",
|
"highlight.js": "^11.6.0",
|
||||||
"i18next-browser-languagedetector": "^6.1.4",
|
"i18next-browser-languagedetector": "^6.1.5",
|
||||||
"js-cookie": "^3.0.1",
|
"js-cookie": "^3.0.1",
|
||||||
"luxon": "^2.4.0",
|
"luxon": "^2.5.0",
|
||||||
"mapbox-gl": "^2.9.1",
|
"mapbox-gl": "^2.9.2",
|
||||||
"plausible-tracker": "^0.3.8",
|
"plausible-tracker": "^0.3.8",
|
||||||
"postcss": "^8.4.14",
|
"postcss": "^8.4.16",
|
||||||
"postcss-import": "^14.1.0",
|
"postcss-import": "^14.1.0",
|
||||||
"postcss-load-config": "^4.0.1",
|
"postcss-load-config": "^4.0.1",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"prettier-plugin-svelte": "^2.7.0",
|
"prettier-plugin-svelte": "^2.7.0",
|
||||||
"sass": "^1.53.0",
|
"sass": "^1.54.4",
|
||||||
"socket.io-client": "^4.5.1",
|
"socket.io-client": "^4.5.1",
|
||||||
"svelte": "^3.49.0",
|
"svelte": "^3.49.0",
|
||||||
"svelte-check": "^2.8.0",
|
"svelte-check": "^2.8.1",
|
||||||
"svelte-preprocess": "^4.10.7",
|
"svelte-preprocess": "^4.10.7",
|
||||||
"svelte-range-slider-pips": "^2.0.3",
|
"svelte-range-slider-pips": "^2.0.3",
|
||||||
"svelte-tippy": "^1.3.2",
|
"svelte-tippy": "^1.3.2",
|
||||||
"swiper": "^8.3.0",
|
"swiper": "^8.3.2",
|
||||||
"tailwindcss": "^3.1.5",
|
"tailwindcss": "^3.1.8",
|
||||||
"tippy.js": "^6.3.7",
|
"tippy.js": "^6.3.7",
|
||||||
"tslib": "^2.4.0",
|
"tslib": "^2.4.0",
|
||||||
"typescript": "~4.7.4",
|
"typescript": "~4.7.4",
|
||||||
"ua-parser-js": "^1.0.2",
|
"ua-parser-js": "^1.0.2",
|
||||||
"vite": "3",
|
"vite": "^3.0.8",
|
||||||
"vite-plugin-iso-import": "^0.1.3",
|
"vite-plugin-iso-import": "^0.1.3",
|
||||||
"yup": "^0.32.11"
|
"yup": "^0.32.11"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"i18next": "^21.8.13"
|
"i18next": "^21.9.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+720
-516
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
|||||||
|
import { signedIn } from '$lib/stores';
|
||||||
|
|
||||||
|
export async function load({ session }) {
|
||||||
|
if (session.authenticated) {
|
||||||
|
signedIn.set(true);
|
||||||
|
} else {
|
||||||
|
signedIn.set(false);
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
@@ -3,25 +3,6 @@
|
|||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
- file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
-->
|
-->
|
||||||
<script lang="ts" context="module">
|
|
||||||
throw new Error(
|
|
||||||
'@migration task: Check code was safely removed (https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292722)'
|
|
||||||
);
|
|
||||||
|
|
||||||
// import { signedIn } from '$lib/stores';
|
|
||||||
|
|
||||||
// export async function load({ session }) {
|
|
||||||
// if (session.authenticated) {
|
|
||||||
// signedIn.set(true);
|
|
||||||
// return {
|
|
||||||
// status: 302,
|
|
||||||
// redirect: '/dashboard'
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
// return {};
|
|
||||||
// }
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { navbarVisible } from '$lib/stores';
|
import { navbarVisible } from '$lib/stores';
|
||||||
import { getLocalization } from '$lib/i18n';
|
import { getLocalization } from '$lib/i18n';
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
// import { redirect } from '@sveltejs/kit';
|
||||||
|
import { signedIn } from '$lib/stores';
|
||||||
|
|
||||||
|
export async function load({ session }) {
|
||||||
|
if (session.authenticated) {
|
||||||
|
signedIn.set(true);
|
||||||
|
// throw redirect(302, '/dashboard');
|
||||||
|
} else {
|
||||||
|
signedIn.set(false);
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
|
||||||
|
export async function load({ session, url }) {
|
||||||
|
const verified = url.searchParams.get('verified');
|
||||||
|
const returnTo =
|
||||||
|
url.searchParams.get('returnTo') !== null ? url.searchParams.get('returnTo') : '/dashboard';
|
||||||
|
if (session.authenticated) {
|
||||||
|
throw redirect(302, returnTo);
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
verified: verified !== null
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
export async function load({ url }) {
|
||||||
|
const error = url.searchParams.get('error');
|
||||||
|
return {
|
||||||
|
error
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
export async function load({ url }) {
|
||||||
|
const token = url.searchParams.get('token');
|
||||||
|
|
||||||
|
return {
|
||||||
|
token
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
|
||||||
|
export async function load({ session }) {
|
||||||
|
if (session.authenticated) {
|
||||||
|
throw redirect(302, '/dashboard');
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
|
||||||
|
export async function load({ session }) {
|
||||||
|
if (session.authenticated) {
|
||||||
|
throw redirect(302, '/dashboard');
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
|
||||||
|
export async function load({ session }) {
|
||||||
|
if (!session.authenticated) {
|
||||||
|
throw redirect(302, '/account/login?returnTo=/account/settings');
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
email: session.email
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
|
||||||
|
export async function load({ session, url }) {
|
||||||
|
if (!session.authenticated) {
|
||||||
|
throw redirect(302, '/account/login');
|
||||||
|
}
|
||||||
|
const token = url.searchParams.get('token');
|
||||||
|
const pin = url.searchParams.get('pin');
|
||||||
|
let auto_connect = url.searchParams.get('connect') !== null;
|
||||||
|
if (token === null || pin === null) {
|
||||||
|
auto_connect = false;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
game_pin: pin === null ? '' : pin,
|
||||||
|
game_token: token === null ? '' : token,
|
||||||
|
auto_connect: auto_connect
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
import { signedIn } from '$lib/stores';
|
||||||
|
|
||||||
|
export async function load({ session }) {
|
||||||
|
if (!session.authenticated) {
|
||||||
|
throw redirect(302, '/account/login?returnTo=/create');
|
||||||
|
}
|
||||||
|
if (session.authenticated) {
|
||||||
|
signedIn.set(true);
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
|
||||||
|
export async function load({ session }) {
|
||||||
|
if (!session.authenticated) {
|
||||||
|
throw redirect(302, '/account/login?returnTo=/dashboard');
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
email: session.email
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export const prerender = true;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export const prerender = true;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export const prerender = true;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export const prerender = true;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export const prerender = true;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export const prerender = true;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export const prerender = true;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export const prerender = true;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export const prerender = true;
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import { redirect, error } from '@sveltejs/kit';
|
||||||
|
import { signedIn } from '$lib/stores';
|
||||||
|
|
||||||
|
export async function load({ url, session }) {
|
||||||
|
const quiz_id = url.searchParams.get('quiz_id');
|
||||||
|
if (!session.authenticated) {
|
||||||
|
throw redirect(302, `/account/login?returnTo=/edit?quiz_id=${quiz_id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (session.authenticated) {
|
||||||
|
signedIn.set(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (quiz_id === null) {
|
||||||
|
throw error(404);
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
quiz_id
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
import { signedIn } from '$lib/stores';
|
||||||
|
export async function load({ session }) {
|
||||||
|
if (!session.authenticated) {
|
||||||
|
throw redirect(302, '/account/login?returnTo=/import');
|
||||||
|
} else {
|
||||||
|
if (session.authenticated) {
|
||||||
|
signedIn.set(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
email: session.email
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { signedIn } from '$lib/stores';
|
||||||
|
|
||||||
|
export async function load({ url, session }) {
|
||||||
|
if (session.authenticated) {
|
||||||
|
signedIn.set(true);
|
||||||
|
}
|
||||||
|
const token = url.searchParams.get('pin');
|
||||||
|
return {
|
||||||
|
game_pin: token === null ? '' : token
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { error } from '@sveltejs/kit';
|
||||||
|
import type { PageLoad } from '@sveltejs/kit';
|
||||||
|
|
||||||
|
export const load: PageLoad = async ({ params, fetch, session }) => {
|
||||||
|
const { quiz_id } = params;
|
||||||
|
const res = await fetch(`/api/v1/quiz/get/public/${quiz_id}`);
|
||||||
|
if (res.status === 404 || res.status === 400) {
|
||||||
|
throw error(404);
|
||||||
|
} else if (res.status === 200) {
|
||||||
|
const quiz = await res.json();
|
||||||
|
return {
|
||||||
|
quiz: quiz,
|
||||||
|
logged_in: session.authenticated
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
throw error(500);
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user