@atmo-dev/kit 0.20.0 → 0.22.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/README.md +1 -1
- package/dist/components/RichText.svelte +17 -9
- package/dist/components/RichTextEditor.svelte +67 -11
- package/dist/components/RichTextEditor.svelte.d.ts +0 -2
- package/dist/components/StreamplacePicker.svelte +2 -2
- package/dist/components/StreamplacePicker.svelte.d.ts +1 -1
- package/dist/components/composer/EmojiPanel.svelte +55 -0
- package/dist/components/composer/EmojiPanel.svelte.d.ts +6 -0
- package/dist/components/composer/EmojiPicker.svelte +2 -38
- package/dist/components/data/DataLabel.svelte +120 -0
- package/dist/components/data/DataLabel.svelte.d.ts +10 -0
- package/dist/components/data/issues.d.ts +5 -0
- package/dist/components/data/issues.js +52 -0
- package/dist/components/data/types.d.ts +28 -0
- package/dist/components/data/types.js +1 -0
- package/dist/components/data/visibility.d.ts +7 -0
- package/dist/components/data/visibility.js +15 -0
- package/dist/components/legal/links.js +1 -0
- package/dist/components/legal/types.d.ts +1 -1
- package/dist/components/notifications/NotificationList.svelte +137 -0
- package/dist/components/notifications/NotificationList.svelte.d.ts +19 -0
- package/dist/components/notifications/NotificationPushToggle.svelte +76 -0
- package/dist/components/notifications/NotificationPushToggle.svelte.d.ts +19 -0
- package/dist/components/notifications/NotificationSettings.svelte +125 -0
- package/dist/components/notifications/NotificationSettings.svelte.d.ts +16 -0
- package/dist/components/notifications/types.d.ts +37 -0
- package/dist/components/notifications/types.js +1 -0
- package/dist/editor/ImageDialog.svelte +87 -0
- package/dist/editor/ImageDialog.svelte.d.ts +16 -0
- package/dist/editor/image-node.d.ts +6 -2
- package/dist/editor/image-node.js +36 -37
- package/dist/events/EventCard.svelte +6 -1
- package/dist/events/VodPlayer.svelte +1 -1
- package/dist/events/atmo-rsvp.d.ts +6 -0
- package/dist/events/atmo-rsvp.js +34 -0
- package/dist/events/atproto-helpers.d.ts +1 -0
- package/dist/events/atproto-helpers.js +3 -0
- package/dist/events/event-link-embed.d.ts +7 -3
- package/dist/events/event-link-embed.js +11 -5
- package/dist/events/event-view/StreamPlacePlayer.svelte +14 -108
- package/dist/events/linked-records.d.ts +1 -1
- package/dist/events/linked-records.js +2 -2
- package/dist/events-card.d.ts +9 -0
- package/dist/events-card.js +7 -0
- package/dist/events-data.d.ts +1 -0
- package/dist/events-data.js +1 -0
- package/dist/gestures.d.ts +5 -1
- package/dist/gestures.js +6 -3
- package/dist/grain/xrpc.js +11 -4
- package/dist/index.d.ts +13 -1
- package/dist/index.js +7 -1
- package/dist/legal.d.ts +3 -0
- package/dist/legal.js +2 -0
- package/dist/richtext/serialize.js +13 -8
- package/dist/streamplace/StreamCard.svelte +184 -0
- package/dist/streamplace/StreamCard.svelte.d.ts +24 -0
- package/dist/streamplace/StreamLinkEmbed.svelte +59 -0
- package/dist/streamplace/StreamLinkEmbed.svelte.d.ts +5 -0
- package/dist/streamplace/StreamPlayer.svelte +539 -0
- package/dist/streamplace/StreamPlayer.svelte.d.ts +42 -0
- package/dist/streamplace/VideoCard.svelte +159 -0
- package/dist/streamplace/VideoCard.svelte.d.ts +17 -0
- package/dist/streamplace/api.d.ts +74 -0
- package/dist/streamplace/api.js +182 -0
- package/dist/streamplace/broadcast.d.ts +3 -0
- package/dist/streamplace/broadcast.js +110 -0
- package/dist/streamplace/channel.svelte.d.ts +74 -0
- package/dist/streamplace/channel.svelte.js +515 -0
- package/dist/streamplace/chat/Composer.svelte +232 -0
- package/dist/streamplace/chat/Composer.svelte.d.ts +15 -0
- package/dist/streamplace/chat/Embeds.svelte +135 -0
- package/dist/streamplace/chat/Embeds.svelte.d.ts +13 -0
- package/dist/streamplace/chat/Message.svelte +303 -0
- package/dist/streamplace/chat/Message.svelte.d.ts +25 -0
- package/dist/streamplace/chat/StreamChat.svelte +463 -0
- package/dist/streamplace/chat/StreamChat.svelte.d.ts +33 -0
- package/dist/streamplace/chat/StreamChatPopups.svelte +151 -0
- package/dist/streamplace/chat/StreamChatPopups.svelte.d.ts +15 -0
- package/dist/streamplace/chat/UserCard.svelte +76 -0
- package/dist/streamplace/chat/UserCard.svelte.d.ts +12 -0
- package/dist/streamplace/chat/color.d.ts +7 -0
- package/dist/streamplace/chat/color.js +33 -0
- package/dist/streamplace/chat/links.d.ts +10 -0
- package/dist/streamplace/chat/links.js +29 -0
- package/dist/streamplace/facets.d.ts +15 -0
- package/dist/streamplace/facets.js +112 -0
- package/dist/streamplace/link-embed.d.ts +13 -0
- package/dist/streamplace/link-embed.js +16 -0
- package/dist/streamplace/links.d.ts +6 -0
- package/dist/streamplace/links.js +1 -0
- package/dist/streamplace/reactions.d.ts +21 -0
- package/dist/streamplace/reactions.js +46 -0
- package/dist/streamplace/types.d.ts +200 -0
- package/dist/streamplace/types.js +1 -0
- package/dist/streamplace-data.d.ts +11 -0
- package/dist/streamplace-data.js +10 -0
- package/dist/streamplace.d.ts +14 -6
- package/dist/streamplace.js +11 -1
- package/dist/{events/event-view → video}/Player.svelte +69 -21
- package/dist/video/Player.svelte.d.ts +38 -0
- package/dist/video/engines.d.ts +59 -0
- package/dist/video/engines.js +647 -0
- package/package.json +11 -1
- package/dist/events/event-view/Player.svelte.d.ts +0 -24
|
@@ -84,6 +84,9 @@
|
|
|
84
84
|
return getEventExternalImage(event);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
let link = $derived(href ?? eventUrl(event, actor));
|
|
88
|
+
// Like other Kit links: paths in this app stay in the tab, anything else opens a new one.
|
|
89
|
+
let leaves = $derived(!/^\/(?!\/)/.test(link));
|
|
87
90
|
let thumbnail = $derived(getThumbnail(event));
|
|
88
91
|
let location = $derived(getLocationSummary(getLocations(event.locations)));
|
|
89
92
|
let mode = $derived(getModeLabel(event.mode));
|
|
@@ -91,7 +94,9 @@
|
|
|
91
94
|
</script>
|
|
92
95
|
|
|
93
96
|
<a
|
|
94
|
-
href={
|
|
97
|
+
href={link}
|
|
98
|
+
target={leaves ? '_blank' : undefined}
|
|
99
|
+
rel={leaves ? 'noopener noreferrer' : undefined}
|
|
95
100
|
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"
|
|
96
101
|
>
|
|
97
102
|
<div class="w-full">
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FlatEventRecord } from './contrail.js';
|
|
2
|
+
/**
|
|
3
|
+
* A public event from atmo.rsvp's own index, by handle or DID and record key. Works from the
|
|
4
|
+
* browser. The host is fixed; apps with their own index pass their own loader instead.
|
|
5
|
+
*/
|
|
6
|
+
export declare function loadAtmoRsvpEvent(actor: string, rkey: string, fetchImpl?: typeof fetch): Promise<FlatEventRecord>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { isLinkedActor } from '../grain.js';
|
|
2
|
+
const ORIGIN = 'https://atmo.rsvp';
|
|
3
|
+
/**
|
|
4
|
+
* A public event from atmo.rsvp's own index, by handle or DID and record key. Works from the
|
|
5
|
+
* browser. The host is fixed; apps with their own index pass their own loader instead.
|
|
6
|
+
*/
|
|
7
|
+
export async function loadAtmoRsvpEvent(actor, rkey, fetchImpl = fetch) {
|
|
8
|
+
if (!isLinkedActor(actor) || !/^[A-Za-z0-9._~:-]{1,512}$/.test(rkey) || rkey.startsWith('.'))
|
|
9
|
+
throw new Error('Invalid event reference');
|
|
10
|
+
const response = await fetchImpl(`${ORIGIN}/p/${encodeURIComponent(actor)}/e/${encodeURIComponent(rkey)}/data.json`, {
|
|
11
|
+
headers: { accept: 'application/json' },
|
|
12
|
+
signal: AbortSignal.timeout(6000),
|
|
13
|
+
redirect: 'error'
|
|
14
|
+
});
|
|
15
|
+
if (!response.ok)
|
|
16
|
+
throw new Error(`Event unavailable (${response.status})`);
|
|
17
|
+
const record = (await response.json());
|
|
18
|
+
const value = record?.value;
|
|
19
|
+
if (typeof record?.did !== 'string' ||
|
|
20
|
+
!record.did.startsWith('did:') ||
|
|
21
|
+
record.rkey !== rkey ||
|
|
22
|
+
(actor.startsWith('did:') && record.did !== actor) ||
|
|
23
|
+
!value ||
|
|
24
|
+
typeof value.name !== 'string' ||
|
|
25
|
+
typeof value.startsAt !== 'string')
|
|
26
|
+
throw new Error('Invalid event');
|
|
27
|
+
return {
|
|
28
|
+
...value,
|
|
29
|
+
cid: typeof record.cid === 'string' ? record.cid : null,
|
|
30
|
+
did: record.did,
|
|
31
|
+
rkey,
|
|
32
|
+
uri: `at://${record.did}/community.lexicon.calendar.event/${rkey}`
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -8,6 +8,7 @@ export declare function configureAtproto(options: {
|
|
|
8
8
|
cdn?: string;
|
|
9
9
|
}): void;
|
|
10
10
|
export declare function appviewUrl(): string;
|
|
11
|
+
export declare function cdnUrl(): string;
|
|
11
12
|
export declare function getCDNImageBlobUrl({ did, blob, format }: {
|
|
12
13
|
did: string;
|
|
13
14
|
blob: {
|
|
@@ -16,6 +16,9 @@ export function configureAtproto(options) {
|
|
|
16
16
|
export function appviewUrl() {
|
|
17
17
|
return services.appview;
|
|
18
18
|
}
|
|
19
|
+
export function cdnUrl() {
|
|
20
|
+
return services.cdn;
|
|
21
|
+
}
|
|
19
22
|
export function getCDNImageBlobUrl({ did, blob, format = 'webp' }) {
|
|
20
23
|
return `${services.cdn}/img/feed_thumbnail/plain/${did}/${blob.ref.$link}@${format}`;
|
|
21
24
|
}
|
|
@@ -10,9 +10,13 @@ export type EventLinkEmbedRef = {
|
|
|
10
10
|
};
|
|
11
11
|
/** The event a link points to; null when there is none to show. */
|
|
12
12
|
export declare function loadLinkedEvent(ref: EventLinkEmbedRef): Promise<FlatEventRecord | null>;
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Links to event pages, shown as event cards. With no options: links to atmo.rsvp, read from
|
|
15
|
+
* its public index.
|
|
16
|
+
*/
|
|
17
|
+
export declare function eventLinkEmbed(options?: {
|
|
18
|
+
/** Defaults to reading atmo.rsvp's public index; required for any other origin. */
|
|
19
|
+
loadEvent?: NonNullable<LinkedRecordsClient['getEvent']>;
|
|
16
20
|
/** Defaults to atmo.rsvp. */
|
|
17
21
|
origins?: readonly string[];
|
|
18
22
|
/** Whether this app serves event pages itself; otherwise the card opens the linked URL. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { loadAtmoRsvpEvent } from './atmo-rsvp.js';
|
|
1
2
|
import { parseEventLink } from './linked-records.js';
|
|
2
3
|
/** The event a link points to; null when there is none to show. */
|
|
3
4
|
export async function loadLinkedEvent(ref) {
|
|
@@ -6,16 +7,21 @@ export async function loadLinkedEvent(ref) {
|
|
|
6
7
|
}
|
|
7
8
|
// One function for every such embed, so that its component is loaded once.
|
|
8
9
|
const load = () => import('./event-view/EventLinkEmbed.svelte');
|
|
9
|
-
/**
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Links to event pages, shown as event cards. With no options: links to atmo.rsvp, read from
|
|
12
|
+
* its public index.
|
|
13
|
+
*/
|
|
14
|
+
export function eventLinkEmbed(options = {}) {
|
|
15
|
+
// The built-in loader only knows atmo.rsvp's events.
|
|
16
|
+
if (!options.loadEvent && options.origins)
|
|
17
|
+
throw new Error('eventLinkEmbed: `origins` needs a `loadEvent` for those origins');
|
|
18
|
+
const loadEvent = options.loadEvent ?? loadAtmoRsvpEvent;
|
|
11
19
|
return {
|
|
12
20
|
id: 'event',
|
|
13
21
|
label: 'event',
|
|
14
22
|
match(url) {
|
|
15
23
|
const link = parseEventLink(url.href, options.origins);
|
|
16
|
-
return link && !options.skip?.(link)
|
|
17
|
-
? { ...link, local: !!options.local, loadEvent: options.loadEvent }
|
|
18
|
-
: null;
|
|
24
|
+
return link && !options.skip?.(link) ? { ...link, local: !!options.local, loadEvent } : null;
|
|
19
25
|
},
|
|
20
26
|
load,
|
|
21
27
|
data: loadLinkedEvent
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
3
|
import { Icon } from '../../index.js';
|
|
4
|
+
import { liveThumbnail, whepUrl } from '../../streamplace/api.js';
|
|
5
|
+
import { startWebRTC } from '../../video/engines.js';
|
|
4
6
|
import { ExternalLink } from '@sketchyicons/svelte';
|
|
5
|
-
import Player from '
|
|
7
|
+
import Player from '../../video/Player.svelte';
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
handle,
|
|
@@ -17,116 +19,20 @@
|
|
|
17
19
|
let error = $state(false);
|
|
18
20
|
let controlsVisible = $state(true);
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const posterUrl = $derived(
|
|
23
|
-
`https://stream.place/api/playback/${encodeURIComponent(handle)}/stream.jpg`
|
|
24
|
-
);
|
|
22
|
+
const posterUrl = $derived(liveThumbnail(handle));
|
|
25
23
|
|
|
26
24
|
onMount(() => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
const node = videoEl;
|
|
26
|
+
if (!node) return;
|
|
27
|
+
// One attempt, as before: an event page says "offline" at once instead of retrying.
|
|
28
|
+
const engine = startWebRTC(
|
|
29
|
+
node,
|
|
30
|
+
whepUrl(handle),
|
|
31
|
+
{ onready: () => void node.play().catch(() => {}), onfail: () => (error = true) },
|
|
32
|
+
{ attempts: 1 }
|
|
33
|
+
);
|
|
34
|
+
return () => engine.destroy();
|
|
37
35
|
});
|
|
38
|
-
|
|
39
|
-
function waitForIceGathering(peer: RTCPeerConnection, timeoutMs = 2000): Promise<void> {
|
|
40
|
-
return new Promise((resolve) => {
|
|
41
|
-
if (peer.iceGatheringState === 'complete') {
|
|
42
|
-
resolve();
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
let done = false;
|
|
47
|
-
const finish = () => {
|
|
48
|
-
if (done) return;
|
|
49
|
-
done = true;
|
|
50
|
-
peer.removeEventListener('icegatheringstatechange', onStateChange);
|
|
51
|
-
clearTimeout(timer);
|
|
52
|
-
resolve();
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const onStateChange = () => {
|
|
56
|
-
if (peer.iceGatheringState === 'complete') {
|
|
57
|
-
finish();
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
peer.addEventListener('icegatheringstatechange', onStateChange);
|
|
62
|
-
const timer = setTimeout(finish, timeoutMs);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
async function init() {
|
|
67
|
-
if (!videoEl) return;
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
pc = new RTCPeerConnection({
|
|
71
|
-
iceServers: [{ urls: 'stun:stun.l.google.com:19302' }],
|
|
72
|
-
bundlePolicy: 'max-bundle'
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
pc.addTransceiver('video', { direction: 'recvonly' });
|
|
76
|
-
pc.addTransceiver('audio', { direction: 'recvonly' });
|
|
77
|
-
|
|
78
|
-
pc.addEventListener('track', (event) => {
|
|
79
|
-
if (!videoEl) return;
|
|
80
|
-
if (event.streams && event.streams[0]) {
|
|
81
|
-
videoEl.srcObject = event.streams[0];
|
|
82
|
-
} else {
|
|
83
|
-
let stream = videoEl.srcObject as MediaStream | null;
|
|
84
|
-
if (!stream) {
|
|
85
|
-
stream = new MediaStream();
|
|
86
|
-
videoEl.srcObject = stream;
|
|
87
|
-
}
|
|
88
|
-
stream.addTrack(event.track);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
const offer = await pc.createOffer();
|
|
93
|
-
await pc.setLocalDescription(offer);
|
|
94
|
-
await waitForIceGathering(pc, 2000);
|
|
95
|
-
|
|
96
|
-
const sdp = pc.localDescription?.sdp;
|
|
97
|
-
if (!sdp) {
|
|
98
|
-
error = true;
|
|
99
|
-
pc.close();
|
|
100
|
-
pc = null;
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const response = await fetch(
|
|
105
|
-
`https://stream.place/api/playback/${encodeURIComponent(handle)}/webrtc?rendition=source`,
|
|
106
|
-
{
|
|
107
|
-
method: 'POST',
|
|
108
|
-
headers: { 'Content-Type': 'application/sdp' },
|
|
109
|
-
body: sdp
|
|
110
|
-
}
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
if (!response.ok) {
|
|
114
|
-
error = true;
|
|
115
|
-
pc.close();
|
|
116
|
-
pc = null;
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
const answerSdp = await response.text();
|
|
121
|
-
await pc.setRemoteDescription({ type: 'answer', sdp: answerSdp });
|
|
122
|
-
} catch {
|
|
123
|
-
error = true;
|
|
124
|
-
if (pc) {
|
|
125
|
-
pc.close();
|
|
126
|
-
pc = null;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
36
|
</script>
|
|
131
37
|
|
|
132
38
|
{#snippet watchOnStreamPlace(hidden = false)}
|
|
@@ -3,7 +3,7 @@ import type { FlatEventRecord } from './contrail.js';
|
|
|
3
3
|
import { type SembleClient } from '../semble.js';
|
|
4
4
|
export { parseGrainLink, isLinkedActor } from '../grain.js';
|
|
5
5
|
export { parseSembleLink } from '../semble.js';
|
|
6
|
-
export { parseStreamplaceLink } from '../streamplace.js';
|
|
6
|
+
export { parseStreamplaceLink } from '../streamplace/links.js';
|
|
7
7
|
export type { GrainReference, GrainAlbum, GrainPhoto, GrainGallery, GrainAlbumPage } from '../grain.js';
|
|
8
8
|
export type { SembleReference, SembleCard, SembleCollection, SembleCollectionPage, SembleCollectionList } from '../semble.js';
|
|
9
9
|
export type EventLink = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isLinkedActor, parseGrainLink } from '../grain.js';
|
|
2
2
|
import { parseSembleLink } from '../semble.js';
|
|
3
|
-
import { parseStreamplaceLink } from '../streamplace.js';
|
|
3
|
+
import { parseStreamplaceLink } from '../streamplace/links.js';
|
|
4
4
|
export { parseGrainLink, isLinkedActor } from '../grain.js';
|
|
5
5
|
export { parseSembleLink } from '../semble.js';
|
|
6
|
-
export { parseStreamplaceLink } from '../streamplace.js';
|
|
6
|
+
export { parseStreamplaceLink } from '../streamplace/links.js';
|
|
7
7
|
/**
|
|
8
8
|
* Recognize a link to an event page, `/p/<handle or DID>/e/<rkey>`, on one of the given origins.
|
|
9
9
|
* Syntax only; the event may not exist.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event cards and event links shown as cards, without the full event page: no map, players or
|
|
3
|
+
* editor, so none of the optional peers of `@atmo-dev/kit/events` are needed.
|
|
4
|
+
*/
|
|
5
|
+
export { default as EventCard } from './events/EventCard.svelte';
|
|
6
|
+
export { eventLinkEmbed } from './events/event-link-embed.js';
|
|
7
|
+
export type { EventLinkEmbedRef } from './events/event-link-embed.js';
|
|
8
|
+
export { loadAtmoRsvpEvent } from './events/atmo-rsvp.js';
|
|
9
|
+
export type { FlatEventRecord } from './events/contrail.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event cards and event links shown as cards, without the full event page: no map, players or
|
|
3
|
+
* editor, so none of the optional peers of `@atmo-dev/kit/events` are needed.
|
|
4
|
+
*/
|
|
5
|
+
export { default as EventCard } from './events/EventCard.svelte';
|
|
6
|
+
export { eventLinkEmbed } from './events/event-link-embed.js';
|
|
7
|
+
export { loadAtmoRsvpEvent } from './events/atmo-rsvp.js';
|
package/dist/events-data.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export type { EditorAdapter, EditorBlobRef, EditorViewer } from './events/editor
|
|
|
4
4
|
export type { EventEditorPrefill, Visibility as EventVisibility } from './events/editor/types.js';
|
|
5
5
|
export type { EventData, EventLexiconMain, EventLocationVariant, EventStatus, EventMode as EventLexiconMode } from './events/event-types.js';
|
|
6
6
|
export type { FlatEventRecord, HostProfile, AttendeeInfo, AttendeeListLoader } from './events/contrail.js';
|
|
7
|
+
export { loadAtmoRsvpEvent } from './events/atmo-rsvp.js';
|
|
7
8
|
export { eventUrl, isEventOngoing, RSVP_GOING, RSVP_INTERESTED } from './events/contrail.js';
|
|
8
9
|
export * from './events/conference.js';
|
|
9
10
|
export * from './events/linked-records.js';
|
package/dist/events-data.js
CHANGED
package/dist/gestures.d.ts
CHANGED
|
@@ -35,7 +35,11 @@ export declare const touchOf: (event: TouchEvent, id: number) => Touch | undefin
|
|
|
35
35
|
* out of sight until what `onback` returns has settled, so return a promise for a navigation
|
|
36
36
|
* that takes a moment. Returns a function that stops listening.
|
|
37
37
|
*
|
|
38
|
+
* With `follow: false` nothing moves: `onback` is called on release, as a back button would.
|
|
39
|
+
*
|
|
38
40
|
* Swipes are ignored where a drawer's are: at the left edge, in sideways scrollers, fields,
|
|
39
41
|
* dialogs and `data-no-swipe`. A page that uses this should not also open a drawer by swipe.
|
|
40
42
|
*/
|
|
41
|
-
export declare function swipeBack(target: () => HTMLElement | null | undefined, onback: () => unknown
|
|
43
|
+
export declare function swipeBack(target: () => HTMLElement | null | undefined, onback: () => unknown, { follow }?: {
|
|
44
|
+
follow?: boolean;
|
|
45
|
+
}): () => void;
|
package/dist/gestures.js
CHANGED
|
@@ -66,10 +66,13 @@ export const touchOf = (event, id) => Array.from(event.touches).find((touch) =>
|
|
|
66
66
|
* out of sight until what `onback` returns has settled, so return a promise for a navigation
|
|
67
67
|
* that takes a moment. Returns a function that stops listening.
|
|
68
68
|
*
|
|
69
|
+
* With `follow: false` nothing moves: `onback` is called on release, as a back button would.
|
|
70
|
+
*
|
|
69
71
|
* Swipes are ignored where a drawer's are: at the left edge, in sideways scrollers, fields,
|
|
70
72
|
* dialogs and `data-no-swipe`. A page that uses this should not also open a drawer by swipe.
|
|
71
73
|
*/
|
|
72
|
-
export function swipeBack(target, onback) {
|
|
74
|
+
export function swipeBack(target, onback, { follow = true } = {}) {
|
|
75
|
+
const still = () => !follow || reducedMotion();
|
|
73
76
|
let start;
|
|
74
77
|
let node;
|
|
75
78
|
let moves = [];
|
|
@@ -115,7 +118,7 @@ export function swipeBack(target, onback) {
|
|
|
115
118
|
if (event.cancelable)
|
|
116
119
|
event.preventDefault();
|
|
117
120
|
track(moves, touch, event);
|
|
118
|
-
if (!
|
|
121
|
+
if (!still())
|
|
119
122
|
node.style.transform = `translateX(${Math.max(0, touch.clientX - start.x)}px)`;
|
|
120
123
|
};
|
|
121
124
|
const onEnd = (event) => {
|
|
@@ -129,7 +132,7 @@ export function swipeBack(target, onback) {
|
|
|
129
132
|
const fast = speed(moves, 'x');
|
|
130
133
|
const back = event.type === 'touchend' &&
|
|
131
134
|
(fast > 0.4 || (fast > -0.3 && dx > Math.min(140, innerWidth * 0.35)));
|
|
132
|
-
if (
|
|
135
|
+
if (still()) {
|
|
133
136
|
node = undefined;
|
|
134
137
|
return void (back && onback());
|
|
135
138
|
}
|
package/dist/grain/xrpc.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { isLinkedActor, parseGrainLink } from './urls.js';
|
|
2
|
-
// Grain's
|
|
2
|
+
// Grain's API is deliberately isolated here; never proxy a user-supplied host.
|
|
3
3
|
const ORIGIN = 'https://grain.social';
|
|
4
|
+
// The feed listing one account's galleries. `social.grain.feed.describeFeeds` names it; it is
|
|
5
|
+
// fixed here to save a request per page, as Grain's own client keeps the answer too.
|
|
6
|
+
const ACTOR_FEED = 'at://did:web:grain.social/social.grain.feed.generator/actor';
|
|
7
|
+
// Retired endpoints answer with one gallery telling people to update, not with an error.
|
|
8
|
+
const isUpdateNotice = (value) => text(object(value).uri).endsWith('/update-notice');
|
|
4
9
|
function object(value) {
|
|
5
10
|
return value && typeof value === 'object' && !Array.isArray(value) ? value : {};
|
|
6
11
|
}
|
|
@@ -50,6 +55,8 @@ function photo(value) {
|
|
|
50
55
|
};
|
|
51
56
|
}
|
|
52
57
|
function album(value) {
|
|
58
|
+
if (isUpdateNotice(value))
|
|
59
|
+
throw new Error('Grain endpoint retired');
|
|
53
60
|
const g = object(value), record = object(g.record), creator = object(g.creator);
|
|
54
61
|
const ref = parseGrainLink(text(g.uri));
|
|
55
62
|
const did = text(creator.did);
|
|
@@ -95,7 +102,7 @@ export function createGrainXrpcClient(fetchImpl = fetch) {
|
|
|
95
102
|
const ref = parseGrainLink(reference);
|
|
96
103
|
if (!ref)
|
|
97
104
|
throw new Error('Invalid Grain reference');
|
|
98
|
-
const data = await request('social.grain.
|
|
105
|
+
const data = await request('social.grain.gallery.getGallery', { gallery: ref.atUri });
|
|
99
106
|
const result = album(data.gallery);
|
|
100
107
|
const canonical = parseGrainLink(result.uri);
|
|
101
108
|
if (canonical.rkey !== ref.rkey ||
|
|
@@ -109,8 +116,8 @@ export function createGrainXrpcClient(fetchImpl = fetch) {
|
|
|
109
116
|
async listAlbums(actor, cursor) {
|
|
110
117
|
if (!isLinkedActor(actor))
|
|
111
118
|
throw new Error('Invalid actor');
|
|
112
|
-
const data = await request('
|
|
113
|
-
feed:
|
|
119
|
+
const data = await request('social.grain.feed.getFeed', {
|
|
120
|
+
feed: ACTOR_FEED,
|
|
114
121
|
actor,
|
|
115
122
|
limit: '24',
|
|
116
123
|
...(cursor ? { cursor } : {})
|
package/dist/index.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export { default as SembleCollectionView } from './components/SembleCollectionVi
|
|
|
44
44
|
export type { SembleCollectionViewProps } from './components/SembleCollectionView.svelte';
|
|
45
45
|
export * from './grain.js';
|
|
46
46
|
export * from './semble.js';
|
|
47
|
-
export * from './streamplace.js';
|
|
47
|
+
export * from './streamplace/links.js';
|
|
48
48
|
export { default as InsetImage } from './components/InsetImage.svelte';
|
|
49
49
|
export { default as Badge } from './components/Badge.svelte';
|
|
50
50
|
export { default as Modal } from './components/Modal.svelte';
|
|
@@ -56,9 +56,21 @@ export { default as LegalFooter } from './components/legal/LegalFooter.svelte';
|
|
|
56
56
|
export type { LegalFooterProps } from './components/legal/LegalFooter.svelte';
|
|
57
57
|
export { createLegalDrafts, getLegalDraftIssues, getLegalDocumentIssues } from './components/legal/drafts.js';
|
|
58
58
|
export type { LegalDocumentKind, LegalDocumentData, LegalSection, LegalLink, LegalFooterLink, LegalFooterLinks, LegalDraftConfig } from './components/legal/types.js';
|
|
59
|
+
export { default as DataLabel } from './components/data/DataLabel.svelte';
|
|
60
|
+
export type { DataLabelProps } from './components/data/DataLabel.svelte';
|
|
61
|
+
export { getDataLabelIssues } from './components/data/issues.js';
|
|
62
|
+
export { dataVisibilityLevels } from './components/data/visibility.js';
|
|
63
|
+
export type { DataLabelData, DataLabelEntry, DataVisibility } from './components/data/types.js';
|
|
59
64
|
export { default as ReportDialog } from './components/report/ReportDialog.svelte';
|
|
60
65
|
export type { ReportDialogProps } from './components/report/ReportDialog.svelte';
|
|
61
66
|
export type { ReportReasonType, ReportInput, ReportFailure, ReportSubmit } from './components/report/types.js';
|
|
67
|
+
export { default as NotificationList } from './components/notifications/NotificationList.svelte';
|
|
68
|
+
export type { NotificationListProps } from './components/notifications/NotificationList.svelte';
|
|
69
|
+
export { default as NotificationSettings } from './components/notifications/NotificationSettings.svelte';
|
|
70
|
+
export type { NotificationSettingsProps } from './components/notifications/NotificationSettings.svelte';
|
|
71
|
+
export { default as NotificationPushToggle } from './components/notifications/NotificationPushToggle.svelte';
|
|
72
|
+
export type { NotificationPushToggleProps } from './components/notifications/NotificationPushToggle.svelte';
|
|
73
|
+
export type { NotificationActor, NotificationItem, NotificationPreference, NotificationChannel, NotificationPreferenceValue, NotificationPushState } from './components/notifications/types.js';
|
|
62
74
|
export { default as Tabs } from './components/Tabs.svelte';
|
|
63
75
|
export type { TabItem } from './components/Tabs.svelte';
|
|
64
76
|
export { default as Icon } from './components/Icon.svelte';
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ export { default as SembleCollectionPicker } from './components/SembleCollection
|
|
|
30
30
|
export { default as SembleCollectionView } from './components/SembleCollectionView.svelte';
|
|
31
31
|
export * from './grain.js';
|
|
32
32
|
export * from './semble.js';
|
|
33
|
-
export * from './streamplace.js';
|
|
33
|
+
export * from './streamplace/links.js';
|
|
34
34
|
export { default as InsetImage } from './components/InsetImage.svelte';
|
|
35
35
|
export { default as Badge } from './components/Badge.svelte';
|
|
36
36
|
export { default as Modal } from './components/Modal.svelte';
|
|
@@ -39,7 +39,13 @@ export { iconColors, iconSvg, iconPng } from './icon-maker/index.js';
|
|
|
39
39
|
export { default as LegalDocument } from './components/legal/LegalDocument.svelte';
|
|
40
40
|
export { default as LegalFooter } from './components/legal/LegalFooter.svelte';
|
|
41
41
|
export { createLegalDrafts, getLegalDraftIssues, getLegalDocumentIssues } from './components/legal/drafts.js';
|
|
42
|
+
export { default as DataLabel } from './components/data/DataLabel.svelte';
|
|
43
|
+
export { getDataLabelIssues } from './components/data/issues.js';
|
|
44
|
+
export { dataVisibilityLevels } from './components/data/visibility.js';
|
|
42
45
|
export { default as ReportDialog } from './components/report/ReportDialog.svelte';
|
|
46
|
+
export { default as NotificationList } from './components/notifications/NotificationList.svelte';
|
|
47
|
+
export { default as NotificationSettings } from './components/notifications/NotificationSettings.svelte';
|
|
48
|
+
export { default as NotificationPushToggle } from './components/notifications/NotificationPushToggle.svelte';
|
|
43
49
|
export { default as Tabs } from './components/Tabs.svelte';
|
|
44
50
|
export { default as Icon } from './components/Icon.svelte';
|
|
45
51
|
export { default as IconRail } from './components/IconRail.svelte';
|
package/dist/legal.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
/** Framework-free authoring helpers for scripts; UI components use the main entry. */
|
|
2
2
|
export { createLegalDrafts, getLegalDraftIssues, getLegalDocumentIssues } from './components/legal/drafts.js';
|
|
3
3
|
export type { LegalDocumentData, LegalDocumentKind, LegalDraftConfig, LegalSection, LegalFooterLinks } from './components/legal/types.js';
|
|
4
|
+
export { getDataLabelIssues } from './components/data/issues.js';
|
|
5
|
+
export { dataVisibilityLevels } from './components/data/visibility.js';
|
|
6
|
+
export type { DataLabelData, DataLabelEntry, DataVisibility } from './components/data/types.js';
|
package/dist/legal.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
/** Framework-free authoring helpers for scripts; UI components use the main entry. */
|
|
2
2
|
export { createLegalDrafts, getLegalDraftIssues, getLegalDocumentIssues } from './components/legal/drafts.js';
|
|
3
|
+
export { getDataLabelIssues } from './components/data/issues.js';
|
|
4
|
+
export { dataVisibilityLevels } from './components/data/visibility.js';
|
|
@@ -205,8 +205,8 @@ function shapeOf(blocks, depth = 0) {
|
|
|
205
205
|
return [
|
|
206
206
|
{
|
|
207
207
|
img: safeWebUrl(block.url) ?? block.url,
|
|
208
|
-
alt: block.alt ?? '',
|
|
209
|
-
title: block.title ?? ''
|
|
208
|
+
alt: (block.alt ?? '').replace(/[\r\n]+/g, ' '),
|
|
209
|
+
title: (block.title ?? '').replace(/[\r\n]+/g, ' ')
|
|
210
210
|
}
|
|
211
211
|
];
|
|
212
212
|
case 'table':
|
|
@@ -470,11 +470,16 @@ function tableMarkdown(block, aggressive, article) {
|
|
|
470
470
|
...body.map(row)
|
|
471
471
|
].join('\n');
|
|
472
472
|
}
|
|
473
|
-
function
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
473
|
+
function escapeTitle(value) {
|
|
474
|
+
return value
|
|
475
|
+
.replace(/[\r\n]+/g, ' ')
|
|
476
|
+
.replace(/["\\]/g, '\\$&')
|
|
477
|
+
.replace(/&(?=(?:[A-Za-z][A-Za-z0-9]{0,31}|#[0-9]{1,7}|#[xX][0-9A-Fa-f]{1,6});)/g, '\\&');
|
|
478
|
+
}
|
|
479
|
+
function imageMarkdown(block, aggressive, article) {
|
|
480
|
+
const title = block.title ? ` "${escapeTitle(block.title)}"` : '';
|
|
481
|
+
const altText = (block.alt ?? '').replace(/[\r\n]+/g, ' ');
|
|
482
|
+
const alt = aggressive ? escapeAll(altText) : escapeText(altText, true, article);
|
|
478
483
|
return `}${title})`;
|
|
479
484
|
}
|
|
480
485
|
function blocksMarkdown(blocks, aggressive, depth, inList = false, article = false) {
|
|
@@ -541,7 +546,7 @@ function blocksMarkdown(blocks, aggressive, depth, inList = false, article = fal
|
|
|
541
546
|
result.push(inList ? '***' : '---');
|
|
542
547
|
break;
|
|
543
548
|
case 'image':
|
|
544
|
-
result.push(imageMarkdown(block));
|
|
549
|
+
result.push(imageMarkdown(block, aggressive, article));
|
|
545
550
|
break;
|
|
546
551
|
case 'math':
|
|
547
552
|
result.push(`$$\n${block.value}\n$$`);
|