An `Action` or a `Link` that asks first (`confirm`) takes `answer`: the words of the alert's button that answers it, in place of its label, so a long label isn't said twice (a group's Make galleries members-only, answered by Make members-only). Its words may be made of the data, as a label's are; words that read nothing, or only blanks, leave the button its label. A kit older than 0.32.0 ignores it and answers with the label.
notes: "Exactly one of href or open, but for a share made whole by its template. href: an at-uri opens the record in place; a DID or handle its repository; an https URL the host's browser. open takes List's forms, as a query to call ({ \"query\": \"com.example.getRepo\", \"params\": { \"repo\": { \"$\": \"uri\" } } }), and a link with open draws only when its label resolves, as its words alone where a param resolves to nothing; with sheet: true its screen opens over what is open (a story's comments over the story); with root: true (a List's open too) its screen is chosen in its tab's root's place, as a strip's tab is, where the strip its answer draws offers it and that tab's root (a feed opened from My feeds), else it opens over what is open. With compose its screen opens at a form: true its first Compose, a string the one of that label, or (since 0.25.0) { \"label\": \"New gallery\", \"values\": { \"to\": { \"$\": \"actor.did\" } } }, that form opened holding values, each a field's by its name, read as a param is: a text's or a line's words, a choice's option of that value picked (a group's Add a gallery, New gallery at Post to that group); a value no field takes, or a disabled option's, is left out, and one holding nothing too. A link whose open is the host's ({ \"host\": \"signOut\" }) draws nothing where its host does not do it. style button draws it as a button (a profile's Message), name as an account's name beside its picture (in the text's own colour, bold), muted in the muted text's colour and size, on one line cut with an ellipsis (a gallery's location under its author), icon as its icon alone, as quiet as a Stat beside it, its label read aloud (a gallery's Share after its favorites and comments), link (the default) as words. icon is drawn before its words, and alone in a Bar or over a Slides' picture, its label then read aloud. share, an https address that href's value ends, makes it a way to share that address (the host's share sheet, else copied, the web saying so) rather than to open it: a profile's Share ({ \"label\": \"Share profile\", \"href\": { \"$\": \"actor.handle\" }, \"share\": \"https://grain.social/profile/\" }); share may instead be the whole address, {\"$join\": [parts]} of strings and the item's templates, with no href: a gallery's Share ({ \"label\": \"Share\", \"icon\": \"send\", \"style\": \"icon\", \"share\": { \"$join\": [\"https://grain.social/profile/\", { \"$\": [\"creator.handle\", \"creator.did\"] }, \"/gallery/\", { \"$rkey\": \"uri\" }] } }), drawn only where every part resolves. copy, text put before href's value, makes it a way to copy that text rather than to open it: a profile's Copy handle ({ \"label\": \"Copy handle\", \"href\": { \"$\": \"actor.handle\" }, \"copy\": \"@\" }). fragment, a path to a DID, opens href's https address (with no fragment of its own) with that DID as its fragment, then + and the signed-in person's DID where one is signed in, as Germ asks of its messageMeUrl; where the path holds no DID, nothing is drawn ({ \"label\": \"Message on Germ\", \"href\": { \"$\": \"joins.profile.messageMe.messageMeUrl\" }, \"fragment\": \"actor.did\" }). disabled, true or a binding that holds something, draws it greyed, opening nothing, and reason, words or a binding, muted under it while it is disabled, as an Action's (a group's last admin's Leave group, { \"disabled\": { \"$\": \"lastAdmin\" }, \"reason\": \"You're the only admin. Make someone else an admin first.\" }); a kit older than their since is sent nothing in a disabled link's place. confirm (since 0.29.0), words or words made of the data, is asked first as an Action's confirm is, its label the button that opens it, on a link that opens something (not share or copy): a group's Make galleries members-only ({ \"label\": \"Make galleries members-only\", \"href\": { \"$\": \"viewer.membersOnlyUrl\" }, \"confirm\": \"Only members will see this group's galleries. This can't be undone.\" }); words that read nothing draw nothing, never a link that opens unasked, and a kit older than its since is sent nothing in its place.",
notes: "Exactly one of href or open, but for a share made whole by its template. href: an at-uri opens the record in place; a DID or handle its repository; an https URL the host's browser. open takes List's forms, as a query to call ({ \"query\": \"com.example.getRepo\", \"params\": { \"repo\": { \"$\": \"uri\" } } }), and a link with open draws only when its label resolves, as its words alone where a param resolves to nothing; with sheet: true its screen opens over what is open (a story's comments over the story); with root: true (a List's open too) its screen is chosen in its tab's root's place, as a strip's tab is, where the strip its answer draws offers it and that tab's root (a feed opened from My feeds), else it opens over what is open. With compose its screen opens at a form: true its first Compose, a string the one of that label, or (since 0.25.0) { \"label\": \"New gallery\", \"values\": { \"to\": { \"$\": \"actor.did\" } } }, that form opened holding values, each a field's by its name, read as a param is: a text's or a line's words, a choice's option of that value picked (a group's Add a gallery, New gallery at Post to that group); a value no field takes, or a disabled option's, is left out, and one holding nothing too. A link whose open is the host's ({ \"host\": \"signOut\" }) draws nothing where its host does not do it. style button draws it as a button (a profile's Message), name as an account's name beside its picture (in the text's own colour, bold), muted in the muted text's colour and size, on one line cut with an ellipsis (a gallery's location under its author), icon as its icon alone, as quiet as a Stat beside it, its label read aloud (a gallery's Share after its favorites and comments), link (the default) as words. icon is drawn before its words, and alone in a Bar or over a Slides' picture, its label then read aloud. share, an https address that href's value ends, makes it a way to share that address (the host's share sheet, else copied, the web saying so) rather than to open it: a profile's Share ({ \"label\": \"Share profile\", \"href\": { \"$\": \"actor.handle\" }, \"share\": \"https://grain.social/profile/\" }); share may instead be the whole address, {\"$join\": [parts]} of strings and the item's templates, with no href: a gallery's Share ({ \"label\": \"Share\", \"icon\": \"send\", \"style\": \"icon\", \"share\": { \"$join\": [\"https://grain.social/profile/\", { \"$\": [\"creator.handle\", \"creator.did\"] }, \"/gallery/\", { \"$rkey\": \"uri\" }] } }), drawn only where every part resolves. copy, text put before href's value, makes it a way to copy that text rather than to open it: a profile's Copy handle ({ \"label\": \"Copy handle\", \"href\": { \"$\": \"actor.handle\" }, \"copy\": \"@\" }). fragment, a path to a DID, opens href's https address (with no fragment of its own) with that DID as its fragment, then + and the signed-in person's DID where one is signed in, as Germ asks of its messageMeUrl; where the path holds no DID, nothing is drawn ({ \"label\": \"Message on Germ\", \"href\": { \"$\": \"joins.profile.messageMe.messageMeUrl\" }, \"fragment\": \"actor.did\" }). disabled, true or a binding that holds something, draws it greyed, opening nothing, and reason, words or a binding, muted under it while it is disabled, as an Action's (a group's last admin's Leave group, { \"disabled\": { \"$\": \"lastAdmin\" }, \"reason\": \"You're the only admin. Make someone else an admin first.\" }); a kit older than their since is sent nothing in a disabled link's place. confirm (since 0.29.0), words or words made of the data, is asked first as an Action's confirm is, its answer (since 0.32.0, words as its label is) the button that opens it, else its label, on a link that opens something (not share or copy): a group's Make galleries members-only ({ \"label\": \"Make galleries members-only\", \"href\": { \"$\": \"viewer.membersOnlyUrl\" }, \"confirm\": \"Only members will see this group's galleries. This can't be undone.\", \"answer\": \"Make members-only\" }); words that read nothing draw nothing, never a link that opens unasked, and a kit older than its since is sent nothing in its place.",
notes: "A button that writes as the signed-in account: create makes a record ({ collection, record, space? }; the record's values may be bindings, {\"$now\": true} for the current time, {\"$strongRef\": path} for { uri, cid } of the record or view at path, {\"$rkey\": path} for the record key of the at-uri at path, {\"$root\": path} read from the view's own scope, {\"$first\": [values]}, the first of 2 to 4 that resolves, or {\"$merge\": [values]}, 2 to 4 objects merged, the later's fields winning; the record may be bound whole too, a binding, {\"$root\": path} or a $merge, as a query join's answer holds it: { \"$merge\": [{ \"$root\": \"joins.crossPost.post\" }, { \"createdAt\": { \"$now\": true } }] }, drawn only where it is an object; space, in a bundled view alone, { type, at }, makes it in the account's repo in a permissioned space rather than its own repository: type the space's type (an NSID), at a binding or {\"$root\": path} to the space's at-uri or its authority's DID (its space of that type keyed self), as a favorite in a group's pool { \"type\": \"social.grain.group.pool\", \"at\": { \"$root\": \"joins.group.did\" } }; where at holds nothing, in the account's own repository, so one view serves both; one holding a space of another type draws an error and writes nothing; a kit before 0.25.0, which would not send the space, is sent no such Action), delete deletes the record whose uri it binds ({ uri: binding }, in the account's own repository or its repo in a space); exactly one of them, or, in a bundled view alone, interaction ({ event: app.bsky.feed.defs#requestMore or #requestLess }), which tells a feed more or less like the item, or call ({ method, service, input? }), which calls a procedure of the service through the account's PDS, its input a template as create's record is, as { \"method\": \"chat.bsky.convo.updateRead\", \"service\": \"did:web:api.bsky.chat#bsky_chat\", \"input\": { \"convoId\": { \"$\": \"id\" } } }, or deletes ({ method, service, params?, repeat?, collections?, then? }), which asks a query of the service, as the account, for a deletion plan, its params a template as call's input, and deletes what it answers, { writes: [{ collection, rkey }] }, the deletes of one com.atproto.repo.applyWrites, in the account's own repository at once, all or none (a gallery with its photos, as { \"method\": \"social.grain.gallery.getDeletionPlan\", \"service\": \"did:web:grain.social#grain_appview\", \"params\": { \"gallery\": { \"$\": \"response.gallery.uri\" } } }); with repeat true it asks again until a plan comes back empty, deleting an account's data a part at a time as the button counts the records gone, from the operator's own pages and apps alone; then ({ method, service, input? }, its input literal but {\"$did\": true}, the account's DID) is called once nothing is left, as the app's server forgetting the account; collections names the collections its deletes may reach beyond those the views write, which HUD asks at sign-in to delete. done is the label after it succeeds; a created record's button then deletes it again. existing (with create) binds the at-uri of the record the account already made, as an AppView's post.viewer.like: the button then starts done, and a click deletes that record. count binds how many there are, as post.likeCount: the button is then drawn as its icon and that number, counting it up or down as it is done or undone, its label read aloud, and where nothing can write it is drawn as a Stat of that number; no Stat of the same number goes beside it. closed binds whether it is closed (true): then it is drawn as a Stat of its count, or nothing. icon check and x (since 0.25.0, left out for an older kit, which draws its words alone) mark a group's Joined and a request's Cancel. style button draws it as a button of its own, filled until done and outlined once done, as a profile's Follow and Following; style outline (since 0.25.0) as a button of its own outlined, done or not, as a done one is, for a state a tap undoes, as a group's Requested with a call and a confirm (a kit before 0.25.0 draws it as style button); style row draws it as a row of a List with style rows, the whole width, its label a row's words, joining the rows of a List or of row Actions right before it in a Stack with gap none, as Settings' Delete account after Sign out. confirm is a question asked first (\"Block @alice?\"), in a bundled view too; tone danger draws it in the danger colour (Block, Delete). leave true closes the screen it is on once it succeeds, as deleting the gallery shown; reload true reads the view again once it succeeds, as deleting a comment in it. signOut true signs the account out of the app once it succeeds, as deleting one's account (an Action with it draws only where the host signs out); handle binds the account's handle, which the person types to confirm (with confirm). disabled, true or a binding that holds something, draws it greyed and doing nothing (in a Menu too, a row greyed), and reason, words or a binding, muted and smaller under it while it is disabled, read as its description (a group's last admin's Step down as admin, { \"disabled\": { \"$\": \"lastAdmin\" }, \"reason\": \"You're the only admin. Make someone else an admin first.\" }); a kit older than their since is sent nothing in a disabled action's place. A view that is not bundled asks the person to confirm, showing the record. Signed out, the first click asks the host to sign in. To write what a person types (a reply, a post), use Compose.",
notes: "A button that writes as the signed-in account: create makes a record ({ collection, record, space? }; the record's values may be bindings, {\"$now\": true} for the current time, {\"$strongRef\": path} for { uri, cid } of the record or view at path, {\"$rkey\": path} for the record key of the at-uri at path, {\"$root\": path} read from the view's own scope, {\"$first\": [values]}, the first of 2 to 4 that resolves, or {\"$merge\": [values]}, 2 to 4 objects merged, the later's fields winning; the record may be bound whole too, a binding, {\"$root\": path} or a $merge, as a query join's answer holds it: { \"$merge\": [{ \"$root\": \"joins.crossPost.post\" }, { \"createdAt\": { \"$now\": true } }] }, drawn only where it is an object; space, in a bundled view alone, { type, at }, makes it in the account's repo in a permissioned space rather than its own repository: type the space's type (an NSID), at a binding or {\"$root\": path} to the space's at-uri or its authority's DID (its space of that type keyed self), as a favorite in a group's pool { \"type\": \"social.grain.group.pool\", \"at\": { \"$root\": \"joins.group.did\" } }; where at holds nothing, in the account's own repository, so one view serves both; one holding a space of another type draws an error and writes nothing; a kit before 0.25.0, which would not send the space, is sent no such Action), delete deletes the record whose uri it binds ({ uri: binding }, in the account's own repository or its repo in a space); exactly one of them, or, in a bundled view alone, interaction ({ event: app.bsky.feed.defs#requestMore or #requestLess }), which tells a feed more or less like the item, or call ({ method, service, input? }), which calls a procedure of the service through the account's PDS, its input a template as create's record is, as { \"method\": \"chat.bsky.convo.updateRead\", \"service\": \"did:web:api.bsky.chat#bsky_chat\", \"input\": { \"convoId\": { \"$\": \"id\" } } }, or deletes ({ method, service, params?, repeat?, collections?, then? }), which asks a query of the service, as the account, for a deletion plan, its params a template as call's input, and deletes what it answers, { writes: [{ collection, rkey }] }, the deletes of one com.atproto.repo.applyWrites, in the account's own repository at once, all or none (a gallery with its photos, as { \"method\": \"social.grain.gallery.getDeletionPlan\", \"service\": \"did:web:grain.social#grain_appview\", \"params\": { \"gallery\": { \"$\": \"response.gallery.uri\" } } }); with repeat true it asks again until a plan comes back empty, deleting an account's data a part at a time as the button counts the records gone, from the operator's own pages and apps alone; then ({ method, service, input? }, its input literal but {\"$did\": true}, the account's DID) is called once nothing is left, as the app's server forgetting the account; collections names the collections its deletes may reach beyond those the views write, which HUD asks at sign-in to delete. done is the label after it succeeds; a created record's button then deletes it again. existing (with create) binds the at-uri of the record the account already made, as an AppView's post.viewer.like: the button then starts done, and a click deletes that record. count binds how many there are, as post.likeCount: the button is then drawn as its icon and that number, counting it up or down as it is done or undone, its label read aloud, and where nothing can write it is drawn as a Stat of that number; no Stat of the same number goes beside it. closed binds whether it is closed (true): then it is drawn as a Stat of its count, or nothing. icon check and x (since 0.25.0, left out for an older kit, which draws its words alone) mark a group's Joined and a request's Cancel. style button draws it as a button of its own, filled until done and outlined once done, as a profile's Follow and Following; style outline (since 0.25.0) as a button of its own outlined, done or not, as a done one is, for a state a tap undoes, as a group's Requested with a call and a confirm (a kit before 0.25.0 draws it as style button); style row draws it as a row of a List with style rows, the whole width, its label a row's words, joining the rows of a List or of row Actions right before it in a Stack with gap none, as Settings' Delete account after Sign out. confirm is a question asked first (\"Block @alice?\"), in a bundled view too, answered by a button of its answer (since 0.32.0: \"Block\") or else its label; tone danger draws it in the danger colour (Block, Delete). leave true closes the screen it is on once it succeeds, as deleting the gallery shown; reload true reads the view again once it succeeds, as deleting a comment in it. signOut true signs the account out of the app once it succeeds, as deleting one's account (an Action with it draws only where the host signs out); handle binds the account's handle, which the person types to confirm (with confirm). disabled, true or a binding that holds something, draws it greyed and doing nothing (in a Menu too, a row greyed), and reason, words or a binding, muted and smaller under it while it is disabled, read as its description (a group's last admin's Step down as admin, { \"disabled\": { \"$\": \"lastAdmin\" }, \"reason\": \"You're the only admin. Make someone else an admin first.\" }); a kit older than their since is sent nothing in a disabled action's place. A view that is not bundled asks the person to confirm, showing the record. Signed out, the first click asks the host to sign in. To write what a person types (a reply, a post), use Compose.",
since: FIRST,
},
Component {
@@ -2045,7 +2059,7 @@ pub fn to_json() -> Value {
"items": "a component with items draws each item with the item as its scope (a Rec, or an element of the array bound)",
"rec": "{ uri, cid, did (the repository's, from uri), value, joins: { <as>: Rec | null | { total, records: [Rec] } } }; a blob ref in value carries a url when the server serves it",
},
"bindings": "A prop is a literal JSON value or a binding {\"$\": \"path\"} or {\"$\": [\"pathA\", \"pathB\"]} (the first usable value wins). A path is keys joined by dots from the current scope, each [A-Za-z0-9_$]+, at most 10; an array takes a number as its key (records.0); \".\" is the scope itself (an item of an array of strings, such as a tag). No expressions. Media props take a blob ref; an https URL only of the view's origins. Where a prop says orRoot, in an open's params, and as a value in a List's literal items, {\"$root\": \"path\"} reads from the view's own scope rather than the item's. Where a prop says orWords (since 0.25.0: a Text's value, a Link's, an Action's or a Compose's label, an Action's confirm, a Compose's title and about, an Empty's title and text), it may be words made of the data, read to one string on the server: {\"$join\": [2 to 8 parts]}, the parts' words run together, nothing where any part reads nothing; {\"$sep\": [separator (1 to 8 characters), 2 to 8 parts]}, the parts that read something joined by the separator, those that read nothing (or \"\") left out, nothing where none does ({ \"$sep\": [\" · \", { \"$\": \"place\" }, { \"$\": \"camera\" }] }); {\"$count\": [a binding to an array, singular, plural]} (\"3 rules\"), nothing where no array is there; {\"$pick\": [a binding, { value: words }]}, the words for the value it holds (1 to 12 values, each word 1 to 64 characters; a number or true and false compared as written), nothing where it holds nothing or a value not named ({ \"$pick\": [{ \"$\": \"group.joinPolicy\" }, { \"open\": \"Open to join\", \"invite\": \"Invite only\" }] }). A part of a $join or a $sep is a string, a binding or another of these but its own form, nested at most 3 deep. The words themselves, and each binding in them, may be {\"$root\": \"path\"}, read from the view's own scope, as a List row's question names the group its screen shows ({ \"$join\": [\"Leave \", { \"$root\": \"response.group.displayName\" }, \"?\"] }). Where words read nothing they act as a binding that reads nothing, but an Action's confirm: an Action whose confirm's words read nothing is drawn nowhere, never acting unasked.",
"bindings": "A prop is a literal JSON value or a binding {\"$\": \"path\"} or {\"$\": [\"pathA\", \"pathB\"]} (the first usable value wins). A path is keys joined by dots from the current scope, each [A-Za-z0-9_$]+, at most 10; an array takes a number as its key (records.0); \".\" is the scope itself (an item of an array of strings, such as a tag). No expressions. Media props take a blob ref; an https URL only of the view's origins. Where a prop says orRoot, in an open's params, and as a value in a List's literal items, {\"$root\": \"path\"} reads from the view's own scope rather than the item's. Where a prop says orWords (since 0.25.0: a Text's value, a Link's, an Action's or a Compose's label, an Action's confirm, an Action's or a Link's answer, a Compose's title and about, an Empty's title and text), it may be words made of the data, read to one string on the server: {\"$join\": [2 to 8 parts]}, the parts' words run together, nothing where any part reads nothing; {\"$sep\": [separator (1 to 8 characters), 2 to 8 parts]}, the parts that read something joined by the separator, those that read nothing (or \"\") left out, nothing where none does ({ \"$sep\": [\" · \", { \"$\": \"place\" }, { \"$\": \"camera\" }] }); {\"$count\": [a binding to an array, singular, plural]} (\"3 rules\"), nothing where no array is there; {\"$pick\": [a binding, { value: words }]}, the words for the value it holds (1 to 12 values, each word 1 to 64 characters; a number or true and false compared as written), nothing where it holds nothing or a value not named ({ \"$pick\": [{ \"$\": \"group.joinPolicy\" }, { \"open\": \"Open to join\", \"invite\": \"Invite only\" }] }). A part of a $join or a $sep is a string, a binding or another of these but its own form, nested at most 3 deep. The words themselves, and each binding in them, may be {\"$root\": \"path\"}, read from the view's own scope, as a List row's question names the group its screen shows ({ \"$join\": [\"Leave \", { \"$root\": \"response.group.displayName\" }, \"?\"] }). Where words read nothing they act as a binding that reads nothing, but an Action's confirm: an Action whose confirm's words read nothing is drawn nowhere, never acting unasked.",
"actions": "Action's create: { collection: NSID, record: { ... } }, the record at most 4096 bytes as JSON, its values at any depth literal JSON, a binding, {\"$now\": true} (the current time, ISO 8601) or {\"$strongRef\": \"path\"} ({ uri, cid } of what path names, as \".\" for a Rec or \"post\" for a feed item); keys starting with $ are those alone and $type. The record may be bound whole, as a query join's answer holds it ({ \"$root\": \"joins.crossPost.post\" }), or objects merged, the later's fields winning ({ \"$merge\": [{ \"$root\": \"joins.crossPost.post\" }, { \"createdAt\": { \"$now\": true } }] }). delete: { uri: binding }. As app.bsky.feed.like: { collection: \"app.bsky.feed.like\", record: { subject: { \"$strongRef\": \".\" }, createdAt: { \"$now\": true } } }.",
"joins": {
"ref": "{ as, ref: path to an at-uri or strongRef, collection? } -> Rec | null",