@axium/tasks 0.1.0 → 0.1.2

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
@@ -2,12 +2,12 @@ import type { Permission } from '@axium/core';
2
2
  import type { WithRequired } from 'utilium';
3
3
  import * as z from 'zod';
4
4
  export declare const TaskInit: z.ZodObject<{
5
- summary: z.ZodDefault<z.ZodString>;
6
- description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
5
+ summary: 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
- summary: z.string().max(100).default(''),
4
- description: z.string().max(500).optional().nullable(),
3
+ summary: z.string().max(100).optional(),
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
  });
package/dist/server.js CHANGED
@@ -74,7 +74,7 @@ addRoute({
74
74
  await checkAuthForItem(event, 'task_lists', listId, Permission.Edit);
75
75
  return await database
76
76
  .insertInto('tasks')
77
- .values({ ...init, listId })
77
+ .values({ summary: '', ...init, listId })
78
78
  .returningAll()
79
79
  .executeTakeFirstOrThrow()
80
80
  .catch(withError('Could not update task list'));
@@ -13,7 +13,7 @@
13
13
 
14
14
  {#snippet task_tree(root: Task)}
15
15
  <div class="task">
16
- <label for="task-completed#{root.id}">
16
+ <label for="task-completed#{root.id}" style:cursor="pointer">
17
17
  <Icon i="regular/circle{root.completed ? '-check' : ''}" --size="20px" />
18
18
  </label>
19
19
  <input
@@ -99,13 +99,13 @@
99
99
  {#each tasks.filter(task => !task.parentId && !task.completed) as task}
100
100
  {@render task_tree(task)}
101
101
  {:else}
102
- <i>No pending tasks.</i>
102
+ <i class="subtle">No pending tasks.</i>
103
103
  {/each}
104
104
  <h4>Completed</h4>
105
105
  {#each tasks.filter(task => !task.parentId && task.completed) as task}
106
106
  {@render task_tree(task)}
107
107
  {:else}
108
- <i>No completed tasks.</i>
108
+ <i class="subtle">No completed tasks.</i>
109
109
  {/each}
110
110
  </div>
111
111
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/tasks",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
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';
@@ -4,6 +4,8 @@ import type { Session } from '@axium/core';
4
4
  import { parseList } from '@axium/tasks/client';
5
5
  import type { LoadEvent } from '@sveltejs/kit';
6
6
 
7
+ export const ssr = false;
8
+
7
9
  export async function load({ parent }: LoadEvent) {
8
10
  let { session }: { session?: Session } = await parent();
9
11
 
@@ -2,6 +2,8 @@ import { fetchAPI } from '@axium/client/requests';
2
2
  import type { LoadEvent } from '@sveltejs/kit';
3
3
  import { parseList } from '@axium/tasks/client';
4
4
 
5
+ export const ssr = false;
6
+
5
7
  export async function load({ params }: LoadEvent) {
6
8
  const list = await fetchAPI('GET', 'task_lists/:id', {}, params.id!);
7
9