···2929bro idk what this is anymore but im a fan of it and will keep going
30303131i really gotta stop using Node.wraps...
3232-that literally means that my implementation around it is inadequate3232+that literally means that my implementation around it is inadequate
3333+3434+i hate git sometimes
···11+import { Body, Button, Column, Label } from "@/domlink.ts";
22+33+const display = new Label("Number: 0");
44+let number = 0;
55+Body.with(
66+ new Column().with(
77+ new Button("Increment!", ()=>{
88+ display.text = `Number: ${++number}`;
99+ })
1010+ )
1111+);
+5-1
src/support/atproto.ts
···99 return NSIDExpression.test(nsid) ? nsid : null;
1010}
11111212+export type Handle = string;
1313+export function StripHandle(handle: Handle) {
1414+ return handle.replace("@", "");
1515+}
1216export type DID = `did:${"web"|"plc"}:${string}`;
1317export function ValidateDID(did: string): string | null {
1418 const parts = did.split(":");
···70747175// technically you can cast it to whatever you want but i feel like using a generic(?) makes it cleaner
7276/** Calls an XRPC "query" method (HTTP GET)
7373- * @param service Defaults to {@link https://slingshot.microcosm.blue Slingshot}.
7777+ * @param service Defaults to the {@link https://api.bsky.app/ Bluesky (PBC) API} service.
7478*/
7579export async function XQuery<T>(method: string, params: Record<string, string | number | null> | null = null, service: string = DEFAULT_SERVICE) {
7680 let QueryURL = `${service}/xrpc/${method}`;
+8-7
src/support/bluesky.ts
···11import { AppBskyFeedDefs } from "@atcute/bluesky";
22import { AtURI, DID } from "./atproto.ts";
33import * as Constellation from "./constellation.ts";
44-import { getUriRecord, resolveHandle } from "./slingshot.ts";
44+import { getUriRecord } from "./slingshot.ts";
55+import { DocProxy } from "./caching.ts";
5667export type FeedResponse = {
78 feed: AppBskyFeedDefs.FeedViewPost[];
···1920 const url = new URL(link);
2021 const parts = url.pathname.split("/").splice(1);
2122 console.log(parts);
2222- let handle = parts[1];
2323+ let id = parts[1];
2324 if (resolve) {
2424- handle = (await resolveHandle(handle)).toString();
2525+ id = (await DocProxy.get(id)).handle;
2526 }
2627 if (parts[0] == "profile" && parts.length >= 2) {
2727- if (parts.length == 2) return new AtURI(handle);
2828- if (parts.length == 4) return new AtURI(handle, partMap.get(parts[2])!, parts[3]);
2828+ if (parts.length == 2) return new AtURI(id);
2929+ if (parts.length == 4) return new AtURI(id, partMap.get(parts[2])!, parts[3]);
2930 }
3030- if (parts[0] == "starter-pack" && parts.length == 3) return new AtURI(handle, "app.bsky.graph.starterpack", parts[2]);
3131+ if (parts[0] == "starter-pack" && parts.length == 3) return new AtURI(id, "app.bsky.graph.starterpack", parts[2]);
3132 throw new Error("URL provided is not under /profile nor /starter-pack");
3233}
3334···4243 createdAt: Date;
4344};
4445export async function GetListItems(list: AtURI) {
4545- return (await Promise.all((await Constellation.getLinks(list, "app.bsky.graph.listitem", ".list"))
4646+ return (await Promise.all((await Constellation.getLinks(list.toString()!, "app.bsky.graph.listitem", ".list"))
4647 .map(async x=>await getUriRecord<ListItem>(x))));
4748}