@axium/tasks 0.4.8 → 0.4.9

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.
@@ -0,0 +1,8 @@
1
+ import en from '../locales/en.json';
2
+ import './common.js';
3
+ type en = typeof en;
4
+ declare module '@axium/client/locales' {
5
+ interface Locale extends en {
6
+ }
7
+ }
8
+ export {};
@@ -0,0 +1,4 @@
1
+ import { extendLocale } from '@axium/client';
2
+ import en from '../locales/en.json' with { type: 'json' };
3
+ import './common.js';
4
+ extendLocale('en', en);
@@ -3,7 +3,7 @@
3
3
  import { page } from '$app/state';
4
4
  import { copy } from '@axium/client/gui';
5
5
  import { AccessControlDialog, Icon, Popover } from '@axium/client/components';
6
- import { fetchAPI } from '@axium/client/requests';
6
+ import { fetchAPI, text } from '@axium/client';
7
7
  import type { Task, TaskList } from '@axium/tasks/common';
8
8
  import type { WithRequired } from 'utilium';
9
9
  import { download } from 'utilium/dom.js';
@@ -60,11 +60,13 @@
60
60
  tasks.splice(tasks.indexOf(task), 1);
61
61
  })}
62
62
  >
63
- <Icon i="trash" /> Delete
63
+ <Icon i="trash" />
64
+ <span>{text('generic.delete')}</span>
64
65
  </div>
65
66
  {#if page.data.session?.user.preferences.debug}
66
67
  <div class="menu-item" onclick={() => copy('text/plain', task.id)}>
67
- <Icon i="hashtag" --size="14px" /> Copy ID
68
+ <Icon i="hashtag" --size="14px" />
69
+ <span>{text('tasks.copy_id')}</span>
68
70
  </div>
69
71
  {/if}
70
72
  </Popover>
@@ -95,7 +97,8 @@
95
97
  else lists.splice(lists.indexOf(list), 1);
96
98
  })}
97
99
  >
98
- <Icon i="trash" /> Delete
100
+ <Icon i="trash" />
101
+ <span>{text('generic.delete')}</span>
99
102
  </div>
100
103
  <div
101
104
  class="menu-item"
@@ -108,7 +111,8 @@
108
111
  .join('\n')
109
112
  )}
110
113
  >
111
- <Icon i="regular/file-export" /> Export
114
+ <Icon i="regular/file-export" />
115
+ <span>{text('tasks.export_list')}</span>
112
116
  </div>
113
117
  <div
114
118
  class="menu-item"
@@ -117,7 +121,8 @@
117
121
  acl!.click();
118
122
  }}
119
123
  >
120
- <Icon i="user-group" /> Share
124
+ <Icon i="user-group" />
125
+ <span>{text('tasks.share_list')}</span>
121
126
  </div>
122
127
  {#if tasks.some(t => !t.completed)}
123
128
  <div
@@ -127,7 +132,8 @@
127
132
  fetchAPI('POST', 'task_lists/:id', { all_completed: true }, list.id);
128
133
  }}
129
134
  >
130
- <Icon i="regular/circle-check" /> Complete All
135
+ <Icon i="regular/circle-check" />
136
+ <span>{text('tasks.mark_all_complete')}</span>
131
137
  </div>
132
138
  {/if}
133
139
  {#if tasks.some(t => t.completed)}
@@ -138,20 +144,24 @@
138
144
  fetchAPI('POST', 'task_lists/:id', { all_completed: false }, list.id);
139
145
  }}
140
146
  >
141
- <Icon i="regular/circle" /> Un-complete All
147
+ <Icon i="regular/circle" />
148
+ <span>{text('tasks.mark_all_pending')}</span>
142
149
  </div>
143
150
  {/if}
144
151
  <div class="menu-item" onclick={() => copy('text/plain', `${location.origin}/tasks/${list.id}`)}>
145
- <Icon i="link-horizontal" /> Copy Link
152
+ <Icon i="link-horizontal" />
153
+ <span>{text('tasks.copy_link')}</span>
146
154
  </div>
147
155
  {#if lists}
148
156
  <div class="menu-item" onclick={() => open(`/tasks/${list.id}`)}>
149
- <Icon i="arrow-up-right-from-square" /> Open in New Tab
157
+ <Icon i="arrow-up-right-from-square" />
158
+ <span>{text('tasks.open_new_tab')}</span>
150
159
  </div>
151
160
  {/if}
152
161
  {#if page.data.session?.user.preferences.debug}
153
162
  <div class="menu-item" onclick={() => copy('text/plain', list.id)}>
154
- <Icon i="hashtag" --size="14px" /> Copy ID
163
+ <Icon i="hashtag" --size="14px" />
164
+ <span>{text('tasks.copy_id')}</span>
155
165
  </div>
156
166
  {/if}
157
167
  </Popover>
@@ -165,20 +175,21 @@
165
175
  .then(t => t)
166
176
  .then(tasks.push.bind(tasks))}
167
177
  >
168
- <Icon i="regular/circle-plus" /> Add Task
178
+ <Icon i="regular/circle-plus" />
179
+ <span>{text('tasks.new_task')}</span>
169
180
  </button>
170
181
  </div>
171
- <h4>Pending</h4>
182
+ <h4>{text('tasks.pending_heading')}</h4>
172
183
  {#each tasks.filter(task => !task.parentId && !task.completed) as task (task.id)}
173
184
  {@render task_tree(task)}
174
185
  {:else}
175
- <i class="subtle">No pending tasks.</i>
186
+ <i class="subtle">{text('tasks.pending_empty')}</i>
176
187
  {/each}
177
- <h4>Completed</h4>
188
+ <h4>{text('tasks.completed_heading')}</h4>
178
189
  {#each tasks.filter(task => !task.parentId && task.completed) as task (task.id)}
179
190
  {@render task_tree(task)}
180
191
  {:else}
181
- <i class="subtle">No completed tasks.</i>
192
+ <i class="subtle">{text('tasks.completed_empty')}</i>
182
193
  {/each}
183
194
  </div>
184
195
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/tasks",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "author": "James Prevett <axium@jamespre.dev>",
5
5
  "description": "Tasks 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/common.js"
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
2
  import { FormDialog, Icon } from '@axium/client/components';
3
- import { fetchAPI } from '@axium/client/requests';
3
+ import { fetchAPI, text } from '@axium/client';
4
4
  import { TaskListInit } from '@axium/tasks/common';
5
5
  import { TaskList } from '@axium/tasks/components';
6
6
 
@@ -11,14 +11,15 @@
11
11
  </script>
12
12
 
13
13
  <svelte:head>
14
- <title>Tasks</title>
14
+ <title>{text('app_name.tasks')}</title>
15
15
  </svelte:head>
16
16
 
17
17
  <div id="tasks-main">
18
- <h1>Tasks</h1>
18
+ <h1>{text('app_name.tasks')}</h1>
19
19
 
20
20
  <button id="create-task-list" class="icon-text mobile-float-right" onclick={() => dialog!.showModal()}>
21
- <Icon i="plus" /> New List
21
+ <Icon i="plus" />
22
+ <span>{text('tasks.new_list')}</span>
22
23
  </button>
23
24
 
24
25
  <div class="lists-container">
@@ -30,7 +31,7 @@
30
31
 
31
32
  <FormDialog
32
33
  bind:dialog
33
- submitText="Create List"
34
+ submitText={text('tasks.list_init.submit')}
34
35
  submit={async rawInit => {
35
36
  const init = TaskListInit.parse(rawInit);
36
37
  const result = await fetchAPI('PUT', 'users/:id/task_lists', init, data.session!.userId);
@@ -38,11 +39,11 @@
38
39
  }}
39
40
  >
40
41
  <div>
41
- <label for="name">Name</label>
42
+ <label for="name">{text('tasks.list_init.name')}</label>
42
43
  <input name="name" type="text" required />
43
44
  </div>
44
45
  <div>
45
- <label for="description">Description <span class="subtle">(optional)</span></label>
46
+ <label for="description">{@html text('tasks.list_init.description', { $html: true })}</label>
46
47
  <input name="description" type="text" />
47
48
  </div>
48
49
  </FormDialog>
@@ -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 { TaskList } from '@axium/tasks/components';
4
5
 
@@ -14,7 +15,7 @@
14
15
  </script>
15
16
 
16
17
  <svelte:head>
17
- <title>Tasks {data.list.name}</title>
18
+ <title>{text('tasks.list_page_title', { name: data.list.name })}</title>
18
19
  </svelte:head>
19
20
 
20
21
  <div class="list-container">
@@ -27,7 +28,8 @@
27
28
  close();
28
29
  }}
29
30
  >
30
- <Icon i="arrow-left-from-bracket" /> Back to Tasks
31
+ <Icon i="arrow-left-from-bracket" />
32
+ <span>{text('tasks.back_to_main')}</span>
31
33
  </button>
32
34
  </div>
33
35
  {/if}