···11+// real comment data pulled from tangled.org/tangled.org/core/issues/245, used across
22+// the comment stories so the fixtures live in one place.
33+import type { MarkupContext } from "$lib/markup";
44+import type { CommentThread, CommentView } from "./comments";
55+66+export const sampleMarkup: MarkupContext = {
77+ repo: "tangled.org/core",
88+ ref: "main",
99+ host: "tangled.org"
1010+};
1111+1212+export const sampleSubjectUri = "at://did:plc:xan/sh.tangled.repo.issue/245";
1313+export const sampleSubjectCid = "bafyreib2rxk3rh6kzwq6yhkp6bd4vjxj3xj2xj2xj2xj2xj2xj2xj2xj4";
1414+1515+const cid = "bafyreib2rxk3rh6kzwq6yhkp6bd4vjxj3xj2xj2xj2xj2xj2xj2xj2xj2";
1616+1717+const c = (
1818+ rkey: string,
1919+ authorDid: string,
2020+ authorHandle: string,
2121+ createdAt: string,
2222+ body: string,
2323+ bodyHtml: string
2424+): CommentView => ({
2525+ uri: `at://${authorDid}/sh.tangled.feed.comment/${rkey}`,
2626+ cid,
2727+ rkey,
2828+ authorDid,
2929+ authorHandle,
3030+ createdAt,
3131+ body,
3232+ bodyHtml
3333+});
3434+3535+export const sampleComments = {
3636+ byjp: c(
3737+ "byjp",
3838+ "did:plc:byjp",
3939+ "byjp.me",
4040+ "2024-10-02T09:15:00Z",
4141+ `I'm on the cusp, but I reacted "👎", as:
4242+4343+- I quite like the "@"!
4444+- it clearly differentiates between user stuff, and site stuff; \`tangled.org/settings\` vs. \`tangled.org/@settings.in\`
4545+- it feels quite "ATProto" to have an AT☺️
4646+4747+Plus I think I'd keep the @s in the UI anyway (eg. in the header of a repo page "[@tangled.org](/tangled.org)/core") — so then the URLs would match what's displayed.`,
4848+ `<p>I'm on the cusp, but I reacted "👎", as:</p>
4949+<ul>
5050+<li>I quite like the "@"!</li>
5151+<li>it clearly differentiates between user stuff, and site stuff; <code>tangled.org/settings</code> vs. <code>tangled.org/@settings.in</code></li>
5252+<li>it feels quite "ATProto" to have an AT☺️</li>
5353+</ul>
5454+<p>Plus I think I'd keep the @s in the UI anyway (eg. in the header of a repo page "<a href="/tangled.org">@tangled.org</a>/core") — so then the URLs would match what's displayed.</p>`
5555+ ),
5656+ cam: c(
5757+ "cam",
5858+ "did:plc:cam",
5959+ "camsmith.dev",
6060+ "2024-10-02T11:00:00Z",
6161+ `I also found these two reasons convincing enough to vote in favor of removal.
6262+6363+One small, silly side effect of this will be that the address for tangled itself will be tangled.org/tangled.org`,
6464+ `<p>I also found these two reasons convincing enough to vote in favor of removal.</p>
6565+<p>One small, silly side effect of this will be that the address for tangled itself will be tangled.org/tangled.org</p>`
6666+ ),
6767+ samuel: c(
6868+ "samuel",
6969+ "did:plc:samuel",
7070+ "samuel.fm",
7171+ "2024-10-03T08:20:00Z",
7272+ "I vote removing them. You can tell if it's a handle by the presence of the `.`s",
7373+ "<p>I vote removing them. You can tell if it's a handle by the presence of the <code>.</code>s</p>"
7474+ ),
7575+ moth: c(
7676+ "moth",
7777+ "did:plc:moth",
7878+ "moth11.net",
7979+ "2024-10-03T14:05:00Z",
8080+ "i vote yes, i'm probably stupid but i dont think go modules like there being @s in the url so i just use github, i'm sure theres a way around it, but its best to minimize friction",
8181+ "<p>i vote yes, i'm probably stupid but i dont think go modules like there being @s in the url so i just use github, i'm sure theres a way around it, but its best to minimize friction</p>"
8282+ ),
8383+ anirudh: c(
8484+ "anirudh",
8585+ "did:plc:anirudh",
8686+ "anirudh.fi",
8787+ "2024-10-04T10:00:00Z",
8888+ "For what it's worth, we've always supported the non-@ URL as well. We just redirect it to the @'d version—which Go seems to be content with.",
8989+ "<p>For what it's worth, we've always supported the non-@ URL as well. We just redirect it to the @'d version—which Go seems to be content with.</p>"
9090+ ),
9191+ knowtheory: c(
9292+ "knowtheory",
9393+ "did:plc:knowtheory",
9494+ "knowtheory.net",
9595+ "2024-10-05T16:30:00Z",
9696+ `So i'm a 👍 I dig the poetry of having an @ in the URI, but mostly i think it's confusing. This isn't a practice the other Apps & AppServers use. It's also confusing because an AT:// URI is something distinct and different.
9797+9898+And just personally, it's a URL eyesore for me.`,
9999+ `<p>So i'm a 👍 I dig the poetry of having an @ in the URI, but mostly i think it's confusing. This isn't a practice the other Apps & AppServers use. It's also confusing because an AT:// URI is something distinct and different.</p>
100100+<p>And just personally, it's a URL eyesore for me.</p>`
101101+ ),
102102+ anil: c(
103103+ "anil",
104104+ "did:plc:anil",
105105+ "anil.recoil.org",
106106+ "2024-11-10T12:00:00Z",
107107+ "This has tripped me up quite a few times on the SSH URLs with extraneous @s, so thank you for making this change!",
108108+ "<p>This has tripped me up quite a few times on the SSH URLs with extraneous @s, so thank you for making this change!</p>"
109109+ ),
110110+ // authored by the story's logged-in user (MockAuthProvider = did:plc:alice), for edit cases
111111+ mine: c(
112112+ "mine",
113113+ "did:plc:alice",
114114+ "alice.pds.tngl.boltless.dev",
115115+ "2024-10-06T09:00:00Z",
116116+ "I vote removing them. You can tell if it's a handle by the presence of the `.`s",
117117+ "<p>I vote removing them. You can tell if it's a handle by the presence of the <code>.</code>s</p>"
118118+ )
119119+};
120120+121121+// a top-level comment on its own
122122+export const soloThread: CommentThread = { self: sampleComments.byjp, replies: [] };
123123+124124+// a thread with a couple of replies
125125+export const sampleThread: CommentThread = {
126126+ self: sampleComments.byjp,
127127+ replies: [sampleComments.cam, sampleComments.samuel]
128128+};
129129+130130+export const sampleThreads: CommentThread[] = [
131131+ sampleThread,
132132+ { self: sampleComments.knowtheory, replies: [] }
133133+];
134134+135135+// more than one reply, to show the connector line running down the replies
136136+export const multiReplyThread: CommentThread = {
137137+ self: sampleComments.byjp,
138138+ replies: [sampleComments.cam, sampleComments.samuel, sampleComments.moth]
139139+};
140140+141141+// a long thread whose middle reply belongs to the logged-in user (for edit-in-place)
142142+export const longThread: CommentThread = {
143143+ self: sampleComments.byjp,
144144+ replies: [
145145+ sampleComments.cam,
146146+ sampleComments.moth,
147147+ sampleComments.mine,
148148+ sampleComments.anirudh,
149149+ sampleComments.anil
150150+ ]
151151+};