a tool for shared writing and social publishing
1import { LexiconDoc } from "@atproto/lexicon";
2import { PubLeafletRichTextFacet } from "./facet";
3
4export const PubLeafletComment: LexiconDoc = {
5 lexicon: 1,
6 id: "pub.leaflet.comment",
7 revision: 1,
8 description: "A lexicon for comments on documents",
9 defs: {
10 main: {
11 type: "record",
12 key: "tid",
13 description: "Record containing a comment",
14 record: {
15 type: "object",
16 required: ["subject", "plaintext", "createdAt"],
17 properties: {
18 subject: { type: "string", format: "at-uri" },
19 createdAt: { type: "string", format: "datetime" },
20 reply: { type: "ref", ref: "#replyRef" },
21 plaintext: { type: "string" },
22 facets: {
23 type: "array",
24 items: { type: "ref", ref: PubLeafletRichTextFacet.id },
25 },
26 onPage: { type: "string" },
27 attachment: { type: "union", refs: ["#linearDocumentQuote"] },
28 },
29 },
30 },
31 linearDocumentQuote: {
32 type: "object",
33 required: ["document", "quote"],
34 properties: {
35 document: { type: "string", format: "at-uri" },
36 quote: { type: "ref", ref: "pub.leaflet.pages.linearDocument#quote" },
37 },
38 },
39 replyRef: {
40 type: "object",
41 required: ["parent"],
42 properties: {
43 parent: { type: "string", format: "at-uri" },
44 },
45 },
46 },
47};