kind: Solution
version: v0

router:
  kind: Router
  routes:
    - frame: home-frame
      children:
        - frame: box-frame
        - frame: sphere-frame
        - frame: results-frame

frames:
  home-frame:
    kind: Frame
    layout:
      kind: ColumnLayout
      areas: [viewer, outlet]
      widths: [1fr, 350px]
    contents:
      data:
        kind: DataStore
        value:
          width: 50
          height: 50
          depth: 50
          radius: 65
        subscribe:
          - kind: ControlPanel
            frame: box-frame
            source: box-ctrls
          - kind: ControlPanel
            frame: sphere-frame
            source: sphere-ctrls
      viewer:
        kind: Viewer
        materials:
          blurple:
            kind: StandardMaterial
            color: [42, 75, 240]
          light-blue:
            kind: StandardMaterial
            color: [119, 173, 238]
        subscribe:
          - kind: Model
            frame: home-frame
            source: model
            assignMaterials:
              sphere: blurple
              box: light-blue
      model:
        kind: Model
        modelFile: trimbox-part3.gh
        subscribe:
          - kind: DataStore
            frame: home-frame
            source: data
      outlet:
        kind: RouterOutlet
  box-frame:
    kind: Frame
    layout:
      kind: RowLayout
      areas: [box-ctrls, next, ""]
      heights: [1fr, auto, 50px]
    contents:
      box-ctrls:
        kind: ControlPanel
        controls:
          title:
            kind: Text
            type: h1
            text: Box controls
          subtext:
            kind: Text
            text: |
              Lorem ipsum dolor sit amet, 
              consectetur adipiscing elit.
          width: # match GH
            kind: Slider
            label: Box width
            value: 50
            min: 1
            max: 100
            precision: 0
          depth: # match GH
            kind: Slider
            label: Box depth
            value: 50
            min: 1
            max: 100
            precision: 0
          height: # match GH
            kind: Slider
            label: Box height
            value: 50
            min: 1
            max: 100
            precision: 0
        subscribe:
          - kind: Model # for disabling controls
            frame: home-frame
            source: model
            setOutputs: {} # will be optional soon
          - kind: DataStore # for init from saved data
            frame: home-frame
            source: data
      next:
        kind: Button
        text: Confirm
        routerLink: /home-frame/sphere-frame
  sphere-frame:
    kind: Frame
    layout:
      kind: RowLayout
      areas: [sphere-ctrls, back, next, ""]
      heights: [1fr, auto, auto, 50px]
    contents:
      sphere-ctrls:
        kind: ControlPanel
        controls:
          title:
            kind: Text
            type: h1
            text: Sphere Controls
          radius: # match GH
            kind: Slider
            label: Sphere radius
            value: 65
            min: 1
            max: 100
            precision: 0
        subscribe:
          - kind: Model # for disabling controls
            frame: home-frame
            source: model
            setOutputs: {} # will be optional soon
          - kind: DataStore # for init from saved data
            frame: home-frame
            source: data
      back:
        kind: Button
        text: Back
        routerLink: /home-frame/box-frame
      next:
        kind: Button
        text: Confirm
        routerLink: /home-frame/results-frame
  results-frame:
    kind: Frame
    layout:
      kind: RowLayout
      areas: [results-ctrls, back, ""]
      heights: [1fr, auto, 50px]
    contents:
      results-ctrls:
        kind: ControlPanel
        controls:
          title:
            kind: Text
            type: h1
            text: Results
          box-vol-label:
            kind: Text
            text: "Box volume:"
          box-volume: # match GH
            kind: Text
            text: ""
          sphere-vol-label:
            kind: Text
            text: "Sphere volume:"
          sphere-volume: # match GH
            kind: Text
            text: ""
        subscribe:
          - kind: Model
            frame: home-frame
            source: model
            setOutputs:
              sphere-volume:
                type: setText
              box-volume:
                type: setText
      back:
        kind: Button
        text: Back
        routerLink: /home-frame/sphere-frame
