@atproto-ui/core 0.13.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/backlinks.d.ts +18 -0
- package/dist/backlinks.js +15 -0
- package/dist/blob-fetch.d.ts +42 -0
- package/dist/blob-fetch.js +53 -0
- package/dist/cache.d.ts +155 -0
- package/dist/cache.js +345 -0
- package/dist/client.d.ts +45 -0
- package/dist/client.js +118 -0
- package/dist/fetch-and-cache-handler.d.ts +84 -0
- package/dist/fetch-and-cache-handler.js +63 -0
- package/dist/grain.d.ts +22 -0
- package/dist/grain.js +30 -0
- package/dist/icons.d.ts +11 -0
- package/dist/icons.js +11 -0
- package/dist/identity.d.ts +28 -0
- package/dist/identity.js +55 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +22 -0
- package/dist/leaflet.d.ts +22 -0
- package/dist/leaflet.js +85 -0
- package/dist/music.d.ts +35 -0
- package/dist/music.js +88 -0
- package/dist/paginated.d.ts +61 -0
- package/dist/paginated.js +111 -0
- package/dist/records.d.ts +171 -0
- package/dist/records.js +321 -0
- package/dist/rpc.d.ts +21 -0
- package/dist/rpc.js +24 -0
- package/dist/styles.d.ts +40 -0
- package/dist/styles.js +1728 -0
- package/dist/tangled-fetch.d.ts +9 -0
- package/dist/tangled-fetch.js +15 -0
- package/dist/types/blob.d.ts +14 -0
- package/dist/types/bluesky.d.ts +4 -0
- package/dist/types/grain.d.ts +31 -0
- package/dist/types/leaflet.d.ts +173 -0
- package/dist/types/record.d.ts +28 -0
- package/dist/types/record.js +7 -0
- package/dist/types/tangled.d.ts +19 -0
- package/dist/types/teal.d.ts +36 -0
- package/dist/utils/at-uri.d.ts +10 -0
- package/dist/utils/at-uri.js +33 -0
- package/dist/utils/blob.d.ts +5 -0
- package/dist/utils/blob.js +26 -0
- package/dist/utils/profile.d.ts +2 -0
- package/dist/utils/profile.js +5 -0
- package/dist/utils/richtext.d.ts +28 -0
- package/dist/utils/richtext.js +95 -0
- package/dist/utils/time.d.ts +2 -0
- package/dist/utils/time.js +41 -0
- package/package.json +41 -0
package/dist/records.js
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import { createAtprotoClient } from "./client.js";
|
|
2
|
+
import { callAppviewRpc, callGetRecord, callListRecords } from "./rpc.js";
|
|
3
|
+
import { extractCidFromCdnUrl } from "./utils/blob.js";
|
|
4
|
+
var BLUESKY_COLLECTION_TO_ENDPOINT = {
|
|
5
|
+
"app.bsky.actor.profile": "app.bsky.actor.getProfile",
|
|
6
|
+
"app.bsky.feed.post": "app.bsky.feed.getPostThread"
|
|
7
|
+
};
|
|
8
|
+
function ensureCachedRecord(e, x) {
|
|
9
|
+
return x.bypassCache ? {
|
|
10
|
+
promise: x.loader(),
|
|
11
|
+
release: () => {}
|
|
12
|
+
} : e.ensure(x.did, x.collection, x.rkey, () => ({
|
|
13
|
+
promise: x.loader(),
|
|
14
|
+
abort: () => {}
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
function fetchRepositoryRecord(e) {
|
|
18
|
+
let x = async () => {
|
|
19
|
+
try {
|
|
20
|
+
let x = await callGetRecord(e.service, e.did, e.collection, e.rkey);
|
|
21
|
+
if (!x.ok) throw Error("Failed to load record");
|
|
22
|
+
return x.data.value;
|
|
23
|
+
} catch (x) {
|
|
24
|
+
throw e.service.includes(".bsky.network") ? Error(`Record unavailable. The Bluesky PDS (${e.service}) may be unreachable or the account may be banned.`) : x;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
return e.recordCache ? ensureCachedRecord(e.recordCache, {
|
|
28
|
+
did: e.did,
|
|
29
|
+
collection: e.collection,
|
|
30
|
+
rkey: e.rkey,
|
|
31
|
+
bypassCache: e.bypassCache,
|
|
32
|
+
loader: x
|
|
33
|
+
}) : {
|
|
34
|
+
promise: x(),
|
|
35
|
+
release: () => {}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function getBlueskyRecord(e) {
|
|
39
|
+
let x;
|
|
40
|
+
return {
|
|
41
|
+
promise: (async () => {
|
|
42
|
+
let S = e.handleOrDid.trim(), C = S.startsWith("did:") ? S : await e.resolver.resolveHandle(S), w = e.recordCache.ensure(C, e.collection, e.rkey, () => ({
|
|
43
|
+
promise: fetchBlueskyRecordUncached({
|
|
44
|
+
did: C,
|
|
45
|
+
collection: e.collection,
|
|
46
|
+
rkey: e.rkey,
|
|
47
|
+
appviewService: e.appviewService,
|
|
48
|
+
resolver: e.resolver,
|
|
49
|
+
skipAppview: e.skipAppview
|
|
50
|
+
}),
|
|
51
|
+
abort: () => {}
|
|
52
|
+
}));
|
|
53
|
+
return x = w.release, w.promise;
|
|
54
|
+
})(),
|
|
55
|
+
release: () => x?.()
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function fetchBlueskyRecord(e) {
|
|
59
|
+
return e.recordCache.ensure(e.did, e.collection, e.rkey, () => ({
|
|
60
|
+
promise: fetchBlueskyRecordUncached(e),
|
|
61
|
+
abort: () => {}
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
async function fetchBlueskyRecordUncached(e) {
|
|
65
|
+
let x;
|
|
66
|
+
if (!e.skipAppview && BLUESKY_COLLECTION_TO_ENDPOINT[e.collection]) try {
|
|
67
|
+
let x = await fetchFromAppview(e.did, e.collection, e.rkey, e.appviewService);
|
|
68
|
+
if (x) return {
|
|
69
|
+
record: x,
|
|
70
|
+
source: "appview"
|
|
71
|
+
};
|
|
72
|
+
} catch (e) {
|
|
73
|
+
x = e;
|
|
74
|
+
}
|
|
75
|
+
try {
|
|
76
|
+
let x = await callGetRecord(e.resolver.getSlingshotUrl(), e.did, e.collection, e.rkey);
|
|
77
|
+
if (x.ok) return {
|
|
78
|
+
record: x.data.value,
|
|
79
|
+
source: "slingshot"
|
|
80
|
+
};
|
|
81
|
+
throw Error("slingshot getRecord failed");
|
|
82
|
+
} catch (e) {
|
|
83
|
+
x = e;
|
|
84
|
+
}
|
|
85
|
+
let C = e.pdsEndpoint;
|
|
86
|
+
if (!C) try {
|
|
87
|
+
C = await e.resolver.pdsEndpointForDid(e.did);
|
|
88
|
+
} catch (e) {
|
|
89
|
+
x = e;
|
|
90
|
+
}
|
|
91
|
+
if (C) {
|
|
92
|
+
try {
|
|
93
|
+
let x = await callGetRecord(C, e.did, e.collection, e.rkey);
|
|
94
|
+
if (x.ok) return {
|
|
95
|
+
record: x.data.value,
|
|
96
|
+
source: "pds"
|
|
97
|
+
};
|
|
98
|
+
throw Error("pds getRecord failed");
|
|
99
|
+
} catch (e) {
|
|
100
|
+
x = e;
|
|
101
|
+
}
|
|
102
|
+
if (C.includes(".bsky.network")) throw Error(`Record unavailable. The Bluesky PDS (${C}) may be unreachable or the account may be banned.`);
|
|
103
|
+
}
|
|
104
|
+
throw x ?? /* @__PURE__ */ Error("Failed to fetch record from all sources");
|
|
105
|
+
}
|
|
106
|
+
async function fetchLatestRecord(e) {
|
|
107
|
+
let x = await callListRecords(e.service, e.did, e.collection, e.limit ?? 3);
|
|
108
|
+
if (!x.ok) throw Error("Failed to list records from PDS");
|
|
109
|
+
let S = x.data.records.find((e) => isValidTimestamp(e.value));
|
|
110
|
+
return S ? {
|
|
111
|
+
record: S.value,
|
|
112
|
+
rkey: S.rkey ?? extractRkey(S.uri),
|
|
113
|
+
empty: !1
|
|
114
|
+
} : { empty: !0 };
|
|
115
|
+
}
|
|
116
|
+
async function fetchPaginatedRecordsPage(e) {
|
|
117
|
+
let x = paginatedPageCacheKey(e);
|
|
118
|
+
return e.pageCache ? e.pageCache.ensure(x, () => fetchPaginatedRecordsPageUncached(e)).promise : fetchPaginatedRecordsPageUncached(e);
|
|
119
|
+
}
|
|
120
|
+
function primeBlueskyFeedCache(e) {
|
|
121
|
+
let x = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Set(), C = /* @__PURE__ */ new Set();
|
|
122
|
+
for (let w of e.feed) {
|
|
123
|
+
let T = w.post;
|
|
124
|
+
if (T?.uri && T.record !== void 0) {
|
|
125
|
+
let x = parseAtUriLoose(T.uri);
|
|
126
|
+
if (x) {
|
|
127
|
+
let S = {
|
|
128
|
+
record: T.record,
|
|
129
|
+
source: "appview"
|
|
130
|
+
};
|
|
131
|
+
e.recordCache?.set(x.did, x.collection, x.rkey, S), C.add(`${x.did}::${x.collection}::${x.rkey}`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
for (let C of [
|
|
135
|
+
T?.author,
|
|
136
|
+
w.reason?.by,
|
|
137
|
+
T?.reply?.parent?.author
|
|
138
|
+
]) C?.did && (e.didCache?.memoize({
|
|
139
|
+
did: C.did,
|
|
140
|
+
handle: C.handle
|
|
141
|
+
}), x.add(C.did), hasAppviewProfileData(C) && (primeBlueskyProfileCache({
|
|
142
|
+
profile: C,
|
|
143
|
+
didCache: e.didCache,
|
|
144
|
+
recordCache: e.recordCache
|
|
145
|
+
}), S.add(C.did)));
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
dids: x.size,
|
|
149
|
+
profiles: S.size,
|
|
150
|
+
records: C.size
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function primeBlueskyProfileCache(e) {
|
|
154
|
+
return e.profile.did ? (e.didCache?.memoize({
|
|
155
|
+
did: e.profile.did,
|
|
156
|
+
handle: e.profile.handle
|
|
157
|
+
}), e.recordCache?.set(e.profile.did, "app.bsky.actor.profile", "self", {
|
|
158
|
+
record: appviewProfileToRecord(e.profile),
|
|
159
|
+
source: "appview"
|
|
160
|
+
}), {
|
|
161
|
+
dids: 1,
|
|
162
|
+
profiles: 1,
|
|
163
|
+
records: 0
|
|
164
|
+
}) : {
|
|
165
|
+
dids: 0,
|
|
166
|
+
profiles: 0,
|
|
167
|
+
records: 0
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function hasAppviewProfileData(e) {
|
|
171
|
+
return "displayName" in e || "description" in e || "avatar" in e || "createdAt" in e || "pronouns" in e || "website" in e;
|
|
172
|
+
}
|
|
173
|
+
async function fetchPaginatedRecordsPageUncached(e) {
|
|
174
|
+
if (e.preferAuthorFeed && e.collection === "app.bsky.feed.post" && e.authorFeedActor) try {
|
|
175
|
+
let S = await callAppviewRpc(e.authorFeedService, "app.bsky.feed.getAuthorFeed", {
|
|
176
|
+
actor: e.authorFeedActor,
|
|
177
|
+
limit: e.limit,
|
|
178
|
+
cursor: e.cursor,
|
|
179
|
+
filter: e.authorFeedFilter,
|
|
180
|
+
includePins: e.authorFeedIncludePins
|
|
181
|
+
});
|
|
182
|
+
if (!S.ok) throw Error("Failed to fetch author feed");
|
|
183
|
+
return {
|
|
184
|
+
records: (S.data.feed ?? []).reduce((x, S) => {
|
|
185
|
+
let C = S.post;
|
|
186
|
+
return !C?.record || typeof C.uri != "string" || !isValidTimestamp(C.record) ? x : (x.push({
|
|
187
|
+
uri: C.uri,
|
|
188
|
+
rkey: extractRkey(C.uri),
|
|
189
|
+
value: C.record,
|
|
190
|
+
author: C.author,
|
|
191
|
+
reason: S.reason,
|
|
192
|
+
replyParent: C.reply?.parent
|
|
193
|
+
}), primePaginatedRecordCache(e, C.uri, C.record), primeDidCache(e, C.author), primeDidCache(e, S.reason?.by), primeDidCache(e, C.reply?.parent?.author), primeAuthorProfileCache(e, C.author), x);
|
|
194
|
+
}, []),
|
|
195
|
+
cursor: S.data.cursor,
|
|
196
|
+
usedAuthorFeed: !0
|
|
197
|
+
};
|
|
198
|
+
} catch {}
|
|
199
|
+
let S = await callListRecords(e.pdsEndpoint, e.did, e.collection, e.limit, e.cursor);
|
|
200
|
+
if (!S.ok) throw Error("Failed to list records from PDS");
|
|
201
|
+
return {
|
|
202
|
+
records: S.data.records.filter((e) => isValidTimestamp(e.value)).map((e) => ({
|
|
203
|
+
uri: e.uri,
|
|
204
|
+
rkey: e.rkey ?? extractRkey(e.uri),
|
|
205
|
+
value: e.value
|
|
206
|
+
})),
|
|
207
|
+
cursor: S.data.cursor,
|
|
208
|
+
usedAuthorFeed: !1
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
function paginatedPageCacheKey(e) {
|
|
212
|
+
return JSON.stringify({
|
|
213
|
+
did: e.did,
|
|
214
|
+
collection: e.collection,
|
|
215
|
+
limit: e.limit,
|
|
216
|
+
cursor: e.cursor ?? "",
|
|
217
|
+
preferAuthorFeed: !!e.preferAuthorFeed,
|
|
218
|
+
authorFeedActor: e.authorFeedActor ?? "",
|
|
219
|
+
authorFeedService: e.authorFeedService,
|
|
220
|
+
authorFeedFilter: e.authorFeedFilter ?? "",
|
|
221
|
+
authorFeedIncludePins: !!e.authorFeedIncludePins
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
function primePaginatedRecordCache(e, x, S) {
|
|
225
|
+
let C = parseAtUriLoose(x);
|
|
226
|
+
if (!C) return;
|
|
227
|
+
let w = {
|
|
228
|
+
record: S,
|
|
229
|
+
source: "appview"
|
|
230
|
+
};
|
|
231
|
+
e.recordCache?.set(C.did, C.collection, C.rkey, w);
|
|
232
|
+
}
|
|
233
|
+
function primeAuthorProfileCache(e, x) {
|
|
234
|
+
if (!x?.did) return;
|
|
235
|
+
let S = {
|
|
236
|
+
record: appviewProfileToRecord(x),
|
|
237
|
+
source: "appview"
|
|
238
|
+
};
|
|
239
|
+
e.recordCache?.set(x.did, "app.bsky.actor.profile", "self", S);
|
|
240
|
+
}
|
|
241
|
+
function primeDidCache(e, x) {
|
|
242
|
+
x?.did && e.didCache?.memoize({
|
|
243
|
+
did: x.did,
|
|
244
|
+
handle: x.handle
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
function parseAtUriLoose(e) {
|
|
248
|
+
let x = e.match(/^at:\/\/([^/]+)\/([^/]+)\/([^/]+)$/);
|
|
249
|
+
if (x) return {
|
|
250
|
+
did: x[1],
|
|
251
|
+
collection: x[2],
|
|
252
|
+
rkey: x[3]
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
async function fetchFromAppview(x, S, C, w) {
|
|
256
|
+
let E = BLUESKY_COLLECTION_TO_ENDPOINT[S];
|
|
257
|
+
if (!E) throw Error(`No appview endpoint mapped for ${S}`);
|
|
258
|
+
let { rpc: D } = await createAtprotoClient({ service: w });
|
|
259
|
+
if (E === "app.bsky.actor.getProfile") {
|
|
260
|
+
let e = await D.get(E, { params: { actor: x } });
|
|
261
|
+
if (!e.ok) throw Error(`Appview ${E} failed for ${x}`);
|
|
262
|
+
return appviewProfileToRecord(e.data);
|
|
263
|
+
}
|
|
264
|
+
if (E === "app.bsky.feed.getPostThread") {
|
|
265
|
+
let e = `at://${x}/${S}/${C}`, w = await D.get(E, { params: {
|
|
266
|
+
uri: e,
|
|
267
|
+
depth: 0
|
|
268
|
+
} });
|
|
269
|
+
if (!w.ok) throw Error(`Appview ${E} failed for ${e}`);
|
|
270
|
+
let T = w.data.thread?.post;
|
|
271
|
+
return T?.record ? (mergePostEmbedCdnUrls(T.record, T.embed), T.record) : void 0;
|
|
272
|
+
}
|
|
273
|
+
throw Error(`Appview endpoint ${E} not implemented`);
|
|
274
|
+
}
|
|
275
|
+
function appviewProfileToRecord(e) {
|
|
276
|
+
let x = {
|
|
277
|
+
displayName: e.displayName,
|
|
278
|
+
description: e.description,
|
|
279
|
+
createdAt: e.createdAt
|
|
280
|
+
};
|
|
281
|
+
e.pronouns && (x.pronouns = e.pronouns), e.website && (x.website = e.website);
|
|
282
|
+
let S = extractCidFromCdnUrl(e.avatar), C = extractCidFromCdnUrl(e.banner);
|
|
283
|
+
return e.avatar && S && (x.avatar = appviewBlob(S, e.avatar)), e.banner && C && (x.banner = appviewBlob(C, e.banner)), x;
|
|
284
|
+
}
|
|
285
|
+
function appviewBlob(e, x) {
|
|
286
|
+
return {
|
|
287
|
+
$type: "blob",
|
|
288
|
+
ref: { $link: e },
|
|
289
|
+
mimeType: "image/jpeg",
|
|
290
|
+
size: 0,
|
|
291
|
+
cdnUrl: x
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
function mergePostEmbedCdnUrls(e, x) {
|
|
295
|
+
if (!x || typeof e != "object" || !e) return;
|
|
296
|
+
let S = e.embed;
|
|
297
|
+
if (!S) return;
|
|
298
|
+
let C = x.$type === "app.bsky.embed.recordWithMedia#view" ? x.media?.images : x.images, T = x.$type === "app.bsky.embed.recordWithMedia#view" ? S.media?.images : S.images;
|
|
299
|
+
!C || !T || T.forEach((e, x) => {
|
|
300
|
+
let S = C[x]?.fullsize;
|
|
301
|
+
if (!S) return;
|
|
302
|
+
let T = extractCidFromCdnUrl(S), E = e.image ?? {}, D = E.ref;
|
|
303
|
+
e.image = {
|
|
304
|
+
...E,
|
|
305
|
+
cdnUrl: S,
|
|
306
|
+
ref: { $link: T ?? D?.$link }
|
|
307
|
+
};
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
function extractRkey(e) {
|
|
311
|
+
let x = e.split("/");
|
|
312
|
+
return x[x.length - 1] ?? e;
|
|
313
|
+
}
|
|
314
|
+
function isValidTimestamp(e) {
|
|
315
|
+
if (typeof e != "object" || !e) return !0;
|
|
316
|
+
let x = e, S = x.createdAt || x.indexedAt;
|
|
317
|
+
if (!S || typeof S != "string") return !0;
|
|
318
|
+
let C = new Date(S);
|
|
319
|
+
return Number.isNaN(C.valueOf()) ? !0 : C.getFullYear() >= 2023;
|
|
320
|
+
}
|
|
321
|
+
export { ensureCachedRecord, extractRkey, fetchBlueskyRecord, fetchBlueskyRecordUncached, fetchLatestRecord, fetchPaginatedRecordsPage, fetchRepositoryRecord, getBlueskyRecord, isValidTimestamp, primeBlueskyFeedCache, primeBlueskyProfileCache };
|
package/dist/rpc.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare function callAppviewRpc<TResponse>(service: string, nsid: string, params: Record<string, unknown>): Promise<{
|
|
2
|
+
ok: boolean;
|
|
3
|
+
data: TResponse;
|
|
4
|
+
}>;
|
|
5
|
+
export declare function callGetRecord<T>(service: string, did: string, collection: string, rkey: string): Promise<{
|
|
6
|
+
ok: boolean;
|
|
7
|
+
data: {
|
|
8
|
+
value: T;
|
|
9
|
+
};
|
|
10
|
+
}>;
|
|
11
|
+
export declare function callListRecords<T>(service: string, did: string, collection: string, limit: number, cursor?: string): Promise<{
|
|
12
|
+
ok: boolean;
|
|
13
|
+
data: {
|
|
14
|
+
records: Array<{
|
|
15
|
+
uri: string;
|
|
16
|
+
rkey?: string;
|
|
17
|
+
value: T;
|
|
18
|
+
}>;
|
|
19
|
+
cursor?: string;
|
|
20
|
+
};
|
|
21
|
+
}>;
|
package/dist/rpc.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createAtprotoClient } from "./client.js";
|
|
2
|
+
async function callAppviewRpc(t, n, r) {
|
|
3
|
+
let { rpc: i } = await createAtprotoClient({ service: t });
|
|
4
|
+
return await i.get(n, { params: r });
|
|
5
|
+
}
|
|
6
|
+
async function callGetRecord(t, n, r, i) {
|
|
7
|
+
let { rpc: a } = await createAtprotoClient({ service: t });
|
|
8
|
+
return await a.get("com.atproto.repo.getRecord", { params: {
|
|
9
|
+
repo: n,
|
|
10
|
+
collection: r,
|
|
11
|
+
rkey: i
|
|
12
|
+
} });
|
|
13
|
+
}
|
|
14
|
+
async function callListRecords(t, n, r, i, a) {
|
|
15
|
+
let { rpc: o } = await createAtprotoClient({ service: t });
|
|
16
|
+
return await o.get("com.atproto.repo.listRecords", { params: {
|
|
17
|
+
repo: n,
|
|
18
|
+
collection: r,
|
|
19
|
+
limit: i,
|
|
20
|
+
cursor: a,
|
|
21
|
+
reverse: !1
|
|
22
|
+
} });
|
|
23
|
+
}
|
|
24
|
+
export { callAppviewRpc, callGetRecord, callListRecords };
|
package/dist/styles.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared, framework-agnostic component styles.
|
|
3
|
+
*
|
|
4
|
+
* This is the single source of truth for how AtProto UI components look. React
|
|
5
|
+
* consumes the camelCase objects directly via `style={...}`; Solid and Svelte
|
|
6
|
+
* use {@link styleString} to render the same values as a `style="..."` string.
|
|
7
|
+
* Theme colors are referenced via CSS variables (see the theme tokens shipped in
|
|
8
|
+
* each package's styles.css) so light/dark theming works uniformly.
|
|
9
|
+
*/
|
|
10
|
+
export type StyleObject = Record<string, string | number>;
|
|
11
|
+
/** Serializes a camelCase style object into a CSS `style="..."` string. */
|
|
12
|
+
export declare function styleString(style: StyleObject): string;
|
|
13
|
+
/** Merges style objects (later wins), for conditional overrides. */
|
|
14
|
+
export declare function mergeStyles(...styles: (StyleObject | undefined | false)[]): StyleObject;
|
|
15
|
+
/** Bluesky profile card. */
|
|
16
|
+
export declare const profileStyles: Record<string, StyleObject>;
|
|
17
|
+
/** Bluesky post card (standalone look). */
|
|
18
|
+
export declare const postStyles: Record<string, StyleObject>;
|
|
19
|
+
/** Bluesky author-feed list (matches React BlueskyPostList). */
|
|
20
|
+
export declare const blueskyPostListStyles: Record<string, StyleObject>;
|
|
21
|
+
/** Generic card + state primitives shared by the simpler record components. */
|
|
22
|
+
export declare const cardStyles: Record<string, StyleObject>;
|
|
23
|
+
/** Tangled repo card (matches React TangledRepoRenderer). */
|
|
24
|
+
export declare const tangledStyles: Record<string, StyleObject>;
|
|
25
|
+
/** Tangled string snippet card (matches React TangledStringRenderer). */
|
|
26
|
+
export declare const tangledStringStyles: Record<string, StyleObject>;
|
|
27
|
+
/** Leaflet document. */
|
|
28
|
+
export declare const leafletStyles: Record<string, StyleObject>;
|
|
29
|
+
/** grain.social gallery. */
|
|
30
|
+
export declare const grainStyles: Record<string, StyleObject>;
|
|
31
|
+
/** teal.fm currently-playing / last-played / song history. */
|
|
32
|
+
export declare const tealStyles: Record<string, StyleObject>;
|
|
33
|
+
/** teal.fm now-playing card (matches React CurrentlyPlayingRenderer). */
|
|
34
|
+
export declare const tealStatusStyles: Record<string, StyleObject>;
|
|
35
|
+
/** teal.fm song history list (matches React SongHistoryList). */
|
|
36
|
+
export declare const songHistoryStyles: Record<string, StyleObject>;
|
|
37
|
+
/** grain.social gallery card (matches React GrainGalleryRenderer). */
|
|
38
|
+
export declare const grainGalleryStyles: Record<string, StyleObject>;
|
|
39
|
+
/** Leaflet document (matches React LeafletDocumentRenderer). */
|
|
40
|
+
export declare const leafletDocStyles: Record<string, StyleObject>;
|