@atmo-dev/kit 0.10.0 → 0.11.0
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/events/EventAttendees.svelte +46 -3
- package/dist/events/EventAttendees.svelte.d.ts +3 -1
- package/dist/events/EventCard.svelte +5 -2
- package/dist/events/EventCard.svelte.d.ts +2 -0
- package/dist/events/EventEditor.svelte +54 -43
- package/dist/events/EventView.svelte +20 -4
- package/dist/events/EventView.svelte.d.ts +7 -0
- package/dist/events/contrail.d.ts +11 -0
- package/dist/events/editor/adapter.d.ts +11 -0
- package/dist/events/editor/save.d.ts +2 -1
- package/dist/events/editor/save.js +9 -6
- package/dist/events-data.d.ts +1 -1
- package/dist/events.d.ts +1 -0
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<script lang="ts">
|
|
9
9
|
import type { Snippet } from 'svelte';
|
|
10
|
-
import type { AttendeeInfo } from './contrail.js';
|
|
10
|
+
import type { AttendeeInfo, AttendeeListLoader } from './contrail.js';
|
|
11
11
|
import { Avatar } from '../index.js';
|
|
12
12
|
import { scale } from 'svelte/transition';
|
|
13
13
|
import { flip } from 'svelte/animate';
|
|
@@ -18,13 +18,16 @@
|
|
|
18
18
|
interested = [],
|
|
19
19
|
goingCount: initialGoingCount = going.length,
|
|
20
20
|
interestedCount: initialInterestedCount = interested.length,
|
|
21
|
-
footer
|
|
21
|
+
footer,
|
|
22
|
+
loadAll
|
|
22
23
|
}: {
|
|
23
24
|
going?: AttendeeInfo[];
|
|
24
25
|
interested?: AttendeeInfo[];
|
|
25
26
|
goingCount?: number;
|
|
26
27
|
interestedCount?: number;
|
|
27
28
|
footer?: Snippet<[AttendeeCounts]>;
|
|
29
|
+
/** Fetches everyone when a list opens and the counts exceed `going`/`interested`. */
|
|
30
|
+
loadAll?: AttendeeListLoader;
|
|
28
31
|
} = $props();
|
|
29
32
|
|
|
30
33
|
let goingCountOverride: number | null = $state(null);
|
|
@@ -51,11 +54,42 @@
|
|
|
51
54
|
let interestedOverflow = $derived(interestedCount - interestedDisplay.length);
|
|
52
55
|
|
|
53
56
|
let modalAttendees = $derived(modalGroup === 'going' ? goingAttendees : interestedAttendees);
|
|
57
|
+
let modalCount = $derived(modalGroup === 'going' ? goingCount : interestedCount);
|
|
54
58
|
let modalTitle = $derived(modalGroup === 'going' ? 'Going' : 'Interested');
|
|
55
59
|
|
|
60
|
+
// The sample passed in may be shorter than the counts. Fetch the rest once,
|
|
61
|
+
// on first open; a failed attempt retries on the next open.
|
|
62
|
+
let hasMore = $derived(
|
|
63
|
+
goingCount > goingAttendees.length || interestedCount > interestedAttendees.length
|
|
64
|
+
);
|
|
65
|
+
let loadingAll = $state(false);
|
|
66
|
+
let loadedAll = $state(false);
|
|
67
|
+
|
|
68
|
+
async function loadEveryone() {
|
|
69
|
+
if (!loadAll || loadedAll || loadingAll || !hasMore) return;
|
|
70
|
+
loadingAll = true;
|
|
71
|
+
try {
|
|
72
|
+
const full = await loadAll();
|
|
73
|
+
goingAttendeesOverride = full.going;
|
|
74
|
+
interestedAttendeesOverride = full.interested;
|
|
75
|
+
goingCountOverride = Math.max(goingCount, full.goingCount ?? 0, full.going.length);
|
|
76
|
+
interestedCountOverride = Math.max(
|
|
77
|
+
interestedCount,
|
|
78
|
+
full.interestedCount ?? 0,
|
|
79
|
+
full.interested.length
|
|
80
|
+
);
|
|
81
|
+
loadedAll = true;
|
|
82
|
+
} catch {
|
|
83
|
+
// Keep the sample; the next open tries again.
|
|
84
|
+
} finally {
|
|
85
|
+
loadingAll = false;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
56
89
|
function openModal(group: 'going' | 'interested') {
|
|
57
90
|
modalGroup = group;
|
|
58
91
|
modalOpen = true;
|
|
92
|
+
void loadEveryone();
|
|
59
93
|
}
|
|
60
94
|
|
|
61
95
|
export function addAttendee(attendee: AttendeeInfo) {
|
|
@@ -177,7 +211,7 @@
|
|
|
177
211
|
</div>
|
|
178
212
|
{/if}
|
|
179
213
|
|
|
180
|
-
<Modal bind:open={modalOpen} title={`${modalTitle} (${
|
|
214
|
+
<Modal bind:open={modalOpen} title={`${modalTitle} (${modalCount})`}>
|
|
181
215
|
<div
|
|
182
216
|
class="mx-4 mb-4 max-h-80 space-y-1 overflow-y-auto rounded-xl bg-base-200/30 p-2 dark:bg-base-900/50"
|
|
183
217
|
>
|
|
@@ -201,5 +235,14 @@
|
|
|
201
235
|
</div>
|
|
202
236
|
</a>
|
|
203
237
|
{/each}
|
|
238
|
+
{#if loadingAll}
|
|
239
|
+
<p
|
|
240
|
+
class="px-2 py-2 text-xs text-base-600 dark:text-base-400"
|
|
241
|
+
role="status"
|
|
242
|
+
aria-live="polite"
|
|
243
|
+
>
|
|
244
|
+
Loading…
|
|
245
|
+
</p>
|
|
246
|
+
{/if}
|
|
204
247
|
</div>
|
|
205
248
|
</Modal>
|
|
@@ -3,13 +3,15 @@ export interface AttendeeCounts {
|
|
|
3
3
|
interestedCount: number;
|
|
4
4
|
}
|
|
5
5
|
import type { Snippet } from 'svelte';
|
|
6
|
-
import type { AttendeeInfo } from './contrail.js';
|
|
6
|
+
import type { AttendeeInfo, AttendeeListLoader } from './contrail.js';
|
|
7
7
|
type $$ComponentProps = {
|
|
8
8
|
going?: AttendeeInfo[];
|
|
9
9
|
interested?: AttendeeInfo[];
|
|
10
10
|
goingCount?: number;
|
|
11
11
|
interestedCount?: number;
|
|
12
12
|
footer?: Snippet<[AttendeeCounts]>;
|
|
13
|
+
/** Fetches everyone when a list opens and the counts exceed `going`/`interested`. */
|
|
14
|
+
loadAll?: AttendeeListLoader;
|
|
13
15
|
};
|
|
14
16
|
declare const EventAttendees: import("svelte").Component<$$ComponentProps, {
|
|
15
17
|
addAttendee: (attendee: AttendeeInfo) => void;
|
|
@@ -9,10 +9,13 @@
|
|
|
9
9
|
|
|
10
10
|
let {
|
|
11
11
|
event,
|
|
12
|
-
actor
|
|
12
|
+
actor,
|
|
13
|
+
href
|
|
13
14
|
}: {
|
|
14
15
|
event: FlatEventRecord;
|
|
15
16
|
actor?: string;
|
|
17
|
+
/** Where the card links, for an event whose page is not its creator's. */
|
|
18
|
+
href?: string;
|
|
16
19
|
} = $props();
|
|
17
20
|
|
|
18
21
|
function formatDateTime(dateStr: string): string {
|
|
@@ -85,7 +88,7 @@
|
|
|
85
88
|
</script>
|
|
86
89
|
|
|
87
90
|
<a
|
|
88
|
-
href={eventUrl(event, actor)}
|
|
91
|
+
href={href ?? eventUrl(event, actor)}
|
|
89
92
|
class="group grid grid-cols-[5rem_minmax(0,1fr)] gap-3 rounded-ui outline-offset-4 transition-colors focus-visible:outline-2 focus-visible:outline-accent-700 sm:grid-cols-[6rem_minmax(0,1fr)] sm:gap-3.5 dark:focus-visible:outline-accent-300"
|
|
90
93
|
>
|
|
91
94
|
<div class="w-full">
|
|
@@ -2,6 +2,8 @@ import { type FlatEventRecord } from './contrail.js';
|
|
|
2
2
|
type $$ComponentProps = {
|
|
3
3
|
event: FlatEventRecord;
|
|
4
4
|
actor?: string;
|
|
5
|
+
/** Where the card links, for an event whose page is not its creator's. */
|
|
6
|
+
href?: string;
|
|
5
7
|
};
|
|
6
8
|
declare const EventCard: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
9
|
type EventCard = ReturnType<typeof EventCard>;
|
|
@@ -94,6 +94,8 @@
|
|
|
94
94
|
let selectedPreset: string | null = $state(
|
|
95
95
|
initialThumbnailFile ? null : eventData === null ? DEFAULT_PRESET : null
|
|
96
96
|
);
|
|
97
|
+
let images = $derived(adapter.features.images !== false);
|
|
98
|
+
let showVisibility = $derived(adapter.features.visibility !== false);
|
|
97
99
|
let submitting = $state(false);
|
|
98
100
|
let error: string | null = $state(null);
|
|
99
101
|
let titleEditor = $state<Editor | null>(null);
|
|
@@ -132,7 +134,7 @@
|
|
|
132
134
|
}
|
|
133
135
|
|
|
134
136
|
function populateThumbnailFromEventData() {
|
|
135
|
-
if (!eventData) return;
|
|
137
|
+
if (!eventData || !images) return;
|
|
136
138
|
if (eventData.media && eventData.media.length > 0) {
|
|
137
139
|
const media = getEventThumbnail(eventData.media);
|
|
138
140
|
if (media?.content) {
|
|
@@ -212,7 +214,7 @@
|
|
|
212
214
|
|
|
213
215
|
try {
|
|
214
216
|
// Generate thumbnail from preset if selected and no custom upload
|
|
215
|
-
if (selectedPreset && !thumbnailFile) {
|
|
217
|
+
if (images && selectedPreset && !thumbnailFile) {
|
|
216
218
|
const rendered = await renderPresetThumbnail({
|
|
217
219
|
design: selectedPreset,
|
|
218
220
|
seed: hashSeed(rkey),
|
|
@@ -227,14 +229,18 @@
|
|
|
227
229
|
}
|
|
228
230
|
|
|
229
231
|
const existingMedia = (eventData?.media ?? []) as Array<Record<string, unknown>>;
|
|
230
|
-
const media =
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
232
|
+
const media = images
|
|
233
|
+
? await buildThumbnailMedia({
|
|
234
|
+
isNew,
|
|
235
|
+
thumbnailChanged,
|
|
236
|
+
thumbnailFile,
|
|
237
|
+
existingMedia,
|
|
238
|
+
uploadBlob: (blob) =>
|
|
239
|
+
adapter.uploadBlob(blob) as unknown as Promise<Record<string, unknown>>
|
|
240
|
+
})
|
|
241
|
+
: existingMedia.length > 0
|
|
242
|
+
? existingMedia
|
|
243
|
+
: undefined;
|
|
238
244
|
|
|
239
245
|
const record = await buildEventRecord({
|
|
240
246
|
eventData,
|
|
@@ -245,7 +251,7 @@
|
|
|
245
251
|
endsAt,
|
|
246
252
|
timezone,
|
|
247
253
|
mode,
|
|
248
|
-
visibility,
|
|
254
|
+
visibility: showVisibility ? visibility : null,
|
|
249
255
|
theme: eventTheme,
|
|
250
256
|
links,
|
|
251
257
|
location,
|
|
@@ -288,7 +294,8 @@
|
|
|
288
294
|
collection: 'community.lexicon.calendar.event',
|
|
289
295
|
rkey
|
|
290
296
|
});
|
|
291
|
-
const eventUri =
|
|
297
|
+
const eventUri =
|
|
298
|
+
eventData?.uri || `at://${viewer.did}/community.lexicon.calendar.event/${rkey}`;
|
|
292
299
|
await adapter.notifyUpdate?.(eventUri);
|
|
293
300
|
adapter.onDeleted?.();
|
|
294
301
|
} catch (e) {
|
|
@@ -326,16 +333,18 @@
|
|
|
326
333
|
<div
|
|
327
334
|
class="grid grid-cols-1 gap-8 md:grid-cols-[14rem_1fr] md:gap-x-10 md:gap-y-6 lg:grid-cols-[16rem_1fr]"
|
|
328
335
|
>
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
336
|
+
{#if images}
|
|
337
|
+
<ThumbnailSection
|
|
338
|
+
{rkey}
|
|
339
|
+
{name}
|
|
340
|
+
dateStr={thumbnailDateStr}
|
|
341
|
+
accent={eventTheme.accentColor}
|
|
342
|
+
bind:thumbnailFile
|
|
343
|
+
bind:thumbnailPreview
|
|
344
|
+
bind:thumbnailChanged
|
|
345
|
+
bind:selectedPreset
|
|
346
|
+
/>
|
|
347
|
+
{/if}
|
|
339
348
|
|
|
340
349
|
<!-- Right column: event details -->
|
|
341
350
|
<div class="order-2 min-w-0 md:order-0 md:col-start-2 md:row-span-5 md:row-start-1">
|
|
@@ -371,29 +380,31 @@
|
|
|
371
380
|
</div>
|
|
372
381
|
|
|
373
382
|
<!-- Visibility toggle -->
|
|
374
|
-
|
|
375
|
-
<
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
383
|
+
{#if showVisibility}
|
|
384
|
+
<div class="mb-8">
|
|
385
|
+
<ToggleGroup
|
|
386
|
+
type="single"
|
|
387
|
+
bind:value={
|
|
388
|
+
() => visibility,
|
|
389
|
+
(val) => {
|
|
390
|
+
if (val) visibility = val as Visibility;
|
|
391
|
+
}
|
|
381
392
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
class="w-fit"
|
|
394
|
+
size="xs"
|
|
395
|
+
>
|
|
396
|
+
<ToggleGroupItem value="public">Public</ToggleGroupItem>
|
|
397
|
+
<ToggleGroupItem value="unlisted">Unlisted</ToggleGroupItem>
|
|
398
|
+
</ToggleGroup>
|
|
399
|
+
<div class="mt-1.5 text-xs text-base-600 dark:text-base-400">
|
|
400
|
+
{#if visibility === 'public'}
|
|
401
|
+
Anyone can view and it appears in discovery.
|
|
402
|
+
{:else}
|
|
403
|
+
Public to anyone with the link, but hidden from discovery.
|
|
404
|
+
{/if}
|
|
405
|
+
</div>
|
|
395
406
|
</div>
|
|
396
|
-
|
|
407
|
+
{/if}
|
|
397
408
|
|
|
398
409
|
<!-- Date row -->
|
|
399
410
|
<div class="mb-5 grid min-w-0 gap-2">
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
eventUrl,
|
|
4
|
+
isEventOngoing,
|
|
5
|
+
type AttendeeListLoader,
|
|
6
|
+
type FlatEventRecord
|
|
7
|
+
} from './contrail.js';
|
|
3
8
|
import type { EventViewData } from './view-data.js';
|
|
4
9
|
import { getCDNImageBlobUrl } from './atproto-helpers.js';
|
|
5
10
|
import { getEventThumbnail, getEventExternalImage } from './event-media.js';
|
|
@@ -43,8 +48,10 @@
|
|
|
43
48
|
pageUrl,
|
|
44
49
|
embedMode = false,
|
|
45
50
|
shareUrlOverride,
|
|
51
|
+
share = true,
|
|
46
52
|
extraActions,
|
|
47
|
-
attendeeActions
|
|
53
|
+
attendeeActions,
|
|
54
|
+
loadAttendees
|
|
48
55
|
}: {
|
|
49
56
|
data: EventViewData;
|
|
50
57
|
adapter: EditorAdapter;
|
|
@@ -56,10 +63,16 @@
|
|
|
56
63
|
* of the canonical atmo.rsvp event URL. Useful for embedders that want
|
|
57
64
|
* share links to point at their own event page. */
|
|
58
65
|
shareUrlOverride?: string;
|
|
66
|
+
/** False for an event with no public page to share, such as a private one: no share pop-up
|
|
67
|
+
* after creating the event or answering Going. */
|
|
68
|
+
share?: boolean;
|
|
59
69
|
/** App-owned actions such as private reporting; omitted in embeds. */
|
|
60
70
|
extraActions?: Snippet;
|
|
61
71
|
/** App-owned actions below the attendee lists, with current RSVP counts. */
|
|
62
72
|
attendeeActions?: Snippet<[AttendeeCounts]>;
|
|
73
|
+
/** Fetches the complete attendee lists the first time one is opened, when
|
|
74
|
+
* `data.attendees` holds only a sample of the counted RSVPs. */
|
|
75
|
+
loadAttendees?: AttendeeListLoader;
|
|
63
76
|
} = $props();
|
|
64
77
|
|
|
65
78
|
let eventData: FlatEventRecord = $derived(data.eventData);
|
|
@@ -134,6 +147,7 @@
|
|
|
134
147
|
url.searchParams.delete('created');
|
|
135
148
|
history.replaceState({}, '', url.pathname);
|
|
136
149
|
launchConfetti();
|
|
150
|
+
if (!share) return;
|
|
137
151
|
shareModalTitle = 'Event created!';
|
|
138
152
|
shareModalText = `I'm hosting "${eventData.name}"!\n\n${shareUrl}`;
|
|
139
153
|
canSetEventComments = isHost;
|
|
@@ -191,7 +205,8 @@
|
|
|
191
205
|
return null;
|
|
192
206
|
});
|
|
193
207
|
|
|
194
|
-
|
|
208
|
+
// The record's own address, which isn't in its creator's repo for every event (one in a space).
|
|
209
|
+
let eventUri = $derived(eventData.uri || `at://${did}/community.lexicon.calendar.event/${rkey}`);
|
|
195
210
|
|
|
196
211
|
let ogImageUrl = $derived(data.ogImage ?? `${pageUrl.origin}${pageUrl.pathname}/og.png`);
|
|
197
212
|
|
|
@@ -234,7 +249,7 @@
|
|
|
234
249
|
handle: viewer.handle,
|
|
235
250
|
url: `/p/${encodeURIComponent(viewer.handle || viewer.did)}`
|
|
236
251
|
});
|
|
237
|
-
if (status === 'interested') return;
|
|
252
|
+
if (status === 'interested' || !share) return;
|
|
238
253
|
shareModalTitle = "You're going!";
|
|
239
254
|
shareModalText = `I'm going to "${eventData.name}".\n\n${shareUrl}`;
|
|
240
255
|
canSetEventComments = false;
|
|
@@ -467,6 +482,7 @@
|
|
|
467
482
|
goingCount={attendees.goingCount}
|
|
468
483
|
interestedCount={attendees.interestedCount}
|
|
469
484
|
footer={embedMode ? undefined : attendeeActions}
|
|
485
|
+
loadAll={loadAttendees}
|
|
470
486
|
/>
|
|
471
487
|
</div>
|
|
472
488
|
</div>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type AttendeeListLoader } from './contrail.js';
|
|
1
2
|
import type { EventViewData } from './view-data.js';
|
|
2
3
|
import { type AttendeeCounts } from './EventAttendees.svelte';
|
|
3
4
|
import { type Snippet } from 'svelte';
|
|
@@ -13,10 +14,16 @@ type $$ComponentProps = {
|
|
|
13
14
|
* of the canonical atmo.rsvp event URL. Useful for embedders that want
|
|
14
15
|
* share links to point at their own event page. */
|
|
15
16
|
shareUrlOverride?: string;
|
|
17
|
+
/** False for an event with no public page to share, such as a private one: no share pop-up
|
|
18
|
+
* after creating the event or answering Going. */
|
|
19
|
+
share?: boolean;
|
|
16
20
|
/** App-owned actions such as private reporting; omitted in embeds. */
|
|
17
21
|
extraActions?: Snippet;
|
|
18
22
|
/** App-owned actions below the attendee lists, with current RSVP counts. */
|
|
19
23
|
attendeeActions?: Snippet<[AttendeeCounts]>;
|
|
24
|
+
/** Fetches the complete attendee lists the first time one is opened, when
|
|
25
|
+
* `data.attendees` holds only a sample of the counted RSVPs. */
|
|
26
|
+
loadAttendees?: AttendeeListLoader;
|
|
20
27
|
};
|
|
21
28
|
declare const EventView: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
22
29
|
type EventView = ReturnType<typeof EventView>;
|
|
@@ -42,6 +42,17 @@ export type AttendeeInfo = {
|
|
|
42
42
|
handle?: string;
|
|
43
43
|
url: string;
|
|
44
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* Loads the complete attendee lists. `EventAttendees` calls it the first time
|
|
47
|
+
* a list opens when the counts exceed the attendees it was given, so apps can
|
|
48
|
+
* render a small hydrated sample and defer the expensive full fetch.
|
|
49
|
+
*/
|
|
50
|
+
export type AttendeeListLoader = () => Promise<{
|
|
51
|
+
going: AttendeeInfo[];
|
|
52
|
+
interested: AttendeeInfo[];
|
|
53
|
+
goingCount?: number;
|
|
54
|
+
interestedCount?: number;
|
|
55
|
+
}>;
|
|
45
56
|
export declare const RSVP_GOING = "community.lexicon.calendar.rsvp#going";
|
|
46
57
|
export declare const RSVP_INTERESTED = "community.lexicon.calendar.rsvp#interested";
|
|
47
58
|
/** Build the canonical path for an event. */
|
|
@@ -33,6 +33,17 @@ export type EditorAdapter = {
|
|
|
33
33
|
features: {
|
|
34
34
|
delete: boolean;
|
|
35
35
|
recurring: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* False to offer and upload no cover image in the editor, for an event whose page can't
|
|
38
|
+
* show one, such as one that isn't public. EventView doesn't read it: it shows whatever
|
|
39
|
+
* `eventData.media` holds.
|
|
40
|
+
*/
|
|
41
|
+
images?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* False for an event with no public listing to appear in: no Public / Unlisted switch, and
|
|
44
|
+
* the record's discovery preference is left as it is.
|
|
45
|
+
*/
|
|
46
|
+
visibility?: boolean;
|
|
36
47
|
};
|
|
37
48
|
putRecord(opts: {
|
|
38
49
|
collection: string;
|
|
@@ -30,7 +30,8 @@ export declare function buildEventRecord(args: {
|
|
|
30
30
|
endsAt: string;
|
|
31
31
|
timezone: string;
|
|
32
32
|
mode: EventMode;
|
|
33
|
-
|
|
33
|
+
/** Null when no Public / Unlisted choice was offered: the discovery preference is left as it is. */
|
|
34
|
+
visibility: Visibility | null;
|
|
34
35
|
theme: EventTheme;
|
|
35
36
|
links: Array<{
|
|
36
37
|
uri: string;
|
|
@@ -158,11 +158,14 @@ export async function buildEventRecord(args) {
|
|
|
158
158
|
if (Array.isArray(record.locations)) {
|
|
159
159
|
record.locations = normalizeEventLocations(record.locations);
|
|
160
160
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
161
|
+
// With no Public / Unlisted choice offered, the record keeps whatever preference it had.
|
|
162
|
+
if (visibility !== null) {
|
|
163
|
+
const existingPrefs = (record.preferences ??
|
|
164
|
+
{});
|
|
165
|
+
record.preferences = {
|
|
166
|
+
...existingPrefs,
|
|
167
|
+
showInDiscovery: visibility !== 'unlisted'
|
|
168
|
+
};
|
|
169
|
+
}
|
|
167
170
|
return record;
|
|
168
171
|
}
|
package/dist/events-data.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type { EventViewData } from './events/view-data.js';
|
|
|
3
3
|
export type { EditorAdapter, EditorBlobRef, EditorViewer } from './events/editor/adapter.js';
|
|
4
4
|
export type { EventEditorPrefill } from './events/editor/types.js';
|
|
5
5
|
export type { EventData, EventLexiconMain, EventLocationVariant, EventStatus, EventMode as EventLexiconMode } from './events/event-types.js';
|
|
6
|
-
export type { FlatEventRecord, HostProfile, AttendeeInfo } from './events/contrail.js';
|
|
6
|
+
export type { FlatEventRecord, HostProfile, AttendeeInfo, AttendeeListLoader } from './events/contrail.js';
|
|
7
7
|
export { eventUrl, isEventOngoing, RSVP_GOING, RSVP_INTERESTED } from './events/contrail.js';
|
|
8
8
|
export * from './events/conference.js';
|
|
9
9
|
export * from './events/linked-records.js';
|
package/dist/events.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { default as EventRsvp } from './events/EventRsvp.svelte';
|
|
|
7
7
|
export { default as EventComments } from './events/EventComments.svelte';
|
|
8
8
|
export { default as EventAttendees } from './events/EventAttendees.svelte';
|
|
9
9
|
export type { AttendeeCounts } from './events/EventAttendees.svelte';
|
|
10
|
+
export type { AttendeeListLoader } from './events/contrail.js';
|
|
10
11
|
export { default as StarterPackButton } from './events/StarterPackButton.svelte';
|
|
11
12
|
export { default as VodPlayer } from './events/VodPlayer.svelte';
|
|
12
13
|
export type { VodPlayerApi } from './events/VodPlayer.svelte';
|