@axium/server 0.19.6 → 0.19.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/client/_app/immutable/chunks/{kt8q6VLI.js → CvAQmxmx.js} +1 -1
- package/build/client/_app/immutable/chunks/CvAQmxmx.js.br +0 -0
- package/build/client/_app/immutable/chunks/CvAQmxmx.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.hl-GLTkf.js → app.8Nmyrt2W.js} +2 -2
- package/build/client/_app/immutable/entry/app.8Nmyrt2W.js.br +0 -0
- package/build/client/_app/immutable/entry/app.8Nmyrt2W.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.Dhk026uj.js +1 -0
- package/build/client/_app/immutable/entry/start.Dhk026uj.js.br +2 -0
- package/build/client/_app/immutable/entry/start.Dhk026uj.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{1.B7g6TVJE.js → 1.BJk095a1.js} +1 -1
- package/build/client/_app/immutable/nodes/1.BJk095a1.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.BJk095a1.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{3.BwwptDiR.js → 3.BDbljB1E.js} +1 -1
- package/build/client/_app/immutable/nodes/3.BDbljB1E.js.br +0 -0
- package/build/client/_app/immutable/nodes/{3.BwwptDiR.js.gz → 3.BDbljB1E.js.gz} +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/server/chunks/{1-CqK3g6va.js → 1-BKxrwtT_.js} +2 -2
- package/build/server/chunks/{1-CqK3g6va.js.map → 1-BKxrwtT_.js.map} +1 -1
- package/build/server/chunks/{3-BI9EEPQX.js → 3-Ct18gbtX.js} +2 -2
- package/build/server/chunks/{3-BI9EEPQX.js.map → 3-Ct18gbtX.js.map} +1 -1
- package/build/server/chunks/{hooks.server-C9qpwVTB.js → hooks.server-KNf9qJX2.js} +23 -13
- package/build/server/chunks/hooks.server-KNf9qJX2.js.map +1 -0
- package/build/server/index.js +2 -2
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +3 -3
- package/build/server/manifest.js.map +1 -1
- package/dist/apps.d.ts +9 -3
- package/dist/apps.js +5 -0
- package/dist/requests.d.ts +6 -0
- package/dist/requests.js +6 -0
- package/dist/sveltekit.js +12 -11
- package/package.json +1 -1
- package/web/lib/WithContextMenu.svelte +56 -15
- package/build/client/_app/immutable/chunks/kt8q6VLI.js.br +0 -0
- package/build/client/_app/immutable/chunks/kt8q6VLI.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.hl-GLTkf.js.br +0 -0
- package/build/client/_app/immutable/entry/app.hl-GLTkf.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.Bi6NhTqw.js +0 -1
- package/build/client/_app/immutable/entry/start.Bi6NhTqw.js.br +0 -2
- package/build/client/_app/immutable/entry/start.Bi6NhTqw.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.B7g6TVJE.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.B7g6TVJE.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.BwwptDiR.js.br +0 -0
- package/build/server/chunks/hooks.server-C9qpwVTB.js.map +0 -1
package/build/server/manifest.js
CHANGED
|
@@ -10,12 +10,12 @@ return {
|
|
|
10
10
|
assets: new Set(["icons/brands.svg","icons/light.svg","icons/regular.svg","icons/solid.svg","styles.css"]),
|
|
11
11
|
mimeTypes: {".svg":"image/svg+xml",".css":"text/css"},
|
|
12
12
|
_: {
|
|
13
|
-
client: {start:"_app/immutable/entry/start.
|
|
13
|
+
client: {start:"_app/immutable/entry/start.Dhk026uj.js",app:"_app/immutable/entry/app.8Nmyrt2W.js",imports:["_app/immutable/entry/start.Dhk026uj.js","_app/immutable/chunks/CvAQmxmx.js","_app/immutable/chunks/IgiyYk6u.js","_app/immutable/chunks/DCUM25og.js","_app/immutable/chunks/BYEtX5Az.js","_app/immutable/chunks/p-F-zYzk.js","_app/immutable/entry/app.8Nmyrt2W.js","_app/immutable/chunks/DCUM25og.js","_app/immutable/chunks/BYEtX5Az.js","_app/immutable/chunks/DsnmJJEf.js","_app/immutable/chunks/IgiyYk6u.js","_app/immutable/chunks/p-F-zYzk.js","_app/immutable/chunks/FWeOBoAM.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
|
|
14
14
|
nodes: [
|
|
15
15
|
__memo(() => import('./chunks/0-BwO1RCtn.js')),
|
|
16
|
-
__memo(() => import('./chunks/1-
|
|
16
|
+
__memo(() => import('./chunks/1-BKxrwtT_.js')),
|
|
17
17
|
__memo(() => import('./chunks/2-BwMXZ3uH.js')),
|
|
18
|
-
__memo(() => import('./chunks/3-
|
|
18
|
+
__memo(() => import('./chunks/3-Ct18gbtX.js')),
|
|
19
19
|
__memo(() => import('./chunks/4-B4PHWuxx.js')),
|
|
20
20
|
__memo(() => import('./chunks/5-CIWzJq4D.js')),
|
|
21
21
|
__memo(() => import('./chunks/6-BQsBMa_q.js'))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sources":["../../.svelte-kit/adapter-node/manifest.js"],"sourcesContent":["export const manifest = (() => {\nfunction __memo(fn) {\n\tlet value;\n\treturn () => value ??= (value = fn());\n}\n\nreturn {\n\tappDir: \"_app\",\n\tappPath: \"_app\",\n\tassets: new Set([\"icons/brands.svg\",\"icons/light.svg\",\"icons/regular.svg\",\"icons/solid.svg\",\"styles.css\"]),\n\tmimeTypes: {\".svg\":\"image/svg+xml\",\".css\":\"text/css\"},\n\t_: {\n\t\tclient: {start:\"_app/immutable/entry/start.
|
|
1
|
+
{"version":3,"file":"manifest.js","sources":["../../.svelte-kit/adapter-node/manifest.js"],"sourcesContent":["export const manifest = (() => {\nfunction __memo(fn) {\n\tlet value;\n\treturn () => value ??= (value = fn());\n}\n\nreturn {\n\tappDir: \"_app\",\n\tappPath: \"_app\",\n\tassets: new Set([\"icons/brands.svg\",\"icons/light.svg\",\"icons/regular.svg\",\"icons/solid.svg\",\"styles.css\"]),\n\tmimeTypes: {\".svg\":\"image/svg+xml\",\".css\":\"text/css\"},\n\t_: {\n\t\tclient: {start:\"_app/immutable/entry/start.Dhk026uj.js\",app:\"_app/immutable/entry/app.8Nmyrt2W.js\",imports:[\"_app/immutable/entry/start.Dhk026uj.js\",\"_app/immutable/chunks/CvAQmxmx.js\",\"_app/immutable/chunks/IgiyYk6u.js\",\"_app/immutable/chunks/DCUM25og.js\",\"_app/immutable/chunks/BYEtX5Az.js\",\"_app/immutable/chunks/p-F-zYzk.js\",\"_app/immutable/entry/app.8Nmyrt2W.js\",\"_app/immutable/chunks/DCUM25og.js\",\"_app/immutable/chunks/BYEtX5Az.js\",\"_app/immutable/chunks/DsnmJJEf.js\",\"_app/immutable/chunks/IgiyYk6u.js\",\"_app/immutable/chunks/p-F-zYzk.js\",\"_app/immutable/chunks/FWeOBoAM.js\"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},\n\t\tnodes: [\n\t\t\t__memo(() => import('./nodes/0.js')),\n\t\t\t__memo(() => import('./nodes/1.js')),\n\t\t\t__memo(() => import('./nodes/2.js')),\n\t\t\t__memo(() => import('./nodes/3.js')),\n\t\t\t__memo(() => import('./nodes/4.js')),\n\t\t\t__memo(() => import('./nodes/5.js')),\n\t\t\t__memo(() => import('./nodes/6.js'))\n\t\t],\n\t\troutes: [\n\t\t\t{\n\t\t\t\tid: \"/_axium/default\",\n\t\t\t\tpattern: /^\\/_axium\\/default\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 2 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/account\",\n\t\t\t\tpattern: /^\\/account\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 3 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/login\",\n\t\t\t\tpattern: /^\\/login\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 4 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/logout\",\n\t\t\t\tpattern: /^\\/logout\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 5 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/register\",\n\t\t\t\tpattern: /^\\/register\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 6 },\n\t\t\t\tendpoint: null\n\t\t\t}\n\t\t],\n\t\tprerendered_routes: new Set([]),\n\t\tmatchers: async () => {\n\t\t\t\n\t\t\treturn { };\n\t\t},\n\t\tserver_assets: {}\n\t}\n}\n})();\n\nexport const prerendered = new Set([]);\n\nexport const base = \"\";"],"names":[],"mappings":"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"}
|
package/dist/apps.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface AppInit {
|
|
2
2
|
id: string;
|
|
3
3
|
name?: string;
|
|
4
|
+
version?: string;
|
|
4
5
|
}
|
|
5
6
|
export declare const apps: Map<string, App>;
|
|
6
7
|
export declare class App {
|
|
7
8
|
readonly id: string;
|
|
8
|
-
name
|
|
9
|
-
|
|
9
|
+
name?: string;
|
|
10
|
+
version?: string;
|
|
11
|
+
constructor(opt: AppInit);
|
|
10
12
|
}
|
|
13
|
+
export declare const appDisabledContent: {
|
|
14
|
+
head: string;
|
|
15
|
+
body: string;
|
|
16
|
+
};
|
package/dist/apps.js
CHANGED
|
@@ -4,6 +4,7 @@ export const apps = _unique('apps', new Map());
|
|
|
4
4
|
export class App {
|
|
5
5
|
id;
|
|
6
6
|
name;
|
|
7
|
+
version;
|
|
7
8
|
constructor(opt) {
|
|
8
9
|
if (apps.has(opt.id))
|
|
9
10
|
throw new ReferenceError(`App with ID "${opt.id}" already exists.`);
|
|
@@ -11,3 +12,7 @@ export class App {
|
|
|
11
12
|
apps.set(this.id, this);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
15
|
+
export const appDisabledContent = {
|
|
16
|
+
head: '<title>App Disabled</title>',
|
|
17
|
+
body: '<h1>App Disabled</h1><p>This app is currently disabled.</p>',
|
|
18
|
+
};
|
package/dist/requests.d.ts
CHANGED
|
@@ -41,3 +41,9 @@ export declare function stripUser(user: UserInternal, includeProtected?: boolean
|
|
|
41
41
|
export declare function withError(text: string, code?: number): (e: Error | ResponseError) => never;
|
|
42
42
|
export declare function handleAPIRequest(event: RequestEvent, route: ServerRoute): Promise<Response>;
|
|
43
43
|
export declare function handleResponseError(e: Error | ResponseError | Redirect): Response;
|
|
44
|
+
export declare const noCacheHeaders: {
|
|
45
|
+
'Content-Type': string;
|
|
46
|
+
'Cache-Control': string;
|
|
47
|
+
Pragma: string;
|
|
48
|
+
Expires: string;
|
|
49
|
+
};
|
package/dist/requests.js
CHANGED
|
@@ -106,3 +106,9 @@ export function handleResponseError(e) {
|
|
|
106
106
|
console.error(e);
|
|
107
107
|
return json({ message: 'Internal Error' + (config.debug ? ': ' + e.message : '') }, { status: 500 });
|
|
108
108
|
}
|
|
109
|
+
export const noCacheHeaders = {
|
|
110
|
+
'Content-Type': 'text/html; charset=utf-8',
|
|
111
|
+
'Cache-Control': 'no-cache, no-store, must-revalidate',
|
|
112
|
+
Pragma: 'no-cache',
|
|
113
|
+
Expires: '0',
|
|
114
|
+
};
|
package/dist/sveltekit.js
CHANGED
|
@@ -2,8 +2,9 @@ import { readFileSync } from 'node:fs';
|
|
|
2
2
|
import { styleText } from 'node:util';
|
|
3
3
|
import { render } from 'svelte/server';
|
|
4
4
|
import { config } from './config.js';
|
|
5
|
-
import { error, handleAPIRequest, handleResponseError, json } from './requests.js';
|
|
5
|
+
import { error, handleAPIRequest, handleResponseError, json, noCacheHeaders } from './requests.js';
|
|
6
6
|
import { resolveRoute } from './routes.js';
|
|
7
|
+
import { appDisabledContent, apps } from './apps.js';
|
|
7
8
|
let template = null;
|
|
8
9
|
function fillSvelteKitTemplate({ head, body }, env = {}, nonce = '') {
|
|
9
10
|
template ||= readFileSync(config.web.template, 'utf-8');
|
|
@@ -24,8 +25,15 @@ export async function handleSvelteKit({ event, resolve, }) {
|
|
|
24
25
|
return new Response(null, { status: 303, headers: { Location: '/_axium/default' } });
|
|
25
26
|
if (config.debug)
|
|
26
27
|
console.log(styleText('blueBright', event.request.method.padEnd(7)), route ? route.path : event.url.pathname);
|
|
27
|
-
if (!route)
|
|
28
|
+
if (!route) {
|
|
29
|
+
// Check to see if this is for an app that is disabled.
|
|
30
|
+
const maybeApp = event.url.pathname.split('/')[1];
|
|
31
|
+
if (apps.has(maybeApp) && config.apps.disabled.includes(maybeApp)) {
|
|
32
|
+
const body = fillSvelteKitTemplate(appDisabledContent);
|
|
33
|
+
return new Response(body, { headers: noCacheHeaders, status: 503 });
|
|
34
|
+
}
|
|
28
35
|
return await resolve(event).catch(handleResponseError);
|
|
36
|
+
}
|
|
29
37
|
if (route.server == true) {
|
|
30
38
|
if (route.api)
|
|
31
39
|
return await handleAPIRequest(event, route).catch(handleResponseError);
|
|
@@ -44,16 +52,9 @@ export async function handleSvelteKit({ event, resolve, }) {
|
|
|
44
52
|
}
|
|
45
53
|
}
|
|
46
54
|
const data = await route.load?.(event);
|
|
47
|
-
const body = fillSvelteKitTemplate(render(route.page));
|
|
55
|
+
const body = fillSvelteKitTemplate(render(route.page, { props: { data } }));
|
|
48
56
|
return new Response(body, {
|
|
49
|
-
headers: config.web.disable_cache
|
|
50
|
-
? {
|
|
51
|
-
'Content-Type': 'text/html; charset=utf-8',
|
|
52
|
-
'Cache-Control': 'no-cache, no-store, must-revalidate',
|
|
53
|
-
Pragma: 'no-cache',
|
|
54
|
-
Expires: '0',
|
|
55
|
-
}
|
|
56
|
-
: {},
|
|
57
|
+
headers: config.web.disable_cache ? noCacheHeaders : {},
|
|
57
58
|
status: 200,
|
|
58
59
|
});
|
|
59
60
|
}
|
package/package.json
CHANGED
|
@@ -1,32 +1,73 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import Icon from './Icon.svelte';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
children(): any;
|
|
7
|
+
menu(
|
|
8
|
+
/**
|
|
9
|
+
* Shortcut to quickly create a generic action in the context menu.
|
|
10
|
+
*/
|
|
11
|
+
action: (icon: string, text: string, action: (event: MouseEvent) => void) => any
|
|
12
|
+
): any;
|
|
13
|
+
actions: Record<string, () => void>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let { children, menu, actions, ...rest }: Props = $props();
|
|
17
|
+
|
|
18
|
+
let popover = $state<HTMLDivElement>();
|
|
5
19
|
|
|
6
|
-
function oncontextmenu(
|
|
7
|
-
|
|
8
|
-
|
|
20
|
+
function oncontextmenu(e: MouseEvent) {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
e.stopPropagation();
|
|
23
|
+
popover!.togglePopover();
|
|
24
|
+
_forcePopover = true;
|
|
9
25
|
}
|
|
10
26
|
|
|
11
|
-
|
|
12
|
-
|
|
27
|
+
let _forcePopover = false;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Workaround for https://github.com/whatwg/html/issues/10905
|
|
31
|
+
* @todo Remove when the problem is fixed.
|
|
32
|
+
*/
|
|
33
|
+
function onpointerup(e: PointerEvent) {
|
|
34
|
+
if (!_forcePopover) return;
|
|
35
|
+
e.stopPropagation();
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
popover!.togglePopover();
|
|
38
|
+
_forcePopover = false;
|
|
13
39
|
}
|
|
14
40
|
</script>
|
|
15
41
|
|
|
16
|
-
|
|
17
|
-
|
|
42
|
+
{#snippet action(i: string, text: string, action: (event: MouseEvent) => void)}
|
|
43
|
+
<div
|
|
44
|
+
onclick={e => {
|
|
45
|
+
e.stopPropagation();
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
action(e);
|
|
48
|
+
}}
|
|
49
|
+
class="action"
|
|
50
|
+
>
|
|
51
|
+
{#if i}<Icon {i} --size="14px" />{/if}
|
|
52
|
+
{text}
|
|
53
|
+
</div>
|
|
54
|
+
{/snippet}
|
|
18
55
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
{
|
|
56
|
+
<div data-axium-context-menu {oncontextmenu} {onpointerup} {...rest}>
|
|
57
|
+
{@render children()}
|
|
58
|
+
<div popover bind:this={popover}>
|
|
59
|
+
{@render menu(action)}
|
|
60
|
+
</div>
|
|
22
61
|
</div>
|
|
23
62
|
|
|
24
63
|
<style>
|
|
25
|
-
|
|
64
|
+
[data-axium-context-menu] {
|
|
26
65
|
display: contents;
|
|
27
66
|
}
|
|
28
67
|
|
|
29
|
-
.
|
|
30
|
-
|
|
68
|
+
div.action:hover {
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
background-color: #223;
|
|
71
|
+
border-radius: 0.25em;
|
|
31
72
|
}
|
|
32
73
|
</style>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as o,a as r}from"../chunks/kt8q6VLI.js";export{o as load_css,r as start};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|