{
"id": "social.coves.richtext.facet",
"defs": {
"bold": {
"type": "object",
"description": "Bold text formatting"
},
"code": {
"type": "object",
"description": "Inline code span rendered in monospace. Writers strip the source markup markers (e.g. backticks); the annotated text is the literal code."
},
"link": {
"type": "object",
"required": [
"uri"
],
"properties": {
"uri": {
"type": "string",
"format": "uri",
"description": "Target URI of the link"
}
},
"description": "Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL."
},
"main": {
"type": "object",
"required": [
"index",
"features"
],
"properties": {
"index": {
"ref": "#byteSlice",
"type": "ref"
},
"features": {
"type": "array",
"items": {
"refs": [
"#mention",
"#link",
"#bold",
"#italic",
"#strikethrough",
"#spoiler",
"#blockquote",
"#heading",
"#code",
"#codeBlock"
],
"type": "union"
},
"maxLength": 20,
"description": "Features applied to this text range. This union is open: readers MUST render the annotated text as plain text when they do not recognize a feature's $type. Ranges of different block types may nest by containment (e.g. a codeBlock inside a blockquote); only blockquote-in-blockquote containment is disallowed (nested quotes use disjoint ranges with increasing level)."
}
},
"description": "Annotation of a sub-string within rich text"
},
"italic": {
"type": "object",
"description": "Italic text formatting"
},
"heading": {
"type": "object",
"required": [
"level"
],
"properties": {
"level": {
"type": "integer",
"maximum": 6,
"minimum": 1,
"description": "Heading level, 1 (largest) through 6"
}
},
"description": "Section heading. The range must span a single whole line (excluding the trailing newline); readers encountering a range that does not should extend it to the enclosing line boundaries. Writers strip the source markup markers (e.g. Markdown '#'); the text is canonical and must remain readable without this facet."
},
"mention": {
"type": "object",
"required": [
"did"
],
"properties": {
"did": {
"type": "string",
"format": "did",
"description": "DID of the mentioned user or community"
}
},
"description": "Facet feature for mention of a user or community. The text is usually a handle with '@' (user) or '!' (community) prefix, but the facet reference is a DID."
},
"spoiler": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"maxLength": 128,
"description": "Optional explanation of what's hidden",
"maxGraphemes": 32
}
},
"description": "Hidden/spoiler text that requires user interaction to reveal"
},
"byteSlice": {
"type": "object",
"required": [
"byteStart",
"byteEnd"
],
"properties": {
"byteEnd": {
"type": "integer",
"minimum": 0,
"description": "Exclusive end position in UTF-8 bytes"
},
"byteStart": {
"type": "integer",
"minimum": 0,
"description": "Inclusive start position in UTF-8 bytes"
}
},
"description": "Specifies the sub-string range via byte indices"
},
"codeBlock": {
"type": "object",
"properties": {
"language": {
"type": "string",
"maxLength": 40,
"description": "Optional language hint for syntax highlighting (e.g. 'go', 'python')"
}
},
"description": "Block of preformatted code rendered in monospace with whitespace preserved. The range must span whole lines (excluding the trailing newline); readers encountering a range that does not should extend it to the enclosing line boundaries. Writers strip the source fence markers (e.g. Markdown ```); the annotated text is the literal code."
},
"blockquote": {
"type": "object",
"properties": {
"level": {
"type": "integer",
"maximum": 6,
"minimum": 1,
"description": "Quote nesting depth. Absent means 1."
}
},
"description": "Block-level quotation. The range must span whole lines: from the first byte of the first quoted line through the last content byte of the last quoted line, excluding the trailing newline. Readers encountering a range that does not span whole lines should extend the block to the enclosing line boundaries. Consecutive quoted lines at the same depth should be covered by a single facet; readers should render adjacent same-level quote facets as separate blocks. Nested quotes are expressed as disjoint ranges with increasing level values, not by nesting ranges. Writers must clamp source nesting deeper than 6 to level 6, and strip the source markup markers (e.g. Markdown '>'); the text is canonical and must remain readable without this facet."
},
"strikethrough": {
"type": "object",
"description": "Strikethrough text formatting"
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}