@axium/storage 0.6.8 → 0.6.9
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/lib/Add.svelte +6 -18
- package/package.json +2 -2
- package/routes/files/+layout.ts +5 -2
package/lib/Add.svelte
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
{#snippet _item(type: string, text: string, includeContent: boolean = false)}
|
|
18
18
|
<span
|
|
19
|
-
class="
|
|
19
|
+
class="menu-item"
|
|
20
20
|
onclick={() => {
|
|
21
21
|
createType = type;
|
|
22
22
|
createIncludesContent = includeContent;
|
|
@@ -33,12 +33,10 @@
|
|
|
33
33
|
<button class="icon-text"><Icon i="plus" />Add</button>
|
|
34
34
|
{/snippet}
|
|
35
35
|
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
{@render _item('text/x-uri', 'URL', true)}
|
|
41
|
-
</div>
|
|
36
|
+
<span class="menu-item" onclick={() => uploadDialog.showModal()}><Icon i="upload" />Upload</span>
|
|
37
|
+
{@render _item('inode/directory', 'New Folder')}
|
|
38
|
+
{@render _item('text/plain', 'Plain Text')}
|
|
39
|
+
{@render _item('text/x-uri', 'URL', true)}
|
|
42
40
|
</Popover>
|
|
43
41
|
|
|
44
42
|
<FormDialog
|
|
@@ -76,17 +74,7 @@
|
|
|
76
74
|
</FormDialog>
|
|
77
75
|
|
|
78
76
|
<style>
|
|
79
|
-
.
|
|
80
|
-
display: flex;
|
|
81
|
-
flex-direction: column;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.add-menu-item {
|
|
85
|
-
border-radius: 0.5em;
|
|
86
|
-
padding: 0.25em 0.25em;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.add-menu-item:hover {
|
|
77
|
+
.menu-item:hover {
|
|
90
78
|
cursor: pointer;
|
|
91
79
|
background-color: #4455;
|
|
92
80
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axium/storage",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.9",
|
|
4
4
|
"author": "James Prevett <axium@jamespre.dev> (https://jamespre.dev)",
|
|
5
5
|
"description": "User file storage for Axium",
|
|
6
6
|
"funding": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@axium/client": ">=0.1.0",
|
|
42
42
|
"@axium/core": ">=0.5.4",
|
|
43
|
-
"@axium/server": ">=0.22.
|
|
43
|
+
"@axium/server": ">=0.22.5",
|
|
44
44
|
"@sveltejs/kit": "^2.27.3",
|
|
45
45
|
"utilium": "^2.3.8"
|
|
46
46
|
},
|
package/routes/files/+layout.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { getCurrentSession } from '@axium/client/user';
|
|
2
2
|
import { redirect } from '@sveltejs/kit';
|
|
3
3
|
import type { LayoutLoadEvent, LayoutRouteId } from './$types';
|
|
4
|
+
import type { Session } from '@axium/core';
|
|
4
5
|
|
|
5
6
|
export const ssr = false;
|
|
6
7
|
|
|
7
|
-
export async function load({ url, route }: LayoutLoadEvent) {
|
|
8
|
-
|
|
8
|
+
export async function load({ url, route, parent }: LayoutLoadEvent) {
|
|
9
|
+
let { session }: { session?: Session | null } = await parent();
|
|
10
|
+
|
|
11
|
+
session ||= await getCurrentSession().catch(() => null);
|
|
9
12
|
|
|
10
13
|
if (!session) redirect(307, '/login?after=' + url.pathname);
|
|
11
14
|
|