|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
Server-side authoring of UI documents (spec 5 §11): typed builders that write a screen's JSON, and the registration that validates it once — loadDocument with the builders' catalog facts, then the accessibility rules. More...
#include <algorithm>#include <chrono>#include <concepts>#include <cstddef>#include <cstdint>#include <exception>#include <expected>#include <functional>#include <glaze/glaze.hpp>#include <initializer_list>#include <iterator>#include <map>#include <memory>#include <optional>#include <stdexcept>#include <string>#include <string_view>#include <type_traits>#include <utility>#include <vector>#include "../core/changes.hpp"#include "../core/effects.hpp"#include "../core/logger.hpp"#include "../core/model_key.hpp"#include "../core/registry.hpp"#include "../detail/fixed_string.hpp"#include "../detail/reflected_member.hpp"#include "../forms/engine/field_layout.hpp"#include "../ui/document.hpp"#include "../ui/value.hpp"#include "../util/datetime.hpp"#include "../util/rational.hpp"#include "alignment.hpp"#include "button_emphasis.hpp"#include "button_style.hpp"Go to the source code of this file.
Classes | |
| struct | morph::ui::author::Any |
| The value type of a handle whose value the screen cannot know when it is written: a query result read by name, an element value, an event payload. More... | |
| class | morph::ui::author::AuthoringError |
| What a builder throws when it is given something a document cannot say, such as a field read from a value that has no name. Registration turns it into a Refusal at the document's root. More... | |
| struct | morph::ui::author::ModelFacts< Model > |
| Catalog facts of a model type that its C++ type does not show. Specialise it for a model whose shared singleton is equivalent to a private instance. More... | |
| struct | morph::ui::author::ActionFacts< Action > |
| Catalog facts of an action that its C++ type does not show. Specialise it for an action whose reply rows carry server-calculated fields, whose reply carries a secret, or which sends a credential. More... | |
| struct | morph::ui::author::CatalogFacts |
| The catalog facts the builders gathered from the model and action types a screen names. More... | |
| struct | morph::ui::author::detail::IsOptional< T > |
| Whether a type is a std::optional. More... | |
| struct | morph::ui::author::detail::IsOptional< std::optional< T > > |
| A std::optional is one. More... | |
| struct | morph::ui::author::detail::Unwrapped< T > |
| A type with one std::optional removed. More... | |
| struct | morph::ui::author::detail::Unwrapped< std::optional< T > > |
| The engaged type of a std::optional. More... | |
| struct | morph::ui::author::detail::IsVector< T > |
| Whether a type is a std::vector. More... | |
| struct | morph::ui::author::detail::IsVector< std::vector< T, Alloc > > |
| A std::vector is one. More... | |
| struct | morph::ui::author::detail::IsHandle< T > |
| Whether a type is a Handle. More... | |
| struct | morph::ui::author::detail::IsHandle< Handle< T > > |
| A Handle is one. More... | |
| struct | morph::ui::author::detail::LiteralOf< L > |
| The value type a constant stands for. More... | |
| struct | morph::ui::author::detail::LiteralOf< char[N]> |
| Text is a std::string. More... | |
| struct | morph::ui::author::detail::LiteralOf< char const * > |
| A C string is a std::string. More... | |
| struct | morph::ui::author::detail::LiteralOf< std::string_view > |
| A string view is a std::string. More... | |
| struct | morph::ui::author::detail::ValueOf< X > |
| The value type of an operand: a handle's value type, or the type its constant stands for. More... | |
| struct | morph::ui::author::detail::ValueOf< Handle< T > > |
| A handle's value type. More... | |
| class | morph::ui::author::Handle< T > |
| An expression of a document, typed by the C++ value it evaluates to (spec 5 §11). More... | |
| class | morph::ui::author::Element |
| An element of the view, named by its id, whose live values relations read (spec 5 §6). More... | |
| struct | morph::ui::author::Self |
| The dialog or drawer a command list runs in, for close. More... | |
| class | morph::ui::author::QueryRef |
| A query of a scope, without its action type: what refetch, prefetch and optimistic name. More... | |
| class | morph::ui::author::MutationRef |
| A mutation of a scope, without its action type: what signIn, upload and can name. More... | |
| class | morph::ui::author::QueryHandle< Action, Value > |
| A query declared by a scope. More... | |
| class | morph::ui::author::ResultHandle< T > |
| A mutation's result: a Handle with no field reads. More... | |
| class | morph::ui::author::MutationHandle< Action > |
| A mutation declared by a scope. More... | |
| class | morph::ui::author::BodyField< Action > |
| One field of an action body: a member of the action, and the expression that fills it. More... | |
| class | morph::ui::author::Body< Action > |
| An action body: the action's members with expressions in place of values (spec 5 §11). C++ cannot synthesise the action's struct with its members retyped, so a body lists {&Action::member, value} pairs. More... | |
| class | morph::ui::author::ModelHandle< Model > |
| A model alias of a scope. More... | |
| struct | morph::ui::author::Borrow |
| The opener's binding of an alias, for a screen opened as a dialog ({"from": alias}). More... | |
| class | morph::ui::author::InstanceSpec |
| A model alias's instance: a binding mode, a key expression, or a borrowed binding. More... | |
| struct | morph::ui::author::ModelOptions |
| Options of a model alias. More... | |
| struct | morph::ui::author::QueryOptions |
| Options of a query (spec 5 §5). More... | |
| struct | morph::ui::author::Optimistic |
| An optimistic write: the row a mutation run predicts before its reply. More... | |
| class | morph::ui::author::Commands |
| A command list, run as one batch. More... | |
| class | morph::ui::author::Command |
| One command of ui/1 (spec 5 §8, spec 6). More... | |
| struct | morph::ui::author::MutationOptions< Action > |
| Options of a mutation (spec 5 §5). More... | |
| struct | morph::ui::author::CheckOptions |
| A validation across elements (spec 5 §6). More... | |
| class | morph::ui::author::Nodes |
| A list of view nodes. More... | |
| class | morph::ui::author::Node |
| A view node (spec 5 §9). The kind's own properties come from its builder's options; the properties every node takes come from the member functions, each of which returns a copy with the property set. More... | |
| class | morph::ui::author::DeclScope |
| A scope's declarations (spec 5 §3): model aliases, state, let, queries, mutations, watches and checks. A row, a dialog, a drawer and a switch case declare theirs on the scope their builder hands over. More... | |
| struct | morph::ui::author::ComponentOptions |
| A custom or host component (spec 5 §10). More... | |
| class | morph::ui::author::ComponentRef |
| A declared component, for custom nodes. More... | |
| class | morph::ui::author::Point |
| A customization point (spec 5 §12b). More... | |
| struct | morph::ui::author::HeadBadgeOptions |
| A status badge of the screen's head (screen.status). More... | |
| struct | morph::ui::author::ActionButtonOptions |
| A button of a screen's head (screen.action), or of a dialog's or drawer's footer. More... | |
| class | morph::ui::author::Scope |
| The screen's own scope: its declarations, params, lifecycle keys, components and customization points. More... | |
| struct | morph::ui::author::RunOptions |
| Options of run. More... | |
| struct | morph::ui::author::NavigateOptions |
| Options of navigate. More... | |
| struct | morph::ui::author::UploadOptions |
| Options of upload. More... | |
| class | morph::ui::author::detail::NodeWriter |
| Builds a node's JSON key by key, leaving out what is absent. More... | |
| struct | morph::ui::author::TextOptions |
| Options of text. More... | |
| struct | morph::ui::author::ButtonOptions |
| Options of button. More... | |
| struct | morph::ui::author::TextInputOptions |
| Options of textInput. More... | |
| struct | morph::ui::author::CheckboxOptions |
| Options of checkbox. More... | |
| struct | morph::ui::author::SelectOptions |
| Options of select. More... | |
| struct | morph::ui::author::MenuItem |
| An item of a menu; items nests a submenu. More... | |
| struct | morph::ui::author::ContainerOptions |
| Options of column, row and grid. More... | |
| struct | morph::ui::author::PanelOptions |
| Options of panel. More... | |
| class | morph::ui::author::Case |
| A case of a switch node, a scope of its own. More... | |
| struct | morph::ui::author::Tab |
| A page of a tabs node. More... | |
| struct | morph::ui::author::DialogOptions |
| Options of dialog and drawer. More... | |
| struct | morph::ui::author::ForEachOptions |
| Options of forEach. More... | |
| struct | morph::ui::author::TableColumn |
| A column of a table. More... | |
| struct | morph::ui::author::TableOptions |
| Options of table and dataTable. More... | |
| struct | morph::ui::author::DateTimeInputOptions |
| Options of dateTimeInput. More... | |
| struct | morph::ui::author::SliderOptions |
| Options of slider. More... | |
| struct | morph::ui::author::FilePickerOptions |
| Options of filePicker. More... | |
| struct | morph::ui::author::ActionPart |
| The action of a banner or emptyState. More... | |
| struct | morph::ui::author::BannerOptions |
| Options of banner. More... | |
| struct | morph::ui::author::EmptyStateOptions |
| Options of emptyState. More... | |
| struct | morph::ui::author::CollapsibleOptions |
| Options of collapsible. More... | |
| struct | morph::ui::author::DropZoneOptions |
| Options of dropZone. More... | |
| struct | morph::ui::author::FieldSettings |
| An overlay on one field of a form (spec 6 §10), applied to the parsed form model. More... | |
| class | morph::ui::author::FieldOverlay< Action > |
| One field of a form's fields overlay, by member pointer. More... | |
| struct | morph::ui::author::FormPresentation |
| How a form, collection or wizard presents its forms: the keys every one of them takes. More... | |
| struct | morph::ui::author::FormOptions< Action > |
| Options of form. More... | |
| struct | morph::ui::author::CustomOptions |
| Options of custom. More... | |
| struct | morph::ui::author::Emitted |
| A screen's emitted document: its JSON, the text that is served, and the catalog facts of its types. More... | |
| class | morph::ui::author::Screen |
| A screen definition: an id and the builder that writes the document. More... | |
| struct | morph::ui::author::RegisteredScreen |
| A registered screen: the text that is served and the document it loads as. More... | |
| class | morph::ui::author::ScreenRegistry |
| The screens of an application, each validated once when it is registered. More... | |
Concepts | |
| concept | morph::ui::author::Runs |
| Satisfied when Model runs Action: the model has an execute that takes it. | |
| concept | morph::ui::author::detail::ScalarLiteral |
| Satisfied by a C++ scalar a builder writes as a document constant. | |
| concept | morph::ui::author::detail::Literal |
| Satisfied by a C++ value a builder writes as a document constant: a scalar, a list of scalars, or a ui::Value. | |
| concept | morph::ui::author::detail::Operand |
| Satisfied by an operand of an expression operator: a handle or a constant. | |
| concept | morph::ui::author::detail::HandleOperands |
| Satisfied when two operands are operands and at least one is a handle, so the builders' operators never apply to two plain C++ values. | |
Macros | |
| #define | MORPH_UI_AUTHOR_CAT_(a, b) |
| Concatenates two tokens after expanding them. | |
| #define | MORPH_UI_AUTHOR_CAT(a, b) |
| Concatenates two tokens after expanding them. | |
| #define | MORPH_REGISTER_SCREEN(SCREEN) |
| Enrols a screen into the process's registry at static initialisation. A refusal is kept in screenRegistry().refusals(), which a server's test asserts is empty. | |
Typedefs | |
| template<typename T> | |
| using | morph::ui::author::detail::UnwrappedT = Unwrapped<T>::type |
| The type with one std::optional removed. | |
| template<typename L> | |
| using | morph::ui::author::detail::LiteralT = LiteralOf<std::remove_cvref_t<L>>::type |
| The value type a constant stands for. | |
| template<typename L, typename R> | |
| using | morph::ui::author::detail::ArithmeticT = std::conditional_t<IsHandle<L>::value, typename ValueOf<L>::type, typename ValueOf<R>::type> |
| The value type of an arithmetic expression: the left handle's, else the right's. | |
| using | morph::ui::author::AnyHandle = Handle<Any> |
| An expression whose value type is not tracked: the type of every node property. | |
| using | morph::ui::author::RowScope = DeclScope |
| The scope a row of a table or forEach declares its own state, queries and model aliases on. | |
| using | morph::ui::author::ScopeBuilder = std::function<Nodes(DeclScope&)> |
| A scope's builder: declares on the scope and returns the nodes that read it. | |
Enumerations | |
| enum class | morph::ui::author::Instance : std::uint8_t { Default , Private , Shared } |
| How a model alias binds when no key expression is given (spec 5 §5). More... | |
| enum class | morph::ui::author::Mode : std::uint8_t { Exclusive , Serial , Latest , Parallel } |
| What a mutation run does while another is in flight. More... | |
| enum class | morph::ui::author::Source : std::uint8_t { Any , User } |
| Which changes a watch reacts to. More... | |
| enum class | morph::ui::author::ShowErrors : std::uint8_t { Touched , Submit , Always } |
| When a scope's element errors show (spec 5 §6). More... | |
| enum class | morph::ui::author::PropType : std::uint8_t { String , Bool , Int , Exact , Number , Json } |
| A prop type of a component: how a value crosses into QML (spec 5 §10). More... | |
| enum class | morph::ui::author::OpenAs : std::uint8_t { Default , Tab , Dialog , Drawer , Window } |
| How navigate opens a screen. More... | |
| enum class | morph::ui::author::Role : std::uint8_t { Info , Success , Warning , Error } |
| The role of a notification. More... | |
| enum class | morph::ui::author::Commit : std::uint8_t { Change , Blur , Enter } |
| When a text input commits its draft. More... | |
| enum class | morph::ui::author::OnStale : std::uint8_t { Clear , Keep } |
| What a select does with a selection its new options no longer hold. More... | |
| enum class | morph::ui::author::Selection : std::uint8_t { None , Single , Multiple } |
| How a table's selection works. More... | |
| enum class | morph::ui::author::TableMode : std::uint8_t { Client , Server } |
| Where a model-backed table sorts, filters and pages. More... | |
Functions | |
| template<typename Result> | |
| std::optional< std::vector< std::string > > | morph::ui::author::detail::listFields () |
| The members of an action result that hold a list, when the result is a record. | |
| std::optional< std::vector< ActionEffect > > | morph::ui::author::detail::effectsInfo (std::string_view actionId) |
| The catalog's form of an action's declared effects. | |
| std::vector< ActionRecordInfo > | morph::ui::author::detail::recordsInfo (std::string_view actionId) |
| The catalog's form of the records an action's result holds. | |
| template<typename From, typename To> | |
| consteval bool | morph::ui::author::detail::scalarAssignable () |
| Whether a scalar value of one type can stand where a value of another is expected. | |
| template<typename From, typename To> | |
| consteval bool | morph::ui::author::detail::assignable () |
| Whether an expression of one value type can stand where a value of another is expected. null propagates through every expression, so an optional value may stand for a required one. | |
| template<typename L> | |
| Value | morph::ui::author::detail::scalarValue (L const &literal) |
| A C++ scalar as a document value. | |
| template<typename L> | |
| Value | morph::ui::author::detail::literalValue (L const &literal) |
| A C++ constant as a document value. | |
| void | morph::ui::author::detail::put (Json &object, std::string_view key, Json value) |
| Sets a member of a JSON object, replacing one of the same name and keeping the order of the others. | |
| void | morph::ui::author::detail::putSection (Json &object, std::string_view key, Json const §ion) |
| Sets a member of a JSON object to another object, unless that one is empty. | |
| std::size_t | morph::ui::author::detail::members (Json const &object) |
| How many members a JSON object has. | |
| Json | morph::ui::author::detail::constant (Value const &value) |
| A document value as a constant expression: a scalar as itself, a list, record, decimal or quantity wrapped in {"lit": v}. | |
| Json | morph::ui::author::detail::single (std::string_view key, Json value) |
| A one-key JSON object. | |
| std::string | morph::ui::author::detail::alignName (Align align) |
| An alignment's document name. | |
| std::string | morph::ui::author::detail::justifyName (Justify justify) |
| A justification's document name. | |
| std::optional< Json > | morph::ui::author::detail::literalOf (Json const &expression) |
| The value of a constant expression, as constant writes one. | |
| Json | morph::ui::author::detail::call (std::string_view function, std::vector< Json > args) |
| A call of an expr/1 library function. | |
| std::optional< std::pair< std::string, std::string > > | morph::ui::author::detail::namedRead (Json const &json) |
| The dotted path a named read reads, when the expression is one. | |
| Json | morph::ui::author::detail::fieldOf (Json const &json, std::string_view field) |
| A field read below a named read. | |
| std::string | morph::ui::author::detail::refPath (Json const &json, std::string_view what) |
| The name a named read reads. | |
| template<typename Class, typename Member> | |
| std::string | morph::ui::author::detail::memberName (Member Class::*member) |
| The reflected name of a data member, found by its address in a value-initialised object of its class. | |
| template<typename X> | |
| Json | morph::ui::author::detail::operandJson (X const &operand) |
| An operand's JSON. | |
| template<typename Result, typename L, typename R> | |
| Handle< Result > | morph::ui::author::detail::binary (std::string_view function, L const &lhs, R const &rhs) |
| A two-operand call. | |
| template<typename L, typename R> requires detail::HandleOperands<L, R> | |
| Handle< detail::ArithmeticT< L, R > > | morph::ui::author::operator+ (L const &lhs, R const &rhs) |
| add. | |
| template<typename L, typename R> requires detail::HandleOperands<L, R> | |
| Handle< detail::ArithmeticT< L, R > > | morph::ui::author::operator- (L const &lhs, R const &rhs) |
| sub. | |
| template<typename L, typename R> requires detail::HandleOperands<L, R> | |
| Handle< detail::ArithmeticT< L, R > > | morph::ui::author::operator* (L const &lhs, R const &rhs) |
| mul. | |
| template<typename L, typename R> requires detail::HandleOperands<L, R> | |
| Handle< detail::ArithmeticT< L, R > > | morph::ui::author::operator/ (L const &lhs, R const &rhs) |
| div. | |
| template<typename L, typename R> requires detail::HandleOperands<L, R> | |
| Handle< bool > | morph::ui::author::operator< (L const &lhs, R const &rhs) |
| lt. | |
| template<typename L, typename R> requires detail::HandleOperands<L, R> | |
| Handle< bool > | morph::ui::author::operator<= (L const &lhs, R const &rhs) |
| le. | |
| template<typename L, typename R> requires detail::HandleOperands<L, R> | |
| Handle< bool > | morph::ui::author::operator> (L const &lhs, R const &rhs) |
| gt. | |
| template<typename L, typename R> requires detail::HandleOperands<L, R> | |
| Handle< bool > | morph::ui::author::operator>= (L const &lhs, R const &rhs) |
| ge. | |
| template<typename L, typename R> requires detail::HandleOperands<L, R> | |
| Handle< bool > | morph::ui::author::operator&& (L const &lhs, R const &rhs) |
| and, with Kleene's three-valued logic. Both operands are written: a document has no short circuit. | |
| template<typename L, typename R> requires detail::HandleOperands<L, R> | |
| Handle< bool > | morph::ui::author::operator|| (L const &lhs, R const &rhs) |
| or, with Kleene's three-valued logic. | |
| template<typename T> | |
| Handle< bool > | morph::ui::author::operator! (Handle< T > const &operand) |
| not. | |
| template<typename T> | |
| Handle< T > | morph::ui::author::operator- (Handle< T > const &operand) |
| neg. | |
| template<typename L, typename R> requires detail::HandleOperands<L, R> | |
| Handle< bool > | morph::ui::author::eq (L const &lhs, R const &rhs) |
| eq: equality of magnitude. A function, not ==: an == that returns an expression rather than a bool breaks the comparisons C++ rewrites from it. | |
| template<typename L, typename R> requires detail::HandleOperands<L, R> | |
| Handle< bool > | morph::ui::author::ne (L const &lhs, R const &rhs) |
| ne. | |
| template<typename R = Any> | |
| Handle< R > | morph::ui::author::call (std::string_view function, std::vector< AnyHandle > const &args) |
| A call of any expr/1 library function, for the functions without a builder of their own. | |
| Handle< bool > | morph::ui::author::engaged (AnyHandle const &value) |
| engaged: whether a value is not null. | |
| AnyHandle | morph::ui::author::coalesce (std::vector< AnyHandle > const &values) |
| coalesce: the first value that is not null. | |
| Handle< std::string > | morph::ui::author::concat (std::vector< AnyHandle > const &parts) |
| concat. | |
| Handle< std::string > | morph::ui::author::format (AnyHandle const &pattern, std::vector< AnyHandle > args) |
| format: a template with {0}, {1}, … placeholders. | |
| AnyHandle | morph::ui::author::concatLists (std::vector< AnyHandle > const &lists) |
| concatLists: the lists, one after another; null while any of them is null. | |
| template<typename T> | |
| Handle< std::vector< T > > | morph::ui::author::concatLists (std::vector< Handle< std::vector< T > > > const &lists) |
| concatLists of lists of one element type. | |
| Handle< std::int64_t > | morph::ui::author::count (AnyHandle const &list) |
| count: a list's length. | |
| AnyHandle | morph::ui::author::sum (AnyHandle const &list) |
| sum of a list of numbers. | |
| Handle< bool > | morph::ui::author::includes (AnyHandle const &list, AnyHandle const &value) |
| includes: whether a list holds a value. | |
| Handle< bool > | morph::ui::author::isEmpty (AnyHandle const &value) |
| isEmpty: an empty string or list. | |
| AnyHandle | morph::ui::author::round (AnyHandle const &value, std::int64_t places) |
| round(x, dp), half to even. | |
| AnyHandle | morph::ui::author::parseDecimal (AnyHandle const &text) |
| parseDecimal(text): typed text, in the client's locale, as an exact decimal; null while it does not spell one. | |
| AnyHandle | morph::ui::author::parseDecimal (AnyHandle const &text, std::int64_t places) |
parseDecimal(text, dp): typed text as an exact decimal at places; null while it does not spell one, or when it has more fraction digits than places. | |
| Handle< std::string > | morph::ui::author::quantity (AnyHandle const &value) |
| quantity(x): a quantity for display in its own unit. | |
| Handle< std::string > | morph::ui::author::quantity (AnyHandle const &value, AnyHandle const &unit) |
| quantity(x, unit): a quantity for display in another unit. | |
| Handle< std::string > | morph::ui::author::t (std::string const &key, std::string const &fallback, std::vector< std::pair< std::string, AnyHandle > > const &args={}) |
| t(key, fallback, args): a translated MessageFormat 2 message. | |
| template<typename T> | |
| Handle< T > | morph::ui::author::cond (Handle< bool > const &condition, Handle< T > const &then, Handle< T > const &otherwise) |
| {"if": [c, a, b]}: a choice between two values. | |
| AnyHandle | morph::ui::author::obj (std::vector< std::pair< std::string, AnyHandle > > const &fields) |
| {"obj": {...}}: a record built from expressions. | |
| AnyHandle | morph::ui::author::content () |
| The content sizing, "content": as much as the content needs. | |
| AnyHandle | morph::ui::author::fixed (int units) |
| A fixed sizing, {"lit": {"fixed": units}}. | |
| AnyHandle | morph::ui::author::stretch (int weight=1) |
| A stretch sizing, {"lit": {"stretch": weight}}: a share of the leftover space. | |
| AnyHandle | morph::ui::author::list (std::vector< AnyHandle > const &items) |
| {"list": [...]}: a list built from expressions. | |
| template<typename T = Any> | |
| Handle< T > | morph::ui::author::ref (std::string const &path) |
| A named read, {"ref": "name.path"}: a param, state, let, query value, element value or bound name. | |
| template<typename T = Any> | |
| Handle< T > | morph::ui::author::row () |
| The innermost row, {"row": ""}. | |
| template<typename Class, typename Member> | |
| Handle< Member > | morph::ui::author::row (Member Class::*member) |
| A field of the innermost row, by member pointer. | |
| AnyHandle | morph::ui::author::row (std::string const &path) |
| A field of the innermost row, by name. | |
| template<typename E = Any> | |
| AnyHandle | morph::ui::author::map (AnyHandle const &source, std::string const &name, std::type_identity_t< std::function< AnyHandle(Handle< E > const &)> > const &body) |
| A comprehension over a list, {"map": e, "as": "x", "to": e}. | |
| template<typename E = Any> | |
| AnyHandle | morph::ui::author::filter (AnyHandle const &source, std::string const &name, std::type_identity_t< std::function< Handle< bool >(Handle< E > const &)> > const &where) |
| A filter over a list, {"filter": e, "as": "x", "where": e}. | |
| template<typename Class> | |
| AnyHandle | morph::ui::author::filter (AnyHandle const &source, bool Class::*member) |
| The elements of a list whose boolean member is true. | |
| AnyHandle | morph::ui::author::env (std::string const &name) |
| A client environment value, {"env": name}: widthClass, locale, platform, online, backend. | |
| AnyHandle | morph::ui::author::session (std::string const &name) |
| A session attribute, {"session": name}. | |
| AnyHandle | morph::ui::author::hostValue (std::string const &name) |
| A value the application registered with the client, {"host": name}. | |
| AnyHandle | morph::ui::author::prop (std::string const &name) |
| A prop of a component, inside the component's fallback. | |
| AnyHandle | morph::ui::author::event () |
| The payload of the event whose command list runs. | |
| Element | morph::ui::author::element (std::string name) |
| An element of the view. | |
| template<typename T> | |
| std::string | morph::ui::author::detail::typeName () |
| A document type name for a C++ type, as params and state declare it. | |
| std::string | morph::ui::author::showErrorsName (ShowErrors when) |
| The spelling of a ShowErrors. | |
| void | morph::ui::author::detail::putPresent (Json &json, char const *key, AnyHandle const &value) |
| An expression key of a part, left out when absent. | |
| Json | morph::ui::author::detail::headBadge (HeadBadgeOptions const &badge) |
| A headBadge part's JSON. | |
| Json | morph::ui::author::detail::actionButton (ActionButtonOptions const &action) |
| An actionButton part's JSON. | |
| void | morph::ui::author::detail::append (Json &json, char const *key, Json item) |
Appends item to the array at key of json, making the array on first use. | |
| Command | morph::ui::author::detail::command (std::string_view key, Json value) |
| A command with one key. | |
| Command | morph::ui::author::set (AnyHandle const &target, AnyHandle const &value) |
| set: writes a state, an input's value or an app name. | |
| Command | morph::ui::author::reset (AnyHandle const &target) |
| reset: a state to its init, or a dialog's scope. | |
| template<typename Action> | |
| Command | morph::ui::author::run (MutationHandle< Action > const &mutation, Body< Action > const &body={}, RunOptions const &options={}) |
| run: runs a mutation. | |
| Command | morph::ui::author::refetch (QueryRef const &query) |
| refetch: refetches a query. | |
| Command | morph::ui::author::open (Element const &dialog) |
| open: opens a dialog or drawer. | |
| Command | morph::ui::author::close (Element const &dialog) |
| close: closes a dialog or drawer. | |
| Command | morph::ui::author::close (Self current) |
| close of the dialog or drawer the command list runs in. | |
| Command | morph::ui::author::focus (Element const &target) |
| focus: moves the keyboard focus to an element. | |
| Command | morph::ui::author::detail::navigation (Json json, NavigateOptions const &options) |
| Writes navigate's options. | |
| Command | morph::ui::author::navigate (std::string const &screenId, NavigateOptions const &options={}) |
| navigate to a screen by id. | |
| Command | morph::ui::author::navigateRoute (AnyHandle const &route, NavigateOptions const &options={}) |
| navigate to a route. | |
| Command | morph::ui::author::returnWith (AnyHandle const &value) |
| return: a dialog screen's result. | |
| Command | morph::ui::author::host (std::string const &name, AnyHandle const &args={}) |
| host: a command the application registered with the client. | |
| Command | morph::ui::author::switchBackend (std::string const &name) |
| switchBackend: switches to a named backend. | |
| Command | morph::ui::author::resetPrefs (Point const &point) |
| resetPrefs: resets a customization point to the document's default. | |
| Command | morph::ui::author::resetAllPrefs () |
| resetPrefs of every point of the screen. | |
| Command | morph::ui::author::setLocale (std::string const &locale) |
| setLocale: switches the client's locale. | |
| Command | morph::ui::author::notify (AnyHandle const &message, Role role=Role::Info) |
| notify: shows a notification. | |
| Command | morph::ui::author::seq (Commands const &steps) |
| seq: steps in order; a failed step stops the rest. | |
| Command | morph::ui::author::all (Commands const &steps) |
| all: steps started together. | |
| Command | morph::ui::author::ifThen (AnyHandle const &condition, Commands const &then, Commands const &otherwise={}) |
| if: commands chosen by a condition. | |
| Command | morph::ui::author::cancelClose () |
| cancelClose: keeps a screen open, inside onClose. | |
| Command | morph::ui::author::retry () |
| retry: refetches every failed query of a boundary, inside its error. | |
| Command | morph::ui::author::signIn (MutationRef const &mutation) |
| signIn: runs a sign-in mutation and installs the token it returns. | |
| Command | morph::ui::author::signOut () |
| signOut. | |
| Command | morph::ui::author::upload (AnyHandle const &file, MutationRef const &mutation, UploadOptions const &options={}) |
| upload: sends a file through a mutation (files/1). | |
| Command | morph::ui::author::downloadToFile (AnyHandle const &file, AnyHandle const &name={}) |
| download to a file the user picks. | |
| Command | morph::ui::author::downloadToPreview (AnyHandle const &file, AnyHandle const &state) |
| download to a preview URL, bound to a state. | |
| Node | morph::ui::author::text (TextOptions const &options) |
| A text node. | |
| Node | morph::ui::author::button (ButtonOptions const &options) |
| A button node. | |
| Node | morph::ui::author::textInput (TextInputOptions const &options) |
| A textInput node. | |
| Node | morph::ui::author::checkbox (CheckboxOptions const &options) |
| A checkbox node. | |
| Node | morph::ui::author::select (SelectOptions const &options) |
| A select node. | |
| Json | morph::ui::author::detail::menuItem (MenuItem const &item) |
| A menu item's JSON. | |
| Node | morph::ui::author::menu (std::vector< MenuItem > const &items) |
| A menu node. | |
| Node | morph::ui::author::detail::stackNode (char const *kind, Nodes const &children, ContainerOptions const &options) |
| A row or column with its options. | |
| Node | morph::ui::author::column (Nodes const &children, ContainerOptions const &options={}) |
| A column node. | |
| Node | morph::ui::author::row (Nodes const &children, ContainerOptions const &options={}) |
| A row node. | |
| Node | morph::ui::author::grid (Nodes const &children, ContainerOptions const &options={}) |
| A grid node. | |
| Node | morph::ui::author::spacer () |
| A spacer node. | |
| Node | morph::ui::author::panel (Nodes const &children, PanelOptions const &options={}) |
| A panel node. | |
| Node | morph::ui::author::scroll (Nodes const &children, AnyHandle const &axis={}) |
| A scroll node. | |
| Node | morph::ui::author::switchOn (AnyHandle const &value, std::vector< Case > const &cases, Nodes const &fallback={}) |
| A switch node: shows the first case whose when equals its value. | |
| Node | morph::ui::author::tabs (std::vector< Tab > const &tabs) |
| A tabs node. | |
| Node | morph::ui::author::detail::dialogNode (std::string_view kind, Element const &element, DialogOptions const &options, ScopeBuilder const &builder) |
| A dialog or drawer. | |
| Node | morph::ui::author::dialog (Element const &element, Nodes const &children, DialogOptions const &options={}) |
| A dialog node, a scope of its own; open and close name it by its element. | |
| Node | morph::ui::author::dialog (Element const &element, DialogOptions const &options, ScopeBuilder const &builder) |
| A dialog node that declares on its own scope. | |
| Node | morph::ui::author::drawer (Element const &element, Nodes const &children, DialogOptions const &options={}) |
| A drawer node, a scope of its own. | |
| Node | morph::ui::author::busy (AnyHandle const &active, AnyHandle const &label={}) |
| A busy node. | |
| Node | morph::ui::author::forEach (AnyHandle const &rows, ForEachOptions const &options, ScopeBuilder const &builder) |
| A forEach node: its children once per row, each row a scope of its own. | |
| std::vector< TableColumn > | morph::ui::author::cells (std::vector< Node > const &cells) |
| Columns from cells alone, without ids or labels. | |
| Node | morph::ui::author::detail::tableNode (NodeWriter &node, TableOptions const &options, DeclScope const &scope, std::vector< TableColumn > const &columns) |
| Writes a table's options after its source. | |
| Node | morph::ui::author::table (AnyHandle const &rows, TableOptions const &options) |
| A table over a list, with the columns in its options. | |
| Node | morph::ui::author::table (AnyHandle const &rows, TableOptions const &options, std::function< std::vector< TableColumn >(DeclScope &)> const &builder) |
| A table over a list whose rows declare on their own scope. | |
| template<typename Action, typename Model> requires Runs<Model, Action> | |
| Node | morph::ui::author::dataTable (ModelHandle< Model > const &model, Body< Action > const &body, TableOptions const &options={}) |
| A table declared from a model's list action (spec 7): the client derives its columns from the row type and the table engine sorts, filters, selects and pages. | |
| template<typename Action, typename Model> requires Runs<Model, Action> | |
| Node | morph::ui::author::dataTable (ModelHandle< Model > const &model, TableOptions const &options={}) |
| A table declared from a model's list action that takes no parameters of its own. | |
| Node | morph::ui::author::dateTimeInput (AnyHandle const &value, AnyHandle const &label, Commands const &commit={}) |
| A dateTimeInput node. | |
| Node | morph::ui::author::dateTimeInput (DateTimeInputOptions const &options) |
| A dateTimeInput node. | |
| Node | morph::ui::author::slider (SliderOptions const &options) |
| A slider node. | |
| Node | morph::ui::author::filePicker (FilePickerOptions const &options) |
| A filePicker node. | |
| void | morph::ui::author::detail::actionPart (NodeWriter &node, std::optional< ActionPart > const &action) |
| Writes an action part. | |
| Node | morph::ui::author::banner (BannerOptions const &options) |
| A banner node. | |
| Node | morph::ui::author::badge (AnyHandle const &text, AnyHandle const &tone={}, AnyHandle const &icon={}) |
| A badge node. | |
| Node | morph::ui::author::progress (AnyHandle const &value, AnyHandle const &label={}) |
| A progress node. | |
| Node | morph::ui::author::steps (AnyHandle const &items, AnyHandle const ¤t={}) |
| A steps node. | |
| Node | morph::ui::author::keyValue (AnyHandle const &items) |
| A keyValue node. | |
| Node | morph::ui::author::emptyState (EmptyStateOptions const &options) |
| An emptyState node. | |
| Node | morph::ui::author::splitter (Nodes const &children, AnyHandle const &orientation={}, AnyHandle const &sizes={}) |
| A splitter node. | |
| Node | morph::ui::author::collapsible (Nodes const &children, CollapsibleOptions const &options={}) |
| A collapsible node. | |
| Node | morph::ui::author::dropZone (Nodes const &children, DropZoneOptions const &options={}) |
| A dropZone node. | |
| Node | morph::ui::author::customize (Point const &point) |
| A customize node: the editor of a customization point. | |
| Node | morph::ui::author::boundary (Nodes const &children, Nodes const &loading={}, Nodes const &error={}) |
| A boundary node: loading until its queries have values, error when one failed without one. | |
| void | morph::ui::author::detail::present (NodeWriter &node, FormPresentation const &presentation) |
Writes presentation's keys on node. | |
| template<typename Action, typename Model> requires Runs<Model, Action> | |
| Node | morph::ui::author::form (ModelHandle< Model > const &model, FormOptions< Action > const &options={}) |
| A form node: a schema form of the forms engine over an action (spec 2); each field takes its label from the schema or the overlay. | |
| template<typename Action, typename Model> requires Runs<Model, Action> | |
| Node | morph::ui::author::collection (ModelHandle< Model > const &model, FormPresentation const &presentation={}) |
| A collection node: the forms engine's list screen over an action. | |
| template<typename Action, typename Model> requires Runs<Model, Action> | |
| Node | morph::ui::author::wizard (ModelHandle< Model > const &model, FormPresentation const &presentation={}) |
| A wizard node: the forms engine's wizard over an action. | |
| Node | morph::ui::author::custom (ComponentRef const &component, CustomOptions const &options={}) |
| A custom node: a declared component with its props and events. | |
| bool | morph::ui::author::detail::names (DocNode const &node, std::string_view key) |
| Whether a node has a property that names it: present, and not the constant "" or null. | |
| bool | morph::ui::author::detail::hasA11yName (DocNode const &node) |
| Whether a node has an a11y.name that names it. | |
| std::string | morph::ui::author::detail::brokenRule (DocNode const &node) |
| The accessibility rule a node breaks, if any. | |
| std::optional< Refusal > | morph::ui::author::detail::accessibilityOf (DocNode const &node, std::string const &document) |
| The first accessibility rule a node or a node under it breaks. | |
| std::optional< Refusal > | morph::ui::author::detail::accessibilityOf (std::span< DocNodePtr const > nodes, std::string const &document) |
| The first accessibility rule the nodes of a list break. | |
| std::optional< Refusal > | morph::ui::author::checkAccessibility (Document const &document) |
| The accessibility rules of spec 5 §11, which registration runs after the load-time validation. | |
| template<morph::detail::FixedString Id> | |
| Screen | morph::ui::author::screen (Screen::Builder builder) |
| A screen with its id as a template argument, as spec 5 §11 writes it. | |
| Screen | morph::ui::author::screen (std::string screenId, Screen::Builder builder) |
| A screen. | |
| ScreenRegistry & | morph::ui::author::screenRegistry () noexcept |
| The process's screen registry, which MORPH_REGISTER_SCREEN enrols into. | |
| template<std::invocable Make> | |
| bool | morph::ui::author::enrollScreen (Make const &make) noexcept |
| Enrols a screen into the process's registry; what MORPH_REGISTER_SCREEN runs. | |
Variables | |
| constexpr Self | morph::ui::author::self {} |
| The dialog or drawer a command list runs in. | |
Server-side authoring of UI documents (spec 5 §11): typed builders that write a screen's JSON, and the registration that validates it once — loadDocument with the builders' catalog facts, then the accessibility rules.
The builders live in morph::ui::author, beside the view-tree builders of morph::ui that share their names; a screen's source writes namespace ui = morph::ui::author;. Specified in docs/spec/ui/author.md.
Definition in file author.hpp.
| #define MORPH_UI_AUTHOR_CAT_ | ( | a, | |
| b ) |
Concatenates two tokens after expanding them.
Definition at line 4701 of file author.hpp.
| #define MORPH_UI_AUTHOR_CAT | ( | a, | |
| b ) |
Concatenates two tokens after expanding them.
Definition at line 4703 of file author.hpp.
| #define MORPH_REGISTER_SCREEN | ( | SCREEN | ) |
Enrols a screen into the process's registry at static initialisation. A refusal is kept in screenRegistry().refusals(), which a server's test asserts is empty.
| SCREEN | The screen: an expression, such as a call of a function that returns it, or an object defined before the macro in the same translation unit. |
Definition at line 4713 of file author.hpp.
| using morph::ui::author::detail::UnwrappedT = Unwrapped<T>::type |
The type with one std::optional removed.
| T | The type. |
Definition at line 299 of file author.hpp.
| using morph::ui::author::detail::LiteralT = LiteralOf<std::remove_cvref_t<L>>::type |
The value type a constant stands for.
| L | The C++ type of the constant. |
Definition at line 398 of file author.hpp.
| using morph::ui::author::detail::ArithmeticT = std::conditional_t<IsHandle<L>::value, typename ValueOf<L>::type, typename ValueOf<R>::type> |
The value type of an arithmetic expression: the left handle's, else the right's.
| L | The left operand's C++ type. |
| R | The right operand's C++ type. |
Definition at line 429 of file author.hpp.
| using morph::ui::author::AnyHandle = Handle<Any> |
An expression whose value type is not tracked: the type of every node property.
Definition at line 739 of file author.hpp.
| using morph::ui::author::RowScope = DeclScope |
The scope a row of a table or forEach declares its own state, queries and model aliases on.
Definition at line 2319 of file author.hpp.
| using morph::ui::author::ScopeBuilder = std::function<Nodes(DeclScope&)> |
A scope's builder: declares on the scope and returns the nodes that read it.
Definition at line 3467 of file author.hpp.
|
strong |
How a model alias binds when no key expression is given (spec 5 §5).
| Enumerator | |
|---|---|
| Default | shared when the catalog marks the model stateless, private otherwise. |
| Private | An instance of the scope's own. |
| Shared | The model's singleton. |
Definition at line 1546 of file author.hpp.
|
strong |
What a mutation run does while another is in flight.
| Enumerator | |
|---|---|
| Exclusive | The run is refused (the default). |
| Serial | Runs queue, one queue per serialKey. |
| Latest | Every run is sent; only the newest reply applies. |
| Parallel | Every run is sent; replies apply as they arrive. |
Definition at line 1624 of file author.hpp.
|
strong |
Which changes a watch reacts to.
| Enumerator | |
|---|---|
| Any | Every change. |
| User | Only the user's own edits. |
Definition at line 1718 of file author.hpp.
|
strong |
When a scope's element errors show (spec 5 §6).
| Enumerator | |
|---|---|
| Touched | Once the element has been touched. |
| Submit | Once the form or dialog has been submitted. |
| Always | At once. |
Definition at line 2322 of file author.hpp.
|
strong |
A prop type of a component: how a value crosses into QML (spec 5 §10).
| Enumerator | |
|---|---|
| String | Text. |
| Bool | A boolean. |
| Int | An integer, as text. |
| Exact | An exact decimal or quantity, as text. |
| Number | A double, for charts. |
| Json | Structured data, exact values inside it as text. |
Definition at line 2337 of file author.hpp.
|
strong |
How navigate opens a screen.
| Enumerator | |
|---|---|
| Default | The host's choice. |
| Tab | A tab. |
| Dialog | A dialog, which returns through onResult or onCancel. |
| Drawer | A drawer. |
| Window | A window. |
Definition at line 2800 of file author.hpp.
|
strong |
The role of a notification.
| Enumerator | |
|---|---|
| Info | Information. |
| Success | A success. |
| Warning | A warning. |
| Error | An error. |
Definition at line 2899 of file author.hpp.
|
strong |
When a text input commits its draft.
| Enumerator | |
|---|---|
| Change | On every edit. |
| Blur | On loss of focus. |
| Enter | On Enter. |
Definition at line 3178 of file author.hpp.
|
strong |
What a select does with a selection its new options no longer hold.
| Enumerator | |
|---|---|
| Clear | Clears it. |
| Keep | Keeps it. |
Definition at line 3252 of file author.hpp.
|
strong |
How a table's selection works.
| Enumerator | |
|---|---|
| None | No selection. |
| Single | One row. |
| Multiple | Several rows. |
Definition at line 3696 of file author.hpp.
|
strong |
Where a model-backed table sorts, filters and pages.
| Enumerator | |
|---|---|
| Client | In the client, over every row. |
| Server | In the server, through the action's table query. |
Definition at line 3703 of file author.hpp.
|
nodiscard |
The members of an action result that hold a list, when the result is a record.
| Result | The action's result type. |
Result as a record. Definition at line 102 of file author.hpp.
|
inlinenodiscard |
The catalog's form of an action's declared effects.
| actionId | The action's id. |
| morph::model::EffectsRegistrationError | when the registered records and effects are invalid. |
Definition at line 126 of file author.hpp.
|
inlinenodiscard |
The catalog's form of the records an action's result holds.
| actionId | The action's id. |
| morph::model::EffectsRegistrationError | when the registered records and effects are invalid. |
Definition at line 169 of file author.hpp.
|
nodiscardconsteval |
Whether a scalar value of one type can stand where a value of another is expected.
| From | The value's type, without std::optional. |
| To | The expected type, without std::optional. |
Definition at line 327 of file author.hpp.
|
nodiscardconsteval |
Whether an expression of one value type can stand where a value of another is expected. null propagates through every expression, so an optional value may stand for a required one.
| From | The expression's value type. |
| To | The expected value type. |
Definition at line 341 of file author.hpp.
|
nodiscard |
A C++ scalar as a document value.
| L | The scalar's type. |
| literal | The scalar. |
Definition at line 436 of file author.hpp.
|
nodiscard |
A C++ constant as a document value.
| L | The constant's type. |
| literal | The constant. |
Definition at line 454 of file author.hpp.
Sets a member of a JSON object, replacing one of the same name and keeping the order of the others.
| object | The object. |
| key | The member's name. |
| value | The member's value. |
Definition at line 473 of file author.hpp.
|
inline |
Sets a member of a JSON object to another object, unless that one is empty.
| object | The object. |
| key | The member's name. |
| section | The value; an empty object is left out. |
Definition at line 481 of file author.hpp.
|
inlinenodiscard |
How many members a JSON object has.
| object | The object. |
Definition at line 490 of file author.hpp.
|
inlinenodiscard |
A document value as a constant expression: a scalar as itself, a list, record, decimal or quantity wrapped in {"lit": v}.
| value | The value. |
Definition at line 496 of file author.hpp.
|
inlinenodiscard |
A one-key JSON object.
| key | The key. |
| value | The value. |
Definition at line 510 of file author.hpp.
|
inlinenodiscard |
An alignment's document name.
| align | The alignment. |
Definition at line 519 of file author.hpp.
|
inlinenodiscard |
A justification's document name.
| justify | The justification. |
Definition at line 527 of file author.hpp.
|
inlinenodiscard |
The value of a constant expression, as constant writes one.
| expression | The expression's JSON. |
Definition at line 535 of file author.hpp.
|
inlinenodiscard |
A call of an expr/1 library function.
| function | The function's name. |
| args | The argument expressions. |
Definition at line 553 of file author.hpp.
|
inlinenodiscard |
The dotted path a named read reads, when the expression is one.
| json | The expression. |
Definition at line 564 of file author.hpp.
|
inlinenodiscard |
A field read below a named read.
| json | The named read. |
| field | The field. |
| AuthoringError | when json is not a named read: expr/1 reads fields only below a name. |
Definition at line 582 of file author.hpp.
|
inlinenodiscard |
The name a named read reads.
| json | The expression. |
| what | What the name is for, for the error. |
| AuthoringError | when json is not a ref. |
Definition at line 603 of file author.hpp.
|
nodiscard |
The reflected name of a data member, found by its address in a value-initialised object of its class.
| Class | The class; glaze reflects it. |
| Member | The member's type. |
| member | The member. |
| AuthoringError | when the member is not one glaze reflects. |
Definition at line 618 of file author.hpp.
|
nodiscard |
An operand's JSON.
| X | The operand's C++ type. |
| operand | The operand. |
Definition at line 748 of file author.hpp.
|
nodiscard |
A two-operand call.
| Result | The result's value type. |
| L | The left operand's C++ type. |
| R | The right operand's C++ type. |
| function | The library function. |
| lhs | The left operand. |
| rhs | The right operand. |
Definition at line 765 of file author.hpp.
|
nodiscard |
add.
| L | The left operand's C++ type. |
| R | The right operand's C++ type. |
| lhs | The left operand. |
| rhs | The right operand. |
Definition at line 779 of file author.hpp.
|
nodiscard |
sub.
| L | The left operand's C++ type. |
| R | The right operand's C++ type. |
| lhs | The left operand. |
| rhs | The right operand. |
Definition at line 791 of file author.hpp.
|
nodiscard |
mul.
| L | The left operand's C++ type. |
| R | The right operand's C++ type. |
| lhs | The left operand. |
| rhs | The right operand. |
Definition at line 803 of file author.hpp.
|
nodiscard |
div.
| L | The left operand's C++ type. |
| R | The right operand's C++ type. |
| lhs | The left operand. |
| rhs | The right operand. |
Definition at line 815 of file author.hpp.
|
nodiscard |
lt.
| L | The left operand's C++ type. |
| R | The right operand's C++ type. |
| lhs | The left operand. |
| rhs | The right operand. |
Definition at line 815 of file author.hpp.
|
nodiscard |
le.
| L | The left operand's C++ type. |
| R | The right operand's C++ type. |
| lhs | The left operand. |
| rhs | The right operand. |
Definition at line 815 of file author.hpp.
|
nodiscard |
gt.
| L | The left operand's C++ type. |
| R | The right operand's C++ type. |
| lhs | The left operand. |
| rhs | The right operand. |
Definition at line 851 of file author.hpp.
|
nodiscard |
ge.
| L | The left operand's C++ type. |
| R | The right operand's C++ type. |
| lhs | The left operand. |
| rhs | The right operand. |
Definition at line 863 of file author.hpp.
|
nodiscard |
and, with Kleene's three-valued logic. Both operands are written: a document has no short circuit.
| L | The left operand's C++ type. |
| R | The right operand's C++ type. |
| lhs | The left operand. |
| rhs | The right operand. |
Definition at line 875 of file author.hpp.
|
nodiscard |
or, with Kleene's three-valued logic.
| L | The left operand's C++ type. |
| R | The right operand's C++ type. |
| lhs | The left operand. |
| rhs | The right operand. |
Definition at line 887 of file author.hpp.
|
nodiscard |
not.
| T | The operand's value type. |
| operand | The operand. |
Definition at line 896 of file author.hpp.
|
nodiscard |
neg.
| T | The operand's value type. |
| operand | The operand. |
Definition at line 905 of file author.hpp.
|
nodiscard |
eq: equality of magnitude. A function, not ==: an == that returns an expression rather than a bool breaks the comparisons C++ rewrites from it.
| L | The left operand's C++ type. |
| R | The right operand's C++ type. |
| lhs | The left operand. |
| rhs | The right operand. |
Definition at line 918 of file author.hpp.
|
nodiscard |
ne.
| L | The left operand's C++ type. |
| R | The right operand's C++ type. |
| lhs | The left operand. |
| rhs | The right operand. |
Definition at line 930 of file author.hpp.
|
nodiscard |
A call of any expr/1 library function, for the functions without a builder of their own.
| R | The result's value type. |
| function | The function's name. |
| args | The arguments. |
Definition at line 940 of file author.hpp.
|
inlinenodiscard |
engaged: whether a value is not null.
| value | The value. |
Definition at line 952 of file author.hpp.
|
inlinenodiscard |
coalesce: the first value that is not null.
| values | The candidates, in order. |
Definition at line 957 of file author.hpp.
|
inlinenodiscard |
concat.
| parts | The strings. |
Definition at line 962 of file author.hpp.
|
inlinenodiscard |
format: a template with {0}, {1}, … placeholders.
| pattern | The template. |
| args | The values for the placeholders. |
Definition at line 970 of file author.hpp.
|
inlinenodiscard |
concatLists: the lists, one after another; null while any of them is null.
| lists | The lists, in order. |
Definition at line 981 of file author.hpp.
|
nodiscard |
concatLists of lists of one element type.
| T | The element type. |
| lists | The lists, in order. |
Definition at line 988 of file author.hpp.
|
inlinenodiscard |
count: a list's length.
| list | The list. |
Definition at line 1000 of file author.hpp.
|
inlinenodiscard |
sum of a list of numbers.
| list | The list. |
Definition at line 1005 of file author.hpp.
|
inlinenodiscard |
includes: whether a list holds a value.
| list | The list. |
| value | The value. |
Definition at line 1011 of file author.hpp.
|
inlinenodiscard |
isEmpty: an empty string or list.
| value | The string or list. |
Definition at line 1018 of file author.hpp.
|
inlinenodiscard |
round(x, dp), half to even.
| value | The number. |
| places | The places. |
Definition at line 1024 of file author.hpp.
|
inlinenodiscard |
parseDecimal(text): typed text, in the client's locale, as an exact decimal; null while it does not spell one.
| text | The text, typically a text input's event. |
Definition at line 1032 of file author.hpp.
|
inlinenodiscard |
parseDecimal(text, dp): typed text as an exact decimal at places; null while it does not spell one, or when it has more fraction digits than places.
| text | The text, typically a text input's event. |
| places | The places, 0 to 18. |
Definition at line 1039 of file author.hpp.
|
inlinenodiscard |
quantity(x): a quantity for display in its own unit.
| value | The quantity. |
Definition at line 1046 of file author.hpp.
|
inlinenodiscard |
quantity(x, unit): a quantity for display in another unit.
| value | The quantity. |
| unit | The display unit. |
Definition at line 1054 of file author.hpp.
|
inlinenodiscard |
t(key, fallback, args): a translated MessageFormat 2 message.
| key | The catalogue key. |
| fallback | The pattern shown when the catalogue has none. |
| args | The named arguments. |
Definition at line 1063 of file author.hpp.
|
nodiscard |
{"if": [c, a, b]}: a choice between two values.
| T | The value type of the branches. |
| condition | The condition. |
| then | The value when it is true. |
| otherwise | The value otherwise. |
Definition at line 1085 of file author.hpp.
|
inlinenodiscard |
{"obj": {...}}: a record built from expressions.
| fields | The fields, in order. |
Definition at line 1094 of file author.hpp.
|
inlinenodiscard |
The content sizing, "content": as much as the content needs.
Definition at line 1104 of file author.hpp.
|
inlinenodiscard |
A fixed sizing, {"lit": {"fixed": units}}.
| units | The size in backend units, 0 or more. |
Definition at line 1109 of file author.hpp.
|
inlinenodiscard |
A stretch sizing, {"lit": {"stretch": weight}}: a share of the leftover space.
| weight | The share's weight, 1 or more. |
Definition at line 1116 of file author.hpp.
|
inlinenodiscard |
{"list": [...]}: a list built from expressions.
| items | The items. |
Definition at line 1123 of file author.hpp.
|
nodiscard |
A named read, {"ref": "name.path"}: a param, state, let, query value, element value or bound name.
| T | The value type. |
| path | The name and path. |
Definition at line 1137 of file author.hpp.
|
nodiscard |
The innermost row, {"row": ""}.
| T | The row's type. |
Definition at line 1145 of file author.hpp.
|
nodiscard |
A field of the innermost row, by member pointer.
| Class | The row type. |
| Member | The member's type. |
| member | The member. |
Definition at line 1155 of file author.hpp.
|
inlinenodiscard |
A field of the innermost row, by name.
| path | The field or dotted path. |
Definition at line 1162 of file author.hpp.
|
nodiscard |
A comprehension over a list, {"map": e, "as": "x", "to": e}.
| E | The element type. |
| source | The list. |
| name | The element's name inside body. |
| body | Builds the mapped value from the element's handle. |
Definition at line 1171 of file author.hpp.
|
nodiscard |
A filter over a list, {"filter": e, "as": "x", "where": e}.
| E | The element type. |
| source | The list. |
| name | The element's name inside where. |
| where | Builds the condition from the element's handle. |
Definition at line 1187 of file author.hpp.
|
nodiscard |
The elements of a list whose boolean member is true.
| Class | The element type. |
| source | The list. |
| member | The member. |
Definition at line 1202 of file author.hpp.
|
inlinenodiscard |
A client environment value, {"env": name}: widthClass, locale, platform, online, backend.
| name | The name. |
Definition at line 1209 of file author.hpp.
|
inlinenodiscard |
A session attribute, {"session": name}.
| name | The attribute. |
Definition at line 1214 of file author.hpp.
|
inlinenodiscard |
A value the application registered with the client, {"host": name}.
| name | The value's name. |
Definition at line 1221 of file author.hpp.
|
inlinenodiscard |
A prop of a component, inside the component's fallback.
| name | The prop. |
Definition at line 1228 of file author.hpp.
|
inlinenodiscard |
The payload of the event whose command list runs.
Definition at line 1232 of file author.hpp.
|
inlinenodiscard |
An element of the view.
| name | The element's id. |
Definition at line 1289 of file author.hpp.
|
nodiscard |
A document type name for a C++ type, as params and state declare it.
| T | The C++ type. |
Definition at line 2019 of file author.hpp.
|
inlinenodiscard |
The spelling of a ShowErrors.
| when | The policy. |
Definition at line 2331 of file author.hpp.
|
inline |
An expression key of a part, left out when absent.
| json | The part. |
| key | The key. |
| value | The expression. |
Definition at line 2436 of file author.hpp.
|
inlinenodiscard |
A headBadge part's JSON.
| badge | The badge. |
Definition at line 2445 of file author.hpp.
|
inlinenodiscard |
An actionButton part's JSON.
| action | The button. |
Definition at line 2457 of file author.hpp.
Appends item to the array at key of json, making the array on first use.
| json | The object. |
| key | The key. |
| item | The item. |
Definition at line 2481 of file author.hpp.
|
inlinenodiscard |
A command with one key.
| key | The command's key. |
| value | The key's value. |
Definition at line 2713 of file author.hpp.
|
inlinenodiscard |
set: writes a state, an input's value or an app name.
| target | The state or element, as its read. |
| value | The value. |
| AuthoringError | when target is not a named read. |
Definition at line 2724 of file author.hpp.
|
inlinenodiscard |
reset: a state to its init, or a dialog's scope.
| target | The state, as its read. |
| AuthoringError | when target is not a named read. |
Definition at line 2735 of file author.hpp.
|
nodiscard |
run: runs a mutation.
| Action | The mutation's action. |
| mutation | The mutation. |
| body | The body; empty for the mutation's own. |
| options | each and as. |
Definition at line 2755 of file author.hpp.
|
inlinenodiscard |
refetch: refetches a query.
| query | The query. |
Definition at line 2774 of file author.hpp.
|
inlinenodiscard |
open: opens a dialog or drawer.
| dialog | The dialog. |
Definition at line 2779 of file author.hpp.
|
inlinenodiscard |
close: closes a dialog or drawer.
| dialog | The dialog. |
Definition at line 2784 of file author.hpp.
|
inlinenodiscard |
close of the dialog or drawer the command list runs in.
| current | self. |
Definition at line 2789 of file author.hpp.
|
inlinenodiscard |
focus: moves the keyboard focus to an element.
| target | The element. |
Definition at line 2797 of file author.hpp.
|
inlinenodiscard |
Writes navigate's options.
| json | The command. |
| options | The options. |
Definition at line 2826 of file author.hpp.
|
inlinenodiscard |
navigate to a screen by id.
| screenId | The screen. |
| options | Params, how it opens, and what runs when it returns. |
Definition at line 2849 of file author.hpp.
|
inlinenodiscard |
navigate to a route.
| route | The route expression. |
| options | Params, how it opens, and what runs when it returns. |
Definition at line 2857 of file author.hpp.
|
inlinenodiscard |
return: a dialog screen's result.
| value | The value. |
Definition at line 2864 of file author.hpp.
|
inlinenodiscard |
host: a command the application registered with the client.
| name | The command. |
| args | Its arguments; absent for none. |
Definition at line 2870 of file author.hpp.
|
inlinenodiscard |
switchBackend: switches to a named backend.
| name | The backend. |
Definition at line 2882 of file author.hpp.
|
inlinenodiscard |
resetPrefs: resets a customization point to the document's default.
| point | The point. |
Definition at line 2887 of file author.hpp.
|
inlinenodiscard |
resetPrefs of every point of the screen.
Definition at line 2891 of file author.hpp.
|
inlinenodiscard |
setLocale: switches the client's locale.
| locale | The locale, such as de. |
Definition at line 2896 of file author.hpp.
|
inlinenodiscard |
notify: shows a notification.
| message | The message. |
| role | Its role. |
Definition at line 2910 of file author.hpp.
|
inlinenodiscard |
seq: steps in order; a failed step stops the rest.
| steps | The steps. |
Definition at line 2923 of file author.hpp.
|
inlinenodiscard |
all: steps started together.
| steps | The steps. |
Definition at line 2928 of file author.hpp.
|
inlinenodiscard |
if: commands chosen by a condition.
| condition | The condition. |
| then | The commands when it is true. |
| otherwise | The commands otherwise; empty runs nothing. |
Definition at line 2935 of file author.hpp.
|
inlinenodiscard |
cancelClose: keeps a screen open, inside onClose.
Definition at line 2945 of file author.hpp.
|
inlinenodiscard |
retry: refetches every failed query of a boundary, inside its error.
Definition at line 2949 of file author.hpp.
|
inlinenodiscard |
signIn: runs a sign-in mutation and installs the token it returns.
| mutation | The mutation. |
Definition at line 2954 of file author.hpp.
|
inlinenodiscard |
|
inlinenodiscard |
upload: sends a file through a mutation (files/1).
| file | The file reference. |
| mutation | The mutation. |
| options | as and the transfer id. |
Definition at line 2975 of file author.hpp.
|
inlinenodiscard |
download to a file the user picks.
| file | The file reference. |
| name | The suggested name; absent for none. |
Definition at line 2993 of file author.hpp.
|
inlinenodiscard |
download to a preview URL, bound to a state.
| file | The file reference. |
| state | The state the URL is written to, as its read. |
| AuthoringError | when state is not a named read. |
Definition at line 3008 of file author.hpp.
|
inlinenodiscard |
A text node.
| options | The text. |
Definition at line 3126 of file author.hpp.
|
inlinenodiscard |
A button node.
| options | The button. |
Definition at line 3156 of file author.hpp.
|
inlinenodiscard |
A textInput node.
| options | The input. |
Definition at line 3210 of file author.hpp.
|
inlinenodiscard |
A checkbox node.
| options | The checkbox. |
Definition at line 3242 of file author.hpp.
|
inlinenodiscard |
A select node.
| options | The select. |
Definition at line 3278 of file author.hpp.
|
inlinenodiscard |
A menu item's JSON.
| item | The item. |
Definition at line 3314 of file author.hpp.
|
inlinenodiscard |
A menu node.
| items | The items. |
Definition at line 3347 of file author.hpp.
|
inlinenodiscard |
A row or column with its options.
| kind | row or column. |
| children | The children. |
| options | The gap and the alignment. |
Definition at line 3376 of file author.hpp.
|
inlinenodiscard |
A column node.
| children | The children. |
| options | The gap and the alignment. |
Definition at line 3394 of file author.hpp.
|
inlinenodiscard |
A row node.
| children | The children. |
| options | The gap and the alignment. |
Definition at line 3402 of file author.hpp.
|
inlinenodiscard |
A grid node.
| children | The children. |
| options | The gap, columns and alignment; a justify is written, and the loader refuses it. |
Definition at line 3410 of file author.hpp.
|
inlinenodiscard |
|
inlinenodiscard |
A panel node.
| children | The children. |
| options | The title, header and collapsing. |
Definition at line 3446 of file author.hpp.
|
inlinenodiscard |
A scroll node.
| children | The children. |
| axis | The axis; absent for the kind's own. |
Definition at line 3462 of file author.hpp.
|
inlinenodiscard |
A switch node: shows the first case whose when equals its value.
| value | The value the cases are compared with. |
| cases | The cases. |
| fallback | The nodes shown when no case matches. |
Definition at line 3511 of file author.hpp.
|
inlinenodiscard |
|
inlinenodiscard |
A dialog or drawer.
| kind | dialog or drawer. |
| element | Its element. |
| options | Its options. |
| builder | Declares on its scope and returns its children. |
Definition at line 3578 of file author.hpp.
|
inlinenodiscard |
A dialog node, a scope of its own; open and close name it by its element.
| element | The dialog's element. |
| children | The children. |
| options | The title and command lists. |
Definition at line 3611 of file author.hpp.
|
inlinenodiscard |
A dialog node that declares on its own scope.
| element | The dialog's element. |
| options | The title and command lists. |
| builder | Declares on the dialog's scope and returns its children. |
Definition at line 3620 of file author.hpp.
|
inlinenodiscard |
A drawer node, a scope of its own.
| element | The drawer's element. |
| children | The children. |
| options | The title, side and command lists. |
Definition at line 3629 of file author.hpp.
|
inlinenodiscard |
A busy node.
| active | Whether it shows. |
| label | Its label. |
Definition at line 3637 of file author.hpp.
|
inlinenodiscard |
A forEach node: its children once per row, each row a scope of its own.
| rows | The list. |
| options | The key, axis and gap. |
| builder | Declares on a row's scope and returns its nodes. |
Definition at line 3656 of file author.hpp.
|
inlinenodiscard |
Columns from cells alone, without ids or labels.
| cells | The cells, one per column. |
Definition at line 3686 of file author.hpp.
|
inlinenodiscard |
Writes a table's options after its source.
| node | The table so far. |
| options | The options. |
| scope | The row scope. |
| columns | The columns. |
Definition at line 3749 of file author.hpp.
|
inlinenodiscard |
A table over a list, with the columns in its options.
| rows | The rows. |
| options | The key, columns, selection and command lists. |
Definition at line 3806 of file author.hpp.
|
inlinenodiscard |
A table over a list whose rows declare on their own scope.
| rows | The rows. |
| options | The key, selection and command lists. |
| builder | Declares on a row's scope and returns the columns. |
Definition at line 3817 of file author.hpp.
|
nodiscard |
A table declared from a model's list action (spec 7): the client derives its columns from the row type and the table engine sorts, filters, selects and pages.
| Action | The list action. |
| Model | The model type of the alias; it must run the action. |
| model | The alias. |
| body | The action's own parameters. |
| options | The mode, selection, columns and command lists. |
Definition at line 3836 of file author.hpp.
|
nodiscard |
A table declared from a model's list action that takes no parameters of its own.
| Action | The list action. |
| Model | The model type of the alias; it must run the action. |
| model | The alias. |
| options | The mode, selection, columns and command lists. |
Definition at line 3860 of file author.hpp.
|
inlinenodiscard |
A dateTimeInput node.
| value | The value. |
| label | The label. |
| commit | Commands run on a commit. |
Definition at line 3869 of file author.hpp.
|
inlinenodiscard |
A dateTimeInput node.
| options | The input. |
Definition at line 3890 of file author.hpp.
|
inlinenodiscard |
A slider node.
| options | The slider. |
Definition at line 3921 of file author.hpp.
|
inlinenodiscard |
A filePicker node.
| options | The picker. |
Definition at line 3950 of file author.hpp.
|
inline |
Writes an action part.
| node | The node. |
| action | The action; absent leaves it out. |
Definition at line 3973 of file author.hpp.
|
inlinenodiscard |
A banner node.
| options | The banner. |
Definition at line 4006 of file author.hpp.
|
inlinenodiscard |
A badge node.
| text | The text. |
| tone | The tone. |
| icon | An icon. |
Definition at line 4018 of file author.hpp.
|
inlinenodiscard |
A progress node.
| value | The fraction from 0 to 1; null is indeterminate. |
| label | The label. |
Definition at line 4026 of file author.hpp.
|
inlinenodiscard |
A steps node.
| items | The steps, [{label, state}]. |
| current | The current step. |
Definition at line 4034 of file author.hpp.
|
inlinenodiscard |
A keyValue node.
| items | The pairs, [{label, value}]. |
Definition at line 4041 of file author.hpp.
|
inlinenodiscard |
An emptyState node.
| options | The empty state. |
Definition at line 4060 of file author.hpp.
|
inlinenodiscard |
A splitter node.
| children | The panes. |
| orientation | The orientation. |
| sizes | The initial sizes. |
Definition at line 4072 of file author.hpp.
|
inlinenodiscard |
A collapsible node.
| children | The content. |
| options | The title, header and toggle. |
Definition at line 4097 of file author.hpp.
|
inlinenodiscard |
A dropZone node.
| children | The content. |
| options | The accepted files and the drop. |
Definition at line 4121 of file author.hpp.
|
inlinenodiscard |
A customize node: the editor of a customization point.
| point | The point. |
Definition at line 4133 of file author.hpp.
|
inlinenodiscard |
A boundary node: loading until its queries have values, error when one failed without one.
| children | The content. |
| loading | The nodes shown while loading. |
| error | The nodes shown on a failure; ref("boundary.error") and retry() are valid in them. |
Definition at line 4142 of file author.hpp.
|
inline |
Writes presentation's keys on node.
| node | The node being written. |
| presentation | The keys. |
Definition at line 4221 of file author.hpp.
|
nodiscard |
A form node: a schema form of the forms engine over an action (spec 2); each field takes its label from the schema or the overlay.
| Action | The action. |
| Model | The model type of the alias; it must run the action. |
| model | The alias. |
| options | The prefill, overlay and command lists. |
Definition at line 4271 of file author.hpp.
|
nodiscard |
A collection node: the forms engine's list screen over an action.
| Action | The action. |
| Model | The model type of the alias; it must run the action. |
| model | The alias. |
| presentation | The keys that reach every form the view draws; its title replaces the view's heading. |
Definition at line 4307 of file author.hpp.
|
nodiscard |
A wizard node: the forms engine's wizard over an action.
| Action | The action. |
| Model | The model type of the alias; it must run the action. |
| model | The alias. |
| presentation | The keys that reach every step's form; its title replaces the view's heading. |
Definition at line 4324 of file author.hpp.
|
inlinenodiscard |
A custom node: a declared component with its props and events.
| component | The component. |
| options | The props and events. |
Definition at line 4345 of file author.hpp.
|
inlinenodiscard |
Whether a node has a property that names it: present, and not the constant "" or null.
| node | The node. |
| key | The property. |
Definition at line 4373 of file author.hpp.
|
inlinenodiscard |
Whether a node has an a11y.name that names it.
| node | The node. |
Definition at line 4388 of file author.hpp.
|
inlinenodiscard |
The accessibility rule a node breaks, if any.
| node | The node. |
Definition at line 4396 of file author.hpp.
|
inlinenodiscard |
The first accessibility rule a node or a node under it breaks.
| node | The node. |
| document | The document's id. |
Definition at line 4446 of file author.hpp.
|
inlinenodiscard |
The first accessibility rule the nodes of a list break.
| nodes | The nodes. |
| document | The document's id. |
Definition at line 4436 of file author.hpp.
|
inlinenodiscard |
The accessibility rules of spec 5 §11, which registration runs after the load-time validation.
Every text input, date-time input, slider, select, checkbox and file picker has a label or an a11y.name; a button without a label, every custom node and every table has an a11y.name; every dialog and drawer has a title or an a11y.name. An icon never counts, and neither does a label or name written as the constant "" or null. A form field takes its field's label, so a form is not checked. The view and every component's fallback are walked; the client does not run these rules.
| document | The loaded document. |
Definition at line 4480 of file author.hpp.
|
nodiscard |
A screen with its id as a template argument, as spec 5 §11 writes it.
| Id | The document id. |
| builder | The builder. |
Definition at line 4556 of file author.hpp.
|
inlinenodiscard |
A screen.
| screenId | The document id. |
| builder | The builder. |
Definition at line 4564 of file author.hpp.
|
inlinenodiscardnoexcept |
The process's screen registry, which MORPH_REGISTER_SCREEN enrols into.
Definition at line 4680 of file author.hpp.
|
noexcept |
Enrols a screen into the process's registry; what MORPH_REGISTER_SCREEN runs.
| Make | A callable that returns the Screen. |
| make | Makes the screen, inside the registration. |
Definition at line 4690 of file author.hpp.
|
inlineconstexpr |
The dialog or drawer a command list runs in.
Definition at line 1295 of file author.hpp.