TermColor.Terminal.UI #
Small typed composition primitives for terminal applications. Views stay pure; the terminal runtime owns IO, while applications own model state and message handling.
Equations
- One or more equations did not get rendered due to their size.
- TermColor.Terminal.instBEqRect.beq x✝¹ x✝ = false
Instances For
@[instance_reducible]
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
@[instance_reducible]
Equations
Pure information supplied to every view.
Instances For
@[instance_reducible]
Equations
Instances For
@[instance_reducible]
Equations
Instances For
@[instance_reducible]
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
- TermColor.Terminal.instBEqRendered.beq x✝¹ x✝ = false
Instances For
@[instance_reducible]
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
@[instance_reducible]
Equations
Equations
- rendered.toFrame = { text := rendered.text, hitRegions := rendered.hitRegions, focusables := rendered.focusables, focus := rendered.focus }
Instances For
Equations
- TermColor.Terminal.Rendered.fromFrame frame = { text := frame.text, hitRegions := frame.hitRegions, focusables := frame.focusables, focus := frame.focus }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
Equations
Instances For
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
@[instance_reducible]
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- TermColor.Terminal.FocusRing.move key ring = { ids := ring.ids, current := TermColor.Terminal.moveFocus ring.ids.length ring.current key }
Instances For
Equations
- TermColor.Terminal.FocusRing.focus id ring = match TermColor.Terminal.FocusRing.indexOf?✝ id ring.ids with | some current => { ids := ring.ids, current := current } | none => ring
Instances For
The component id receiving a terminal event after hit-testing/focus selection.
Equations
- TermColor.Terminal.target rendered ring (TermColor.Terminal.Event.key value) = ring.currentId
- TermColor.Terminal.target rendered ring (TermColor.Terminal.Event.mouse event) = TermColor.Terminal.hitTest rendered.toFrame event
Instances For
Width allocation used by row composition.
- fixed (width : Nat) : Constraint
- percent (value : Nat) : Constraint
- fill : Constraint
Instances For
@[instance_reducible]
Equations
Equations
- TermColor.Terminal.instBEqConstraint.beq (TermColor.Terminal.Constraint.fixed a) (TermColor.Terminal.Constraint.fixed b) = (a == b)
- TermColor.Terminal.instBEqConstraint.beq (TermColor.Terminal.Constraint.percent a) (TermColor.Terminal.Constraint.percent b) = (a == b)
- TermColor.Terminal.instBEqConstraint.beq TermColor.Terminal.Constraint.fill TermColor.Terminal.Constraint.fill = true
- TermColor.Terminal.instBEqConstraint.beq x✝¹ x✝ = false
Instances For
Equations
- TermColor.Terminal.instDecidableEqConstraint.decEq (TermColor.Terminal.Constraint.fixed a) (TermColor.Terminal.Constraint.fixed b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- TermColor.Terminal.instDecidableEqConstraint.decEq (TermColor.Terminal.Constraint.fixed width) (TermColor.Terminal.Constraint.percent value) = isFalse ⋯
- TermColor.Terminal.instDecidableEqConstraint.decEq (TermColor.Terminal.Constraint.fixed width) TermColor.Terminal.Constraint.fill = isFalse ⋯
- TermColor.Terminal.instDecidableEqConstraint.decEq (TermColor.Terminal.Constraint.percent value) (TermColor.Terminal.Constraint.fixed width) = isFalse ⋯
- TermColor.Terminal.instDecidableEqConstraint.decEq (TermColor.Terminal.Constraint.percent a) (TermColor.Terminal.Constraint.percent b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- TermColor.Terminal.instDecidableEqConstraint.decEq (TermColor.Terminal.Constraint.percent value) TermColor.Terminal.Constraint.fill = isFalse ⋯
- TermColor.Terminal.instDecidableEqConstraint.decEq TermColor.Terminal.Constraint.fill (TermColor.Terminal.Constraint.fixed width) = isFalse ⋯
- TermColor.Terminal.instDecidableEqConstraint.decEq TermColor.Terminal.Constraint.fill (TermColor.Terminal.Constraint.percent value) = isFalse ⋯
- TermColor.Terminal.instDecidableEqConstraint.decEq TermColor.Terminal.Constraint.fill TermColor.Terminal.Constraint.fill = isTrue ⋯
Instances For
@[instance_reducible]
@[instance_reducible]
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
A pure view. The runtime decides how the resulting frame reaches the terminal.
- render : ViewContext → Rendered
Instances For
Equations
- TermColor.Terminal.View.text value = { render := fun (x : TermColor.Terminal.ViewContext) => { text := value } }
Instances For
Equations
- TermColor.Terminal.View.frame value = { render := fun (x : TermColor.Terminal.ViewContext) => TermColor.Terminal.Rendered.fromFrame value }
Instances For
Equations
Instances For
def
TermColor.Terminal.View.rowWith
(constraints : List Constraint)
(gap : Nat)
(children : List View)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- TermColor.Terminal.View.row gap children = TermColor.Terminal.View.rowWith (List.replicate children.length TermColor.Terminal.Constraint.fill) gap children
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- TermColor.Terminal.View.withPrefix name child = { render := fun (context : TermColor.Terminal.ViewContext) => TermColor.Terminal.Rendered.withPrefix name (child.render context) }
Instances For
@[irreducible]
Equations
- TermColor.Terminal.Command.map convert TermColor.Terminal.Command.none = TermColor.Terminal.Command.none
- TermColor.Terminal.Command.map convert (TermColor.Terminal.Command.send message) = TermColor.Terminal.Command.send (convert message)
- TermColor.Terminal.Command.map convert (TermColor.Terminal.Command.batch commands) = TermColor.Terminal.Command.batch (List.map (TermColor.Terminal.Command.map convert) commands)
- TermColor.Terminal.Command.map convert (TermColor.Terminal.Command.task work) = TermColor.Terminal.Command.task do let __do_lift ← work pure (convert __do_lift)
Instances For
Typed state/update/view contract for reusable application components.
- view : ViewContext → Model → Rendered
Instances For
def
TermColor.Terminal.Component.mapMsg
{Model ChildMsg ParentMsg : Type}
(inject : ChildMsg → ParentMsg)
(project : ParentMsg → Option ChildMsg)
(component : Component Model ChildMsg)
:
Component Model ParentMsg
Equations
- One or more equations did not get rendered due to their size.