@axium/storage 0.6.8 → 0.6.10
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 +7 -19
- package/lib/List.svelte +1 -1
- package/lib/SidebarItem.svelte +1 -1
- package/lib/Usage.svelte +1 -1
- package/package.json +3 -3
- package/routes/files/+layout.svelte +1 -1
- package/routes/files/+layout.ts +5 -2
- package/routes/files/[id]/+page.svelte +1 -1
- package/routes/files/shared/+page.svelte +1 -1
- package/routes/files/trash/+page.svelte +1 -1
- package/routes/files/usage/+page.svelte +1 -1
package/lib/Add.svelte
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { forMime } from '@axium/core/icons';
|
|
3
|
-
import { FormDialog, Icon, Popover, Upload } from '@axium/
|
|
3
|
+
import { FormDialog, Icon, Popover, Upload } from '@axium/client/components';
|
|
4
4
|
import { uploadItem } from '@axium/storage/client';
|
|
5
5
|
import type { StorageItemMetadata } from '@axium/storage/common';
|
|
6
6
|
|
|
@@ -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/lib/List.svelte
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { formatBytes } from '@axium/core/format';
|
|
3
3
|
import { forMime as iconForMime } from '@axium/core/icons';
|
|
4
|
-
import { FormDialog, Icon } from '@axium/
|
|
4
|
+
import { FormDialog, Icon } from '@axium/client/components';
|
|
5
5
|
import { getDirectoryMetadata, updateItemMetadata } from '@axium/storage/client';
|
|
6
6
|
import type { StorageItemMetadata } from '@axium/storage/common';
|
|
7
7
|
import '../styles/list.css';
|
package/lib/SidebarItem.svelte
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import * as icon from '@axium/core/icons';
|
|
3
|
-
import { ClipboardCopy, FormDialog, Icon } from '@axium/
|
|
3
|
+
import { ClipboardCopy, FormDialog, Icon } from '@axium/client/components';
|
|
4
4
|
import { deleteItem, updateItemMetadata } from '@axium/storage/client';
|
|
5
5
|
import type { StorageItemMetadata } from '@axium/storage/common';
|
|
6
6
|
import { debug, getDirectory, selection, toggle, toggleRange } from '@axium/storage/sidebar';
|
package/lib/Usage.svelte
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { formatBytes } from '@axium/core/format';
|
|
3
|
-
import { NumberBar } from '@axium/
|
|
3
|
+
import { NumberBar } from '@axium/client/components';
|
|
4
4
|
import { getUserStorageInfo } from '@axium/storage/client';
|
|
5
5
|
import type { UserStorageInfo } from '@axium/storage/common';
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axium/storage",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.10",
|
|
4
4
|
"author": "James Prevett <axium@jamespre.dev> (https://jamespre.dev)",
|
|
5
5
|
"description": "User file storage for Axium",
|
|
6
6
|
"funding": {
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"build": "tsc"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@axium/client": ">=0.
|
|
41
|
+
"@axium/client": ">=0.2.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
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { Icon } from '@axium/
|
|
2
|
+
import { Icon } from '@axium/client/components';
|
|
3
3
|
import { StorageAdd, StorageList } from '@axium/storage/components';
|
|
4
4
|
import type { PageProps } from './$types';
|
|
5
5
|
import { updateItemMetadata } from '@axium/storage/client';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { formatBytes } from '@axium/core/format';
|
|
3
3
|
import { forMime as iconForMime } from '@axium/core/icons';
|
|
4
|
-
import { Icon } from '@axium/
|
|
4
|
+
import { Icon } from '@axium/client/components';
|
|
5
5
|
import '@axium/storage/styles/list';
|
|
6
6
|
import type { PageProps } from './$types';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { formatBytes } from '@axium/core/format';
|
|
3
3
|
import { forMime as iconForMime } from '@axium/core/icons';
|
|
4
|
-
import { FormDialog, Icon } from '@axium/
|
|
4
|
+
import { FormDialog, Icon } from '@axium/client/components';
|
|
5
5
|
import { deleteItem, updateItemMetadata } from '@axium/storage/client';
|
|
6
6
|
import '@axium/storage/styles/list';
|
|
7
7
|
import type { PageProps } from './$types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { formatBytes } from '@axium/core/format';
|
|
3
3
|
import { forMime } from '@axium/core/icons';
|
|
4
|
-
import { FormDialog, Icon, NumberBar } from '@axium/
|
|
4
|
+
import { FormDialog, Icon, NumberBar } from '@axium/client/components';
|
|
5
5
|
import { deleteItem, updateItemMetadata } from '@axium/storage/client';
|
|
6
6
|
import type { StorageItemUpdate } from '@axium/storage/common';
|
|
7
7
|
import { StorageList } from '@axium/storage/components';
|