@axium/tasks 0.1.2 → 0.1.4

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.
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { goto } from '$app/navigation';
3
3
  import { fetchAPI } from '@axium/client/requests';
4
- import { Icon, Popover } from '@axium/server/components';
4
+ import { Icon, Popover } from '@axium/client/components';
5
5
  import type { Task, TaskList } from '@axium/tasks/common';
6
6
  import type { WithRequired } from 'utilium';
7
7
 
@@ -80,6 +80,17 @@
80
80
  >
81
81
  <Icon i="trash" /> Delete
82
82
  </div>
83
+ {#if lists}
84
+ <div
85
+ class="menu-item"
86
+ onclick={e => {
87
+ e.currentTarget.parentElement?.togglePopover();
88
+ open(`/tasks/${list.id}`);
89
+ }}
90
+ >
91
+ <Icon i="arrow-up-right-from-square" /> Open in New Tab
92
+ </div>
93
+ {/if}
83
94
  </Popover>
84
95
  </div>
85
96
  <div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/tasks",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "author": "James Prevett <axium@jamespre.dev> (https://jamespre.dev)",
5
5
  "description": "",
6
6
  "funding": {
@@ -35,7 +35,7 @@
35
35
  "build": "tsc"
36
36
  },
37
37
  "peerDependencies": {
38
- "@axium/client": ">=0.1.0",
38
+ "@axium/client": ">=0.2.0",
39
39
  "@axium/core": ">=0.5.4",
40
40
  "@axium/server": ">=0.22.0",
41
41
  "@sveltejs/kit": "^2.27.3",
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { fetchAPI } from '@axium/client/requests';
3
- import { FormDialog, Icon } from '@axium/server/components';
3
+ import { FormDialog, Icon } from '@axium/client/components';
4
4
  import { parseList } from '@axium/tasks/client';
5
5
  import { TaskListInit } from '@axium/tasks/common';
6
6
  import { TaskList } from '@axium/tasks/components';
@@ -1,11 +1,50 @@
1
1
  <script lang="ts">
2
+ import { Icon } from '@axium/client/components';
2
3
  import { TaskList } from '@axium/tasks/components';
3
4
 
4
5
  const { data } = $props();
6
+
7
+ let opener = $state.raw<Window | null>(window.opener);
8
+
9
+ opener?.addEventListener('beforeunload', () => (opener = null));
10
+ opener?.addEventListener('load', () => (opener = null));
11
+ opener?.addEventListener('popstate', () => {
12
+ opener = opener?.location.pathname == '/tasks' ? window.opener : null;
13
+ });
5
14
  </script>
6
15
 
7
16
  <svelte:head>
8
17
  <title>Tasks — {data.list.name}</title>
9
18
  </svelte:head>
10
19
 
11
- <TaskList list={data.list} />
20
+ <div class="list-container">
21
+ {#if opener}
22
+ <div>
23
+ <button
24
+ class="icon-text"
25
+ onclick={() => {
26
+ opener?.focus();
27
+ close();
28
+ }}
29
+ >
30
+ <Icon i="arrow-left-from-bracket" /> Back to Tasks
31
+ </button>
32
+ </div>
33
+ {/if}
34
+
35
+ <TaskList list={data.list} />
36
+ </div>
37
+
38
+ <style>
39
+ .list-container {
40
+ display: flex;
41
+ flex-direction: column;
42
+ gap: 1em;
43
+ padding: 1em;
44
+ inset: 1em;
45
+ }
46
+
47
+ :global(.task-list-header [popover]) {
48
+ right: 1em;
49
+ }
50
+ </style>