@axium/tasks 0.1.1 → 0.1.3

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 CHANGED
@@ -3,11 +3,11 @@ import type { WithRequired } from 'utilium';
3
3
  import * as z from 'zod';
4
4
  export declare const TaskInit: z.ZodObject<{
5
5
  summary: z.ZodOptional<z.ZodString>;
6
- description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
6
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7
7
  listId: z.ZodUUID;
8
- parentId: z.ZodNullable<z.ZodOptional<z.ZodUUID>>;
8
+ parentId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
9
9
  completed: z.ZodOptional<z.ZodBoolean>;
10
- due: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
10
+ due: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
11
11
  }, z.core.$strip>;
12
12
  export type TaskInit = z.infer<typeof TaskInit>;
13
13
  export interface Task extends TaskInit {
@@ -16,7 +16,7 @@ export interface Task extends TaskInit {
16
16
  }
17
17
  export declare const TaskListInit: z.ZodObject<{
18
18
  name: z.ZodString;
19
- description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
19
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
20
  }, z.core.$strip>;
21
21
  export type TaskListInit = z.infer<typeof TaskListInit>;
22
22
  export interface TaskList extends TaskListInit {
package/dist/common.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import * as z from 'zod';
2
2
  export const TaskInit = z.object({
3
3
  summary: z.string().max(100).optional(),
4
- description: z.string().max(500).optional().nullable(),
4
+ description: z.string().max(500).nullish(),
5
5
  listId: z.uuid(),
6
- parentId: z.uuid().optional().nullable(),
6
+ parentId: z.uuid().nullish(),
7
7
  completed: z.boolean().optional(),
8
- due: z.date().optional().nullable(),
8
+ due: z.date().nullish(),
9
9
  });
10
10
  export const TaskListInit = z.object({
11
11
  name: z.string().min(1).max(50),
12
- description: z.string().max(500).optional().nullable(),
12
+ description: z.string().max(500).nullish(),
13
13
  });
@@ -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.1",
3
+ "version": "0.1.3",
4
4
  "author": "James Prevett <axium@jamespre.dev> (https://jamespre.dev)",
5
5
  "description": "",
6
6
  "funding": {
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { fetchAPI } from '@axium/client/requests';
3
- import { Dialog, FormDialog, Icon } from '@axium/server/components';
3
+ import { FormDialog, Icon } from '@axium/server/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/server/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>