mirror of
https://github.com/versia-pub/docs.git
synced 2025-12-06 06:18:19 +01:00
feat: ✨ Add Reactions extension
This commit is contained in:
parent
04b03e136b
commit
10b6ca1fe9
95
app/extensions/reactions/page.mdx
Normal file
95
app/extensions/reactions/page.mdx
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
export const metadata = {
|
||||
title: "Reactions Extension",
|
||||
description: "The Reactions Extension allows users to react to posts with emojis",
|
||||
}
|
||||
|
||||
# Reactions Extension
|
||||
|
||||
The Reactions Extension allows users to express their reactions ("react") to posts with emojis. {{ className: 'lead' }}
|
||||
|
||||
## Federation
|
||||
|
||||
User reactions are (like every other entity) federated to all followers, and can be displayed to clients depending on the privacy settings of the associated [Note](/entities/note).
|
||||
|
||||
## Entity Definition
|
||||
|
||||
<Row>
|
||||
<Col>
|
||||
<Properties>
|
||||
<Property name="extension_type" type="string" required>
|
||||
Must be `pub.versia:reactions/Reaction`.
|
||||
</Property>
|
||||
<Property name="author" type="string" required>
|
||||
URI of the [User](/entities/user) that is reacting.
|
||||
</Property>
|
||||
<Property name="object" type="string" required>
|
||||
URI of the [Note](/entities/note) attached to the reaction.
|
||||
</Property>
|
||||
<Property name="content" type="string" required>
|
||||
Emoji content of reaction. May also be arbitrary text, or [Custom Emoji](/extensions/custom-emojis) if supported.
|
||||
|
||||
Clients are encouraged to disfavour text in favour of emoji where possible.
|
||||
</Property>
|
||||
</Properties>
|
||||
</Col>
|
||||
|
||||
<Col sticky>
|
||||
|
||||
```jsonc {{ title: "Example Entity" }}
|
||||
{
|
||||
"id": "6f27bc77-58ee-4c9b-b804-8cc1c1182fa9",
|
||||
"type": "Extension", // [!code focus:2]
|
||||
"extension_type": "pub.versia:reactions/Reaction",
|
||||
"uri": "https://example.com/actions/6f27bc77-58ee-4c9b-b804-8cc1c1182fa9",
|
||||
"created_at": "2021-01-01T00:00:00.000Z",
|
||||
"author": "https://example.com/users/6e0204a2-746c-4972-8602-c4f37fc63bbe", // [!code focus:3]
|
||||
"object": "https://example.com/publications/f08a124e-fe90-439e-8be4-15a428a72a19",
|
||||
"content": "😀",
|
||||
}
|
||||
```
|
||||
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
## Extensions to Note
|
||||
|
||||
The Reactions Extension extends the [Note](/entities/note) entity with the following fields:
|
||||
|
||||
<Row>
|
||||
<Col>
|
||||
<Properties>
|
||||
<Property name="reactions" type="array" required>
|
||||
URI to a [Collection](/entities/collection) of the [Reactions](#entity-definition) attached to the note.
|
||||
</Property>
|
||||
</Properties>
|
||||
</Col>
|
||||
|
||||
<Col sticky>
|
||||
|
||||
```jsonc {{ title: "Example Note" }}
|
||||
{
|
||||
"id": "01902e09-0f8b-72de-8ee3-9afc0cf5eae1",
|
||||
"type": "Note", // [!code focus]
|
||||
"uri": "https://versia.social/notes/01902e09-0f8b-72de-8ee3-9afc0cf5eae1",
|
||||
"created_at": "2024-06-19T01:07:44.139Z",
|
||||
"author": "https://versia.social/users/018eb863-753f-76ff-83d6-fd590de7740a",
|
||||
"category": "microblog",
|
||||
"content": {
|
||||
"text/plain": {
|
||||
"content": "Bababooey."
|
||||
}
|
||||
},
|
||||
"extensions": { // [!code focus:5]
|
||||
"pub.versia:reactions": {
|
||||
"reactions": "https://versia.social/notes/01902e09-0f8b-72de-8ee3-9afc0cf5eae1/reactions"
|
||||
}
|
||||
},
|
||||
"group": "public",
|
||||
"is_sensitive": false,
|
||||
"mentions": [],
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
</Col>
|
||||
</Row>
|
||||
|
|
@ -290,6 +290,8 @@ export const navigation: NavGroup[] = [
|
|||
links: [
|
||||
{ title: "Custom Emojis", href: "/extensions/custom-emojis" },
|
||||
{ title: "Likes", href: "/extensions/likes" },
|
||||
{ title: "Polls", href: "/extensions/polls" },
|
||||
{ title: "Reactions", href: "/extensions/reactions" },
|
||||
{ title: "Share", href: "/extensions/share" },
|
||||
{ title: "Vanity", href: "/extensions/vanity" },
|
||||
{ title: "WebSockets", href: "/extensions/websockets" },
|
||||
|
|
|
|||
Loading…
Reference in a new issue