Files

27 lines
1.3 KiB
Plaintext

workspace Compound id "workspace:compound" revision "workspace:compound@1" commit "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" {
import interface NoteData;
import package EditRuntime;
type Content = record { text: string; tags: list<string>; };
atom Note id "compound:note";
conform Note as NoteData id "compound:note:data" {
private state Content id "compound:content-slot" on Note : Content policy crdt(Content);
private state Resolved id "compound:resolved-slot" on Note : bool policy register default false;
private state Title id "compound:title-slot" on Note : string policy register default "note";
private state Allowed id "compound:allowed-slot" on Note : bool policy register default true;
initialize { content to state Content; };
bind content.get to state Content.read;
bind content.edit to state Content.edit;
bind resolved.get to state Resolved.read;
bind title.get to state Title.read;
bind title.set to state Title.write;
bind batch.call to package EditRuntime.batch with {
content to state Content;
resolved to state Resolved;
} accept with { allowed to state Allowed; };
bind update.call to package EditRuntime.update with {
content to state Content;
resolved to state Resolved;
} accept with { allowed to state Allowed; };
}
}