@axium/notes 0.1.4 → 0.1.6

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.
Files changed (2) hide show
  1. package/lib/Note.svelte +7 -11
  2. package/package.json +2 -2
package/lib/Note.svelte CHANGED
@@ -5,6 +5,7 @@
5
5
  import type { Note } from '@axium/notes/common';
6
6
  import { page } from '$app/state';
7
7
  import { copy } from '@axium/client/clipboard';
8
+ import { download } from 'utilium/dom.js';
8
9
 
9
10
  let { note = $bindable(), notes = $bindable() }: { note: Note; notes?: Note[] } = $props();
10
11
  </script>
@@ -24,24 +25,19 @@
24
25
  <Popover>
25
26
  <div
26
27
  class="menu-item"
27
- onclick={e => {
28
- e.stopPropagation();
28
+ onclick={() =>
29
29
  fetchAPI('DELETE', 'notes/:id', {}, note.id).then(() => {
30
30
  if (!notes) goto('/notes');
31
31
  else notes.splice(notes.indexOf(note), 1);
32
- });
33
- }}
32
+ })}
34
33
  >
35
34
  <Icon i="trash" /> Delete
36
35
  </div>
36
+ <div class="menu-item" onclick={() => download(note.title + '.txt', note.content ?? '')}>
37
+ <Icon i="file-arrow-down" /> Download
38
+ </div>
37
39
  {#if notes}
38
- <div
39
- class="menu-item"
40
- onclick={e => {
41
- e.currentTarget.parentElement?.togglePopover();
42
- open(`/notes/${note.id}`);
43
- }}
44
- >
40
+ <div class="menu-item" onclick={() => open(`/notes/${note.id}`)}>
45
41
  <Icon i="arrow-up-right-from-square" /> Open in New Tab
46
42
  </div>
47
43
  {/if}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/notes",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "author": "James Prevett <axium@jamespre.dev> (https://jamespre.dev)",
5
5
  "description": "Notes for Axium",
6
6
  "funding": {
@@ -39,7 +39,7 @@
39
39
  "@axium/core": ">=0.6.0",
40
40
  "@axium/server": ">=0.22.0",
41
41
  "@sveltejs/kit": "^2.27.3",
42
- "utilium": "^2.3.8"
42
+ "utilium": "^2.4.0"
43
43
  },
44
44
  "dependencies": {
45
45
  "zod": "^4.0.5"