@axium/notes 0.4.4 → 0.4.5
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/dist/common.d.ts +6 -0
- package/lib/Note.svelte +1 -1
- package/lib/tsconfig.json +1 -1
- package/package.json +6 -5
- package/routes/notes/+layout.ts +7 -0
- package/routes/notes/+page.svelte +6 -1
- package/routes/tsconfig.json +1 -1
- package/dist/web_hook.d.ts +0 -8
- package/dist/web_hook.js +0 -4
package/dist/common.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export declare const Note: z.ZodObject<{
|
|
|
29
29
|
emailVerified: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>>;
|
|
30
30
|
preferences: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
31
31
|
debug: z.ZodDefault<z.ZodBoolean>;
|
|
32
|
+
theme: z.ZodDefault<z.ZodLiteral<"default" | "light" | "forest" | "midnight" | "beach" | "cherry" | "volcano">>;
|
|
32
33
|
}, z.core.$strip>>>;
|
|
33
34
|
roles: z.ZodArray<z.ZodString>;
|
|
34
35
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -65,6 +66,7 @@ declare const NotesAPI: {
|
|
|
65
66
|
emailVerified: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>>;
|
|
66
67
|
preferences: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
67
68
|
debug: z.ZodDefault<z.ZodBoolean>;
|
|
69
|
+
theme: z.ZodDefault<z.ZodLiteral<"default" | "light" | "forest" | "midnight" | "beach" | "cherry" | "volcano">>;
|
|
68
70
|
}, z.core.$strip>>>;
|
|
69
71
|
roles: z.ZodArray<z.ZodString>;
|
|
70
72
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -102,6 +104,7 @@ declare const NotesAPI: {
|
|
|
102
104
|
emailVerified: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>>;
|
|
103
105
|
preferences: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
104
106
|
debug: z.ZodDefault<z.ZodBoolean>;
|
|
107
|
+
theme: z.ZodDefault<z.ZodLiteral<"default" | "light" | "forest" | "midnight" | "beach" | "cherry" | "volcano">>;
|
|
105
108
|
}, z.core.$strip>>>;
|
|
106
109
|
roles: z.ZodArray<z.ZodString>;
|
|
107
110
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -136,6 +139,7 @@ declare const NotesAPI: {
|
|
|
136
139
|
emailVerified: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>>;
|
|
137
140
|
preferences: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
138
141
|
debug: z.ZodDefault<z.ZodBoolean>;
|
|
142
|
+
theme: z.ZodDefault<z.ZodLiteral<"default" | "light" | "forest" | "midnight" | "beach" | "cherry" | "volcano">>;
|
|
139
143
|
}, z.core.$strip>>>;
|
|
140
144
|
roles: z.ZodArray<z.ZodString>;
|
|
141
145
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -173,6 +177,7 @@ declare const NotesAPI: {
|
|
|
173
177
|
emailVerified: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>>;
|
|
174
178
|
preferences: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
175
179
|
debug: z.ZodDefault<z.ZodBoolean>;
|
|
180
|
+
theme: z.ZodDefault<z.ZodLiteral<"default" | "light" | "forest" | "midnight" | "beach" | "cherry" | "volcano">>;
|
|
176
181
|
}, z.core.$strip>>>;
|
|
177
182
|
roles: z.ZodArray<z.ZodString>;
|
|
178
183
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -205,6 +210,7 @@ declare const NotesAPI: {
|
|
|
205
210
|
emailVerified: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>>;
|
|
206
211
|
preferences: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
207
212
|
debug: z.ZodDefault<z.ZodBoolean>;
|
|
213
|
+
theme: z.ZodDefault<z.ZodLiteral<"default" | "light" | "forest" | "midnight" | "beach" | "cherry" | "volcano">>;
|
|
208
214
|
}, z.core.$strip>>>;
|
|
209
215
|
roles: z.ZodArray<z.ZodString>;
|
|
210
216
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
package/lib/Note.svelte
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { fetchAPI, text } from '@axium/client';
|
|
5
5
|
import { dynamicRows } from '@axium/client/attachments';
|
|
6
6
|
import { AccessControlDialog, Icon, Popover } from '@axium/client/components';
|
|
7
|
-
import { copy } from '@axium/client/
|
|
7
|
+
import { copy } from '@axium/client/web';
|
|
8
8
|
import { toastStatus } from '@axium/client/toast';
|
|
9
9
|
import { checkAndMatchACL, type UserPublic } from '@axium/core';
|
|
10
10
|
import type { Note } from '@axium/notes/common';
|
package/lib/tsconfig.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axium/notes",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"author": "James Prevett <axium@jamespre.dev>",
|
|
5
5
|
"description": "Notes for Axium",
|
|
6
6
|
"funding": {
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"build": "tsc"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@axium/client": ">=0.
|
|
40
|
-
"@axium/core": ">=0.
|
|
41
|
-
"@axium/server": ">=0.
|
|
39
|
+
"@axium/client": ">=0.37.0",
|
|
40
|
+
"@axium/core": ">=0.39.0",
|
|
41
|
+
"@axium/server": ">=0.55.0",
|
|
42
42
|
"@sveltejs/kit": "^2.27.3",
|
|
43
43
|
"utilium": "^3.0.0"
|
|
44
44
|
},
|
|
@@ -46,11 +46,12 @@
|
|
|
46
46
|
"zod": "^4.0.5"
|
|
47
47
|
},
|
|
48
48
|
"axium": {
|
|
49
|
+
"locales": "locales",
|
|
49
50
|
"server": {
|
|
50
51
|
"routes": "routes",
|
|
51
52
|
"hooks": "./dist/hooks.js",
|
|
52
53
|
"db": "./db.json",
|
|
53
|
-
"web_client_hooks": "./dist/
|
|
54
|
+
"web_client_hooks": "./dist/common.js"
|
|
54
55
|
},
|
|
55
56
|
"apps": [
|
|
56
57
|
{
|
package/routes/notes/+layout.ts
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
import { connect } from '@axium/client/socket';
|
|
2
|
+
import { schemas } from '@axium/client/sync';
|
|
1
3
|
import { getCurrentSession } from '@axium/client/user';
|
|
2
4
|
import type { Session, UserPublic } from '@axium/core';
|
|
5
|
+
import { Note } from '@axium/notes/common';
|
|
6
|
+
|
|
7
|
+
schemas.set('notes', Note);
|
|
3
8
|
|
|
4
9
|
export async function load({ parent }) {
|
|
5
10
|
let { session }: { session?: (Session & { user: UserPublic }) | null } = await parent();
|
|
6
11
|
|
|
7
12
|
session ||= await getCurrentSession().catch(() => null);
|
|
8
13
|
|
|
14
|
+
if (session) await connect().catch(() => null);
|
|
15
|
+
|
|
9
16
|
return { session };
|
|
10
17
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { fetchAPI, text } from '@axium/client';
|
|
3
3
|
import { Icon } from '@axium/client/components';
|
|
4
|
+
import { syncObjects } from '@axium/client/reactive';
|
|
4
5
|
import { toast } from '@axium/client/toast';
|
|
5
6
|
import { Note } from '@axium/notes/components';
|
|
6
7
|
|
|
@@ -8,10 +9,14 @@
|
|
|
8
9
|
|
|
9
10
|
let notes = $state(data.notes);
|
|
10
11
|
$effect(() => {
|
|
11
|
-
notes.sort((a, b) =>
|
|
12
|
+
notes.sort((a, b) => +b.pinned - +a.pinned);
|
|
12
13
|
});
|
|
14
|
+
|
|
15
|
+
const onfocusout = syncObjects(notes, 'notes');
|
|
13
16
|
</script>
|
|
14
17
|
|
|
18
|
+
<svelte:window {onfocusout} />
|
|
19
|
+
|
|
15
20
|
<svelte:head>
|
|
16
21
|
<title>{text('app_name.notes')}</title>
|
|
17
22
|
</svelte:head>
|
package/routes/tsconfig.json
CHANGED
package/dist/web_hook.d.ts
DELETED
package/dist/web_hook.js
DELETED