a tool for shared writing and social publishing
1import { LexiconDoc } from "@atproto/lexicon";
2import { ColorUnion, PubLeafletThemeBackgroundImage } from "./theme";
3
4export const PubLeafletPublication: LexiconDoc = {
5 lexicon: 1,
6 id: "pub.leaflet.publication",
7 defs: {
8 main: {
9 type: "record",
10 key: "tid",
11 description: "Record declaring a publication",
12 record: {
13 type: "object",
14 required: ["name"],
15 properties: {
16 name: { type: "string", maxLength: 2000 },
17 base_path: { type: "string" },
18 description: { type: "string", maxLength: 2000 },
19 icon: { type: "blob", accept: ["image/*"], maxSize: 1000000 },
20 theme: { type: "ref", ref: "#theme" },
21 preferences: { type: "ref", ref: "#preferences" },
22 },
23 },
24 },
25 preferences: {
26 type: "object",
27 properties: {
28 showInDiscover: { type: "boolean", default: true },
29 showComments: { type: "boolean", default: true },
30 showMentions: { type: "boolean", default: true },
31 showPrevNext: { type: "boolean", default: true },
32 },
33 },
34 theme: {
35 type: "object",
36 properties: {
37 backgroundColor: ColorUnion,
38 backgroundImage: {
39 type: "ref",
40 ref: PubLeafletThemeBackgroundImage.id,
41 },
42 pageWidth: {
43 type: "integer",
44 minimum: 0,
45 maximum: 1600,
46 },
47 primary: ColorUnion,
48 pageBackground: ColorUnion,
49 showPageBackground: { type: "boolean", default: false },
50 accentBackground: ColorUnion,
51 accentText: ColorUnion,
52 },
53 },
54 },
55};
56
57export const PubLeafletPublicationSubscription: LexiconDoc = {
58 lexicon: 1,
59 id: "pub.leaflet.graph.subscription",
60 defs: {
61 main: {
62 type: "record",
63 key: "tid",
64 description: "Record declaring a subscription to a publication",
65 record: {
66 type: "object",
67 required: ["publication"],
68 properties: {
69 publication: { type: "string", format: "at-uri" },
70 },
71 },
72 },
73 },
74};