Files
quixos-protocol/test/fixtures/presentation-mount/workspace.qx
T

89 lines
5.0 KiB
Plaintext
Raw Normal View History

workspace Example id "presentation-example" revision "presentation-example@1" commit "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" {
import interface PresentationState;
import interface StateRecord;
import interface PresentationMount;
import interface Presentation;
import interface PresentationStates;
import interface StateFactory;
import interface ReaderNavigation;
import interface DocumentNavigation;
import package PresentationRuntime;
atom PresentationMountRecord id "presentation-mount-record";
atom Library id "library";
atom OtherLibrary id "other-library";
atom Document id "document";
atom ReaderNavigationRecord id "reader-navigation-record";
atom DocumentNavigationRecord id "document-navigation-record";
conform PresentationMountRecord as PresentationMount id "presentation-mount-record:implementation" {
private edge Membership id "presentation-mount:membership" {
atom PresentationMountRecord projection members id "presentation-mount:members-projection" many-unique public-traversal;
interface PresentationState projection presentationMount id "presentation-mount:owner-projection" optional-one public-traversal;
}
private edge Root id "presentation-mount:root-edge" {
atom PresentationMountRecord projection root id "presentation-mount:root-projection" optional-one;
interface PresentationState projection rootOf id "presentation-mount:root-of-projection" optional-one;
}
bind members.resolve to edge Membership.members.resolve;
bind root.resolve to edge Root.root.resolve;
bind create.call to package PresentationRuntime.createPresentationMount with {presentationMount to creation PresentationMountRecord with {};};
bind attach.call to package PresentationRuntime.attach with {
members to edge Membership.members;
root to edge Root.root;
metadata to interface PresentationState from input;
};
}
conform<object Navigation implements PresentationState> Presentation<Navigation> as PresentationStates<Navigation> id "presentation:state-association" {
private edge States id "presentation:states-edge" {
atom Self projection states id "presentation:states-projection" many-unique keyed "string";
object Navigation projection subject id "presentation:subject-projection" optional-one;
}
bind states.resolve to edge States.states.resolve;
bind ensure.call to package PresentationRuntime.ensure<Navigation> with {
states to edge States.states;
metadata to interface PresentationState from input;
presentationMount to interface PresentationMount from input;
factory to interface StateFactory<Navigation>;
};
}
conform StateRecord as PresentationState id "state-record:metadata" {
private state Occurrence id "metadata:occurrence" on Self : string policy register;
private edge Parent id "metadata:parent" {
atom Self projection parent id "metadata:parent-projection" optional-one;
interface PresentationState projection children id "metadata:children-projection" many-unique;
}
initialize {occurrence to state Occurrence;parent to edge Parent.parent;};
bind occurrence.get to state Occurrence.read;
bind parent.resolve to edge Parent.parent.resolve;
bind presentationMount.resolve to edge Membership.presentationMount.resolve;
}
conform ReaderNavigationRecord as StateRecord id "reader:state-record" {}
conform DocumentNavigationRecord as StateRecord id "document:state-record" {}
conform ReaderNavigationRecord as ReaderNavigation id "reader:navigation" {
private state Mode id "reader:mode" on Self : string policy register default "library";
bind page to state Mode;
}
conform DocumentNavigationRecord as DocumentNavigation id "document:navigation" {
private state Compact id "document:compact" on Self : bool policy register default false;
bind compact to state Compact;
}
conform Library as StateFactory<atom ReaderNavigationRecord> id "reader:factory" {
bind create.call to package PresentationRuntime.createState<atom ReaderNavigationRecord> with {
navigation to creation ReaderNavigationRecord with {PresentationState from input;};
};
}
conform Document as StateFactory<atom DocumentNavigationRecord> id "document:factory" {
bind create.call to package PresentationRuntime.createState<atom DocumentNavigationRecord> with {
navigation to creation DocumentNavigationRecord with {PresentationState from input;};
};
}
conform Library as Presentation<atom ReaderNavigationRecord> id "library:presentation" {}
conform Document as Presentation<atom DocumentNavigationRecord> id "document:presentation" {}
conform OtherLibrary as StateFactory<atom ReaderNavigationRecord> id "other-reader:factory" {
bind create.call to package PresentationRuntime.createState<atom ReaderNavigationRecord> with {
navigation to creation ReaderNavigationRecord with {PresentationState from input;};
};
}
conform OtherLibrary as Presentation<atom ReaderNavigationRecord> id "other-library:presentation" {}
}