v0.1.0-next
v0.1.0-next
v0.1.0 — prerelease
Unreleased
This version is a draft tracked on main and not yet tagged. The API is expected to change before the release.
The first draft of the widget library: a model-update-view loop, a renderable node tree and two widgets.
Added
Flow
Cmd— the attribute describing a side effect, withNoCmdfor no work andBatchCmdfor running several commands in sequence.Widget— the attribute pairing anupdateand aviewfunction.Step— the result of an update: the next widget plus the command to run.View— the union of a nested widget and a node.
See Flow for the full reference.
Nodes
Node— the attribute describing an element in the rendered tree.Text,ForegroundandBackground— the initial node types, with colors accepted asColorLikefromcolors.
See Nodes for the full reference.
Widgets
label— displays a fixed string and ignores every message.textinput— collects typed text, handlingKeyPressMsgandSetValueMsg.
See Label and Text Input for the full reference.
Known issues
label.newdeclares aLabelreturn type but returns aModel;Labeldoes not exist.textinput.viewrendersm.valuein its empty branch, soplaceholderis never drawn.textinput.viewcallsnode.Foreground("grey", [node.Text(m.value)])with two arguments and aStringcolor, whileForegroundtakes a singleColorLikefield. A source comment marks the color as pending a theme.Text,ForegroundandBackgroundcarry@Tagrather than@Node, andTagis not defined in this repository.labelimportsflow,textinputimportsui.flow, and bothflow.Stepand bareStepare used within a single function.- Neither
labelnortextinputimports thenodemodule they reference by prefix.