@axium/notes 0.3.9 → 0.3.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/dist/web_hook.d.ts +8 -0
- package/dist/web_hook.js +4 -0
- package/lib/Note.svelte +14 -9
- package/package.json +2 -2
- package/routes/notes/+page.svelte +5 -4
- package/routes/notes/[id]/+page.svelte +4 -2
package/dist/web_hook.js
ADDED
package/lib/Note.svelte
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { goto } from '$app/navigation';
|
|
3
3
|
import { page } from '$app/state';
|
|
4
|
+
import { fetchAPI, text } from '@axium/client';
|
|
4
5
|
import { dynamicRows } from '@axium/client/attachments';
|
|
5
|
-
import { copy } from '@axium/client/gui';
|
|
6
6
|
import { AccessControlDialog, Icon, Popover } from '@axium/client/components';
|
|
7
|
-
import {
|
|
7
|
+
import { copy } from '@axium/client/gui';
|
|
8
8
|
import type { Note } from '@axium/notes/common';
|
|
9
9
|
import { download } from 'utilium/dom.js';
|
|
10
10
|
|
|
@@ -34,10 +34,12 @@
|
|
|
34
34
|
else notes.splice(notes.indexOf(note), 1);
|
|
35
35
|
})}
|
|
36
36
|
>
|
|
37
|
-
<Icon i="trash" />
|
|
37
|
+
<Icon i="trash" />
|
|
38
|
+
<span>{text('generic.delete')}</span>
|
|
38
39
|
</div>
|
|
39
40
|
<div class="menu-item" onclick={() => download(note.title + '.txt', note.content ?? '')}>
|
|
40
|
-
<Icon i="download" />
|
|
41
|
+
<Icon i="download" />
|
|
42
|
+
<span>{text('notes.download')}</span>
|
|
41
43
|
</div>
|
|
42
44
|
<div
|
|
43
45
|
class="menu-item"
|
|
@@ -46,20 +48,23 @@
|
|
|
46
48
|
acl!.click();
|
|
47
49
|
}}
|
|
48
50
|
>
|
|
49
|
-
<Icon i="user-group" />
|
|
51
|
+
<Icon i="user-group" />
|
|
52
|
+
<span>{text('notes.share')}</span>
|
|
50
53
|
</div>
|
|
51
54
|
<div class="menu-item" onclick={() => copy('text/plain', `${location.origin}/notes/${note.id}`)}>
|
|
52
|
-
<Icon i="link-horizontal" />
|
|
55
|
+
<Icon i="link-horizontal" />
|
|
56
|
+
<span>{text('notes.copy_link')}</span>
|
|
53
57
|
</div>
|
|
54
58
|
{#if notes}
|
|
55
59
|
<div class="menu-item" onclick={() => open(`/notes/${note.id}`)}>
|
|
56
|
-
<Icon i="arrow-up-right-from-square" />
|
|
60
|
+
<Icon i="arrow-up-right-from-square" />
|
|
61
|
+
<span>{text('notes.open_new_tab')}</span>
|
|
57
62
|
</div>
|
|
58
63
|
{/if}
|
|
59
64
|
{#if page.data.session?.user.preferences.debug}
|
|
60
65
|
<div class="menu-item" onclick={() => copy('text/plain', note.id)}>
|
|
61
66
|
<Icon i="hashtag" --size="14px" />
|
|
62
|
-
|
|
67
|
+
<span>{text('notes.copy_id')}</span>
|
|
63
68
|
</div>
|
|
64
69
|
{/if}
|
|
65
70
|
</Popover>
|
|
@@ -69,7 +74,7 @@
|
|
|
69
74
|
bind:value={note.content}
|
|
70
75
|
name="content"
|
|
71
76
|
class="editable-text"
|
|
72
|
-
placeholder=
|
|
77
|
+
placeholder={text('notes.content_placeholder')}
|
|
73
78
|
oninput={() => fetchAPI('PATCH', 'notes/:id', note, note.id)}
|
|
74
79
|
{@attach dynamicRows()}>{note.content}</textarea
|
|
75
80
|
>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axium/notes",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.10",
|
|
4
4
|
"author": "James Prevett <axium@jamespre.dev>",
|
|
5
5
|
"description": "Notes for Axium",
|
|
6
6
|
"funding": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"routes": "routes",
|
|
50
50
|
"hooks": "./dist/hooks.js",
|
|
51
51
|
"db": "./db.json",
|
|
52
|
-
"web_client_hooks": "./dist/
|
|
52
|
+
"web_client_hooks": "./dist/web_hook.js"
|
|
53
53
|
},
|
|
54
54
|
"apps": [
|
|
55
55
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { fetchAPI, text } from '@axium/client';
|
|
2
3
|
import { Icon } from '@axium/client/components';
|
|
3
|
-
import { fetchAPI } from '@axium/client/requests';
|
|
4
4
|
import { Note } from '@axium/notes/components';
|
|
5
5
|
|
|
6
6
|
const { data } = $props();
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
11
|
<svelte:head>
|
|
12
|
-
<title>
|
|
12
|
+
<title>{text('app_name.notes')}</title>
|
|
13
13
|
</svelte:head>
|
|
14
14
|
|
|
15
15
|
<div id="notes-main">
|
|
16
|
-
<h1>
|
|
16
|
+
<h1>{text('app_name.notes')}</h1>
|
|
17
17
|
<button
|
|
18
18
|
id="create-note"
|
|
19
19
|
class="icon-text mobile-float-right"
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
notes.push(result);
|
|
23
23
|
}}
|
|
24
24
|
>
|
|
25
|
-
<Icon i="plus" />
|
|
25
|
+
<Icon i="plus" />
|
|
26
|
+
<span>{text('notes.new')}</span>
|
|
26
27
|
</button>
|
|
27
28
|
<div class="lists-container">
|
|
28
29
|
{#each notes as note}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { text } from '@axium/client';
|
|
2
3
|
import { Icon } from '@axium/client/components';
|
|
3
4
|
import { Note } from '@axium/notes/components';
|
|
4
5
|
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
</script>
|
|
15
16
|
|
|
16
17
|
<svelte:head>
|
|
17
|
-
<title>
|
|
18
|
+
<title>{text('notes.note_title', { title: data.note.title })}</title>
|
|
18
19
|
</svelte:head>
|
|
19
20
|
|
|
20
21
|
<div class="note-container">
|
|
@@ -27,7 +28,8 @@
|
|
|
27
28
|
close();
|
|
28
29
|
}}
|
|
29
30
|
>
|
|
30
|
-
<Icon i="arrow-left-from-bracket" />
|
|
31
|
+
<Icon i="arrow-left-from-bracket" />
|
|
32
|
+
<span>{text('notes.back_to_main')}</span>
|
|
31
33
|
</button>
|
|
32
34
|
</div>
|
|
33
35
|
{/if}
|