workspace Studio id "workspace:studio" revision "workspace:studio@1" commit "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" { import "agents.qx"; import "reading.qx"; import "books.qx"; import "presentation/react.qx"; import "navigation.qx"; import package AgentWorkspaceBootstrap; import "studio/factory-rules.qx"; import interface WebStudioPresentable; import interface PresentationMount; import interface WebStudioDisplayTarget; import interface WebStudioDisplayDirectory; import package WebStudioDisplayRuntime; import interface WebStudioSearchable; import interface StandaloneView; import interface WebStudioCanvasPlacement; import package WebStudioCanvasEditor; presentation CanvasEditor id "presentation:studio:canvas-editor" for WebStudioCanvas using WebStudioCanvasEditor.Editor; presentation CanvasCard id "presentation:studio:canvas" for WebStudioCanvas using WebStudioCanvasRuntime.CanvasCard; atom Canvas id "atom:org.quixos.web-studio:canvas"; atom Placement id "atom:org.quixos.web-studio:canvas-placement"; conform Canvas as WebStudioCanvas id "studio:canvas" { private state Name id "studio:canvas:name" on Canvas : string policy register; initialize {name to state Name;}; bind name.get to state Name.read; bind name.set to state Name.write; bind create.call to package WebStudioCanvasRuntime.createCanvas with {canvas to creation Canvas with {WebStudioCanvas from input;};}; bind root.call to package AgentWorkspaceBootstrap.createRoot with {canvas to creation Canvas with {WebStudioCanvas from input;};agentWorkspace to interface AgentWorkspace from input;}; bind place.call to package WebStudioCanvasRuntime.place with { subject to interface WebStudioPlaceable from input; placement to creation Placement with {WebStudioCanvasPlacement from input;}; }; bind createAndPlace.call to package WebStudioCanvasRuntime.createAndPlace with { subject to interface WebStudioPlaceable from input; canvas to creation Canvas with {WebStudioCanvas from input;}; placement to creation Placement with {WebStudioCanvasPlacement from input;}; }; bind placements.resolve to edge PlacementCanvas.placements.resolve; } conform Canvas as WebStudioPlaceable id "studio:canvas:placeable" { bind canPresent.call to package WebStudioCanvasRuntime.canPresent with {catalog to workspace reflection [presentations];}; bind placements.resolve to edge PlacementSubject.placements.resolve; } conform Placement as WebStudioCanvasPlacement id "studio:placement" { private state Position id "studio:placement:position" on Placement : record {x:double;y:double;} policy register; private state Size id "studio:placement:size" on Placement : record {width:double;height:double;} policy register; private state Z id "studio:placement:z" on Placement : int32 policy register; private state Presentation id "studio:placement:presentation" on Placement : string policy register; private edge PlacementCanvas id "studio:placement:canvas" { atom Placement projection canvas id "studio:placement:canvas:parent" exactly-one on-delete "detach" public-traversal; interface WebStudioCanvas projection placements id "studio:canvas:placements" many-unique on-delete "cascade-other" public-traversal; } private edge PlacementSubject id "studio:placement:subject" { atom Placement projection subject id "studio:placement:subject:target" exactly-one on-delete "detach" public-traversal; interface WebStudioPlaceable projection placements id "studio:subject:placements" many-unique on-delete "cascade-other" public-traversal; } initialize {position to state Position;size to state Size;z to state Z;presentation to state Presentation;canvas to edge PlacementCanvas.canvas;subject to edge PlacementSubject.subject;}; bind position.get to state Position.read; bind position.set to state Position.write; bind size.get to state Size.read; bind size.set to state Size.write; bind z.get to state Z.read; bind z.set to state Z.write; bind presentation.get to state Presentation.read; bind remove.call to lifecycle.delete; bind canvas.resolve to edge PlacementCanvas.canvas.resolve; bind subject.resolve to edge PlacementSubject.subject.resolve; } conform Canvas as StandaloneView id "studio:canvas:view" { bind render to WebStudioCanvasEditor.Editor; } conform Canvas as WebStudioSearchable id "studio:search:Canvas" { bind title.get to interface WebStudioCanvas.name.get; private state SearchText id "studio:canvas:search-text" on Canvas : string policy register default "canvas workspace"; bind searchText.get to state SearchText.read; } atom DisplayTarget id "atom:org.quixos.web-studio:display-target"; conform DisplayTarget as WebStudioDisplayTarget id "studio:display-target" { private state DisplayData id "studio:display:data" on DisplayTarget : record {label:string;generation:uint32;presentation:optional;observed:optional;} policy register; private state DisplayNonce id "studio:display:nonce" on DisplayTarget : string policy register; private edge DisplaySubject id "studio:display:subject" { atom DisplayTarget projection subject id "studio:display:subject:target" optional-one on-delete "detach" public-traversal; interface WebStudioPresentable projection displays id "studio:presentable:displays" many-unique on-delete "detach" public-traversal; } initialize {initial to state DisplayData;nonce to state DisplayNonce;}; bind status.get to state DisplayData.read; bind nonce.get to state DisplayNonce.read; bind subject.resolve to edge DisplaySubject.subject.resolve; private edge DisplayPresentationMount id "studio:display:presentation-mount" {atom DisplayTarget projection presentationMount id "studio:display:presentation-mount:target" optional-one on-delete "detach"; interface PresentationMount projection displays id "studio:display:presentation-mount:displays" many on-delete "detach";} bind presentationMount.resolve to edge DisplayPresentationMount.presentationMount.resolve; bind assign.call to package WebStudioDisplayRuntime.assign with {data to state DisplayData;selected to edge DisplaySubject.subject;subject to interface WebStudioPresentable from input;mount to edge DisplayPresentationMount.presentationMount;}; bind acknowledge.call to package WebStudioDisplayRuntime.acknowledge with {data to state DisplayData;}; } conform Canvas as WebStudioDisplayDirectory id "studio:display-directory:Canvas" { private edge CanvasDisplayDirectory id "studio:display:directory:Canvas" { atom Canvas projection targets id "studio:directory:targets:Canvas" many-unique on-delete "cascade-other" public-traversal; interface WebStudioDisplayTarget projection directory id "studio:display:directory:parent:Canvas" optional-one on-delete "detach" public-traversal; } bind targets.resolve to edge CanvasDisplayDirectory.targets.resolve; bind enroll.call to package WebStudioDisplayRuntime.enroll with {enrolled to edge CanvasDisplayDirectory.targets;existing to interface WebStudioDisplayTarget from input;target to creation DisplayTarget with {WebStudioDisplayTarget from input;};}; } conform Canvas as WebStudioPresentable id "studio:presentable:Canvas" {bind canPresent.call to interface WebStudioPlaceable.canPresent.call;} }