| Copyright | (c) Leon Vatthauer 2026 |
|---|---|
| License | GPL-3 |
| Maintainer | Leon Vatthauer <leon.vatthauer@fau.de> |
| Stability | experimental |
| Portability | non-portable (ghc-wasm-meta) |
| Safe Haskell | None |
| Language | GHC2024 |
App.Views
Description
This module defines the Miso Views of the application.
Synopsis
- viewModel :: Model -> View Model Action
- viewHeader :: Model -> View Model Action
- viewLogoHeader :: Model -> View Model Action
- viewHeaderRight :: Model -> View Model Action
- viewErrorNumber :: Model -> View Model Action
- viewNavigationButtons :: View Model Action
- viewProofActionsHeader :: View Model Action
- viewBin :: View Model Action
- viewSpawnNode :: SpawnType -> MisoString -> MisoString -> View Model Action
- viewMenuButton :: View Model Action
- viewNewProofButton :: Model -> View Model Action
- viewSidebar :: Model -> View Model Action
- viewDetails :: MisoString -> MisoString -> View Model Action -> View Model Action
- viewUsage :: View Model Action
- viewGrammar :: Model -> View Model Action
- viewRules :: Model -> View Model Action
- viewExamples :: Model -> View Model Action
- viewLogics :: Model -> View Model Action
- viewSource :: Model -> View Model Action
- viewProof :: Model -> View Model Action
- viewLineNos :: Model -> View Model Action
- viewRuleApplications :: Model -> View Model Action
- viewErrorBox :: MisoString -> MisoString -> View Model Action
- mkFormulaInputId :: NodeAddr -> Proof -> MisoString
- mkRuleInputId :: NodeAddr -> Proof -> MisoString
- viewLine :: Model -> NodeAddr -> Either Assumption Derivation -> View Model Action
- viewMaterialIcon :: MisoString -> View Model Action
- viewDropZoneAt :: Model -> Maybe MisoString -> NodeAddr -> View Model Action
- interleaveWithDropZones :: Model -> Maybe MisoString -> Maybe NodeAddr -> (Int -> NodeAddr) -> [View Model Action] -> [View Model Action]
Views
Header
viewLogoHeader :: Model -> View Model Action Source #
Shows the logo in the viewHeader, together with a title and navigation buttons
viewNavigationButtons :: View Model Action Source #
Adds navigation buttons for accessing the browsers history API.
viewProofActionsHeader :: View Model Action Source #
For use in viewHeader,
returns buttons for spawning Assumption, Derivation, Proof or a trash can.
viewBin :: View Model Action Source #
For use in viewProofActionsHeader,
returns a trash can, where elements can be deleted.
Arguments
| :: SpawnType | Type of node to be spawned |
| -> MisoString | Tooltip of the button |
| -> MisoString | The buttons icon. |
| -> View Model Action |
For use in viewProofActionsHeader,
returns a button for spawning a Assumption, Derivation or Proof.
viewMenuButton :: View Model Action Source #
For use in viewHeader
returns a button that opens and closes the sidebar.
viewNewProofButton :: Model -> View Model Action Source #
For use in viewHeader,
returns a button for starting a new Proof.
Sidebar
Arguments
| :: MisoString | Text of the details summary. |
| -> MisoString | Icon of the details summary. |
| -> View Model Action | Content of the details element. |
| -> View Model Action |
Wrapper for creating details elements in the sidebar.
viewGrammar :: Model -> View Model Action Source #
For use in viewSidebar,
returns a list of symbols that can be used, and on hover shows their aliases.
viewRules :: Model -> View Model Action Source #
For use in viewSidebar,
returns a list of the logic's rules, on hover shows the rule definition.
viewExamples :: Model -> View Model Action Source #
For use in viewSidebar, returns a list of example Proofs,
on hover shows the Assumptions and conclusion of the Proof.
viewLogics :: Model -> View Model Action Source #
For use in viewSidebar, returns a list of buttons
that enable the user to change the underlying logic of the proof checker.
viewSource :: Model -> View Model Action Source #
For use in viewSidebar, contains a link to the repository
and the documentation.
Proof
viewProof :: Model -> View Model Action Source #
Shows the proof workspace of the application, containing a list of line numbers, a list of formula inputs and a list of rule inputs.
viewRuleApplications :: Model -> View Model Action Source #
For use in viewProof,
returns a list of RuleApplications (judgements),
that are shown to the right of the Proof.
Arguments
| :: MisoString |
|
| -> MisoString | Error message. |
| -> View Model Action |
Returns a errorbox that is shown on hover, containing errors
written in a code element to get monospacing.
mkFormulaInputId :: NodeAddr -> Proof -> MisoString Source #
Helper for turning a NodeAddr to a formula inputfield id.
mkRuleInputId :: NodeAddr -> Proof -> MisoString Source #
Helper for turning a NodeAddr to a rule inputfield id.
Utilities
viewMaterialIcon :: MisoString -> View Model Action Source #
Helper for viewing material icons based on their name, see https://fonts.google.com/icons
Arguments
| :: Model | The |
| -> Maybe MisoString | Optional class for the dropzone. |
| -> NodeAddr | The corresponding |
| -> View Model Action |
Shows a dropzone for the given NodeAddr,
i.e. a small empty div, where nodes can be dropped.
Expands, if a node can be dropped inside.
interleaveWithDropZones Source #
Arguments
| :: Model | The |
| -> Maybe MisoString | Optionally a class for the last dropzone. |
| -> Maybe NodeAddr | Optionally a differing |
| -> (Int -> NodeAddr) | A function for generating |
| -> [View Model Action] | The list of views to be interleaved. |
| -> [View Model Action] |
Interleaves the list views with dropzones of the corresponding NodeAddr.