orus-io/elm-orus-ui/1.0.1

Formerly cdevienne/elm-orus-ui. Search finds this package by either name.

OUI.Explorer

Explorers

type Explorer themeExt current previous currentMsg previousMsg

explorer type definition

explorer : Explorer () () () () ()

creates an empty Explorer

explorerWithTheme : Theme themeExt -> Explorer themeExt () () () ()

creates an empty Explorer with a customized theme type

Books

type alias Book themeExt model msg =
{ title : String
, init : Shared themeExt -> ( model, Effect SharedMsg msg )
, update :
Shared themeExt -> msg -> model -> ( model, Effect SharedMsg msg )
, subscriptions : Shared themeExt -> model -> Sub msg
, chapters : List (Shared themeExt -> model -> Element (BookMsg msg))
}

A stateless book

type BookMsg msg

A stateless book message

Book themeExt model msg
-> Explorer themeExt current previous currentMsg previousMsg
themeExt
model
(Model SetupError current previous)
(BookMsg msg)
(Msg Route currentMsg previousMsg)

Add a book to the current category

book : String -> Book themeExt () ()

Creates a new static book

String
-> { init : Shared themeExt -> ( model, Effect SharedMsg msg )
, update :
Shared themeExt -> msg -> model -> ( model, Effect SharedMsg msg )
, subscriptions : Shared themeExt -> model -> Sub msg
}
-> Book themeExt model msg

Creates a new stateful book

bookMsg : msg -> BookMsg msg

wrap a book msg into a BookMsg msg. This is needed in views.

Colorschemes

Color scheme light/dark

setColorTheme : Theme -> Explorer themeExt c p cm pm -> Explorer themeExt c p cm pm

takes a color theme sets it as default

addColorTheme : Theme -> Explorer themeExt c p cm pm -> Explorer themeExt c p cm pm

adds a color theme to the list of selectable color themes

Chapters

withMarkdownChapter : String -> Book themeExt model msg -> Book themeExt model msg

Add a mardown chapter to a book

(Shared themeExt -> Element (BookMsg msg))
-> Book themeExt model msg
-> Book themeExt model msg

Add a static content chapter to a book

(Shared themeExt -> model -> Element (BookMsg msg))
-> Book themeExt model msg
-> Book themeExt model msg

Add a chapter to a book

Other

type alias Page msg =
{ title : String
, content : Element msg
}

A explorer page

type alias Route =
String

The explorer routes are simple strings

type alias Shared themeExt =
{ navKey : Key
, lastEvents : List String
, theme : Theme themeExt
, colorThemeList : List Theme
, selectedColorScheme : ( Int, ColorSchemeType )
, selectedBook : String
, colorThemeButton : State
}

The shared state

Shared state message

Theme themeExt
-> Explorer themeExt c p cm pm
-> Explorer themeExt c p cm pm

sets the theme

String
-> Explorer themeExt current previous currentMsg previousMsg
-> Explorer themeExt current previous currentMsg previousMsg

Add a category to a Explorer

All subsequent books will be added to this category, until a new category is added.

logEvent : String -> BookMsg msg

A simple log event

The passed string will be logged in the log event window

logEffect : String -> Effect SharedMsg msg

A simple log event, as a Effect

The passed string will be logged in the log event window

Same as 'logEvent', but for update/init

Explorer themeExt current previous currentMsg previousMsg
-> Application
Value
(Shared themeExt)
String
current
previous
currentMsg
previousMsg

Finalize a explorer and returns Program