···2020 LexiconTypeID string `json:"$type,const=app.yoten.feed.comment" cborgen:"$type,const=app.yoten.feed.comment"`
2121 Body string `json:"body" cborgen:"body"`
2222 CreatedAt string `json:"createdAt" cborgen:"createdAt"`
2323+ // facets: Annotations of text (mentions, URLs, hashtags, etc)
2424+ Facets []*RichtextFacet `json:"facets,omitempty" cborgen:"facets,omitempty"`
2325 // reply: Indicates that this comment is a reply to another comment.
2426 Reply *FeedComment_Reply `json:"reply,omitempty" cborgen:"reply,omitempty"`
2527 // subject: A reference to the study session being commented on.
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package yoten
44+55+// schema: app.yoten.richtext.facet
66+77+import (
88+ "encoding/json"
99+ "fmt"
1010+1111+ "github.com/bluesky-social/indigo/lex/util"
1212+)
1313+1414+const (
1515+ RichtextFacetNSID = "app.yoten.richtext.facet"
1616+)
1717+1818+// RichtextFacet is a "main" in the app.yoten.richtext.facet schema.
1919+//
2020+// Annotation of a sub-string within rich text.
2121+type RichtextFacet struct {
2222+ Features []*RichtextFacet_Features_Elem `json:"features" cborgen:"features"`
2323+ Index *RichtextFacet_ByteSlice `json:"index" cborgen:"index"`
2424+}
2525+2626+// RichtextFacet_ByteSlice is a "byteSlice" in the app.yoten.richtext.facet schema.
2727+//
2828+// Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets.
2929+type RichtextFacet_ByteSlice struct {
3030+ ByteEnd int64 `json:"byteEnd" cborgen:"byteEnd"`
3131+ ByteStart int64 `json:"byteStart" cborgen:"byteStart"`
3232+}
3333+3434+type RichtextFacet_Features_Elem struct {
3535+ RichtextFacet_Mention *RichtextFacet_Mention
3636+}
3737+3838+func (t *RichtextFacet_Features_Elem) MarshalJSON() ([]byte, error) {
3939+ if t.RichtextFacet_Mention != nil {
4040+ t.RichtextFacet_Mention.LexiconTypeID = "app.yoten.richtext.facet#mention"
4141+ return json.Marshal(t.RichtextFacet_Mention)
4242+ }
4343+ return nil, fmt.Errorf("cannot marshal empty enum")
4444+}
4545+func (t *RichtextFacet_Features_Elem) UnmarshalJSON(b []byte) error {
4646+ typ, err := util.TypeExtract(b)
4747+ if err != nil {
4848+ return err
4949+ }
5050+5151+ switch typ {
5252+ case "app.yoten.richtext.facet#mention":
5353+ t.RichtextFacet_Mention = new(RichtextFacet_Mention)
5454+ return json.Unmarshal(b, t.RichtextFacet_Mention)
5555+5656+ default:
5757+ return nil
5858+ }
5959+}
6060+6161+// RichtextFacet_Mention is a "mention" in the app.yoten.richtext.facet schema.
6262+//
6363+// Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID.
6464+//
6565+// RECORDTYPE: RichtextFacet_Mention
6666+type RichtextFacet_Mention struct {
6767+ LexiconTypeID string `json:"$type,const=app.yoten.richtext.facet#mention" cborgen:"$type,const=app.yoten.richtext.facet#mention"`
6868+ Did string `json:"did" cborgen:"did"`
6969+}