@axium/calendar 0.4.2 → 0.4.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.
- package/dist/common.d.ts +0 -6
- package/lib/Event.svelte +1 -1
- package/locales/en.json +4 -1
- package/package.json +3 -3
- package/routes/calendar/+page.svelte +11 -9
package/dist/common.d.ts
CHANGED
|
@@ -137,7 +137,6 @@ export declare const Calendar: z.ZodObject<{
|
|
|
137
137
|
name: z.ZodString;
|
|
138
138
|
email: z.ZodOptional<z.ZodEmail>;
|
|
139
139
|
emailVerified: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>>;
|
|
140
|
-
image: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
141
140
|
preferences: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
142
141
|
debug: z.ZodDefault<z.ZodBoolean>;
|
|
143
142
|
}, z.core.$strip>>>;
|
|
@@ -179,7 +178,6 @@ declare const CalendarAPI: {
|
|
|
179
178
|
name: z.ZodString;
|
|
180
179
|
email: z.ZodOptional<z.ZodEmail>;
|
|
181
180
|
emailVerified: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>>;
|
|
182
|
-
image: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
183
181
|
preferences: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
184
182
|
debug: z.ZodDefault<z.ZodBoolean>;
|
|
185
183
|
}, z.core.$strip>>>;
|
|
@@ -208,7 +206,6 @@ declare const CalendarAPI: {
|
|
|
208
206
|
name: z.ZodString;
|
|
209
207
|
email: z.ZodOptional<z.ZodEmail>;
|
|
210
208
|
emailVerified: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>>;
|
|
211
|
-
image: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
212
209
|
preferences: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
213
210
|
debug: z.ZodDefault<z.ZodBoolean>;
|
|
214
211
|
}, z.core.$strip>>>;
|
|
@@ -239,7 +236,6 @@ declare const CalendarAPI: {
|
|
|
239
236
|
name: z.ZodString;
|
|
240
237
|
email: z.ZodOptional<z.ZodEmail>;
|
|
241
238
|
emailVerified: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>>;
|
|
242
|
-
image: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
243
239
|
preferences: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
244
240
|
debug: z.ZodDefault<z.ZodBoolean>;
|
|
245
241
|
}, z.core.$strip>>>;
|
|
@@ -271,7 +267,6 @@ declare const CalendarAPI: {
|
|
|
271
267
|
name: z.ZodString;
|
|
272
268
|
email: z.ZodOptional<z.ZodEmail>;
|
|
273
269
|
emailVerified: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>>;
|
|
274
|
-
image: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
275
270
|
preferences: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
276
271
|
debug: z.ZodDefault<z.ZodBoolean>;
|
|
277
272
|
}, z.core.$strip>>>;
|
|
@@ -300,7 +295,6 @@ declare const CalendarAPI: {
|
|
|
300
295
|
name: z.ZodString;
|
|
301
296
|
email: z.ZodOptional<z.ZodEmail>;
|
|
302
297
|
emailVerified: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>>;
|
|
303
|
-
image: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
304
298
|
preferences: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
305
299
|
debug: z.ZodDefault<z.ZodBoolean>;
|
|
306
300
|
}, z.core.$strip>>>;
|
package/lib/Event.svelte
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { Icon, Popover } from '@axium/client/components';
|
|
8
8
|
import { colorHashHex, decodeColor, encodeColor } from '@axium/core/color';
|
|
9
9
|
import { rrulestr } from 'rrule';
|
|
10
|
-
import { download } from 'utilium/dom
|
|
10
|
+
import { download } from 'utilium/dom';
|
|
11
11
|
|
|
12
12
|
let {
|
|
13
13
|
event,
|
package/locales/en.json
CHANGED
|
@@ -35,6 +35,9 @@
|
|
|
35
35
|
"yearly": "Every year on {date}"
|
|
36
36
|
},
|
|
37
37
|
"submit_edit": "Update",
|
|
38
|
-
"title_placeholder": "Add title"
|
|
38
|
+
"title_placeholder": "Add title",
|
|
39
|
+
"discovery_placeholder": "Add attendees",
|
|
40
|
+
"discovery_invalid": "Can't determine attendee \"{target}\"",
|
|
41
|
+
"discovery_unsupported": "Specifying attendees without an email is not supported yet"
|
|
39
42
|
}
|
|
40
43
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axium/calendar",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"author": "James Prevett <axium@jamespre.dev>",
|
|
5
5
|
"description": "Calendar for Axium",
|
|
6
6
|
"funding": {
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"build": "tsc"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@axium/client": ">=0.
|
|
39
|
+
"@axium/client": ">=0.23.0",
|
|
40
40
|
"@axium/core": ">=0.23.0",
|
|
41
41
|
"@axium/server": ">=0.36.0",
|
|
42
42
|
"@sveltejs/kit": "^2.27.3",
|
|
43
|
-
"utilium": "^
|
|
43
|
+
"utilium": "^3.0.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"rrule": "^2.8.1",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
import * as Cal from '@axium/calendar/components';
|
|
17
17
|
import { fetchAPI, text } from '@axium/client';
|
|
18
18
|
import { contextMenu, dynamicRows } from '@axium/client/attachments';
|
|
19
|
-
import { AccessControlDialog, ColorPicker, FormDialog, Icon, Popover
|
|
19
|
+
import { AccessControlDialog, ColorPicker, Discovery, discovery, FormDialog, Icon, Popover } from '@axium/client/components';
|
|
20
|
+
import { toast } from '@axium/client/toast';
|
|
20
21
|
import { colorHashHex, encodeColor } from '@axium/core/color';
|
|
21
22
|
import { rrulestr } from 'rrule';
|
|
22
23
|
import { useSwipe } from 'svelte-gestures';
|
|
@@ -370,17 +371,18 @@
|
|
|
370
371
|
<div class="attendees-container">
|
|
371
372
|
<label for="eventInit.attendee"><Icon i="user-group" /></label>
|
|
372
373
|
<div class="attendees">
|
|
373
|
-
<
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
if (!email) throw 'Specifying attendees without an email is not supported yet';
|
|
374
|
+
<Discovery
|
|
375
|
+
onSelect={result => {
|
|
376
|
+
const { id: userId, email } =
|
|
377
|
+
result.type == 'user' ? result.user : { id: null, email: z.email().safeParse(result.target).data };
|
|
378
|
+
if (!userId && !email) return toast('error', text('event_init.discovery_invalid', result));
|
|
379
|
+
if (!email) return toast('info', text('event_init.discovery_unsupported'));
|
|
380
|
+
|
|
381
381
|
// @todo supports roles and also contacts
|
|
382
382
|
eventInit.attendees.push({ userId, email });
|
|
383
383
|
}}
|
|
384
|
+
sources={[discovery.user, discovery.exact]}
|
|
385
|
+
placeholder={text('event_init.discovery_placeholder')}
|
|
384
386
|
/>
|
|
385
387
|
{#each eventInit.attendees as attendee (attendee.email)}
|
|
386
388
|
<div class="attendee">{attendee.email}</div>
|