Songhay.Modules.Bolero
6.3.0
See the version list below for details.
dotnet add package Songhay.Modules.Bolero --version 6.3.0
NuGet\Install-Package Songhay.Modules.Bolero -Version 6.3.0
<PackageReference Include="Songhay.Modules.Bolero" Version="6.3.0" />
paket add Songhay.Modules.Bolero --version 6.3.0
#r "nuget: Songhay.Modules.Bolero, 6.3.0"
// Install Songhay.Modules.Bolero as a Cake Addin #addin nuget:?package=Songhay.Modules.Bolero&version=6.3.0 // Install Songhay.Modules.Bolero as a Cake Tool #tool nuget:?package=Songhay.Modules.Bolero&version=6.3.0
Songhay.Modules.Bolero
shared functions and types for Bolero, supporting CSS 💄, specifically Bulma CSS 🍱🖼
NuGet package 📦: Songhay.Modules.Bolero
These are the main concerns of this work:
- Utility, mostly sharing functions for Remoting and
IJSRuntime
- Visuals, a deliberately incomplete coverage of HTML, CSS and Bulma by Jeremy Thomas
- Models (Primitives), F♯ primitive obsession, supporting the Visuals
Utility
There are four utilities:
- a utility for Bolero [src]
- a utility for JSON documents [src]
- a utility for
IJSRuntime
[src] - a utility for
IRemoteService
[src]
Visuals and Models
Here is my first attempt at building a <acronym title="Domain-Specific Language">DSL</acronym> for HTML, CSS and Bulma CSS on top of Bolero. For example, here is an expression [GitHub], rendering Bulma tabs, overriding the Bolero ElmishComponent<_,_>
:
override this.View model dispatch =
concat {
let tabs = [
(text "README", ReadMeTab)
(concat { text "Bolero "; code { text "IJsRuntime" } }, BoleroJsRuntimeTab)
(text "Bulma Visuals", BulmaVisualsTab)
]
bulmaTabs
(HasClasses <| CssClasses [ ColorEmpty.BackgroundCssClassLight; "is-toggle"; "is-fullwidth"; SizeLarge.CssClass ])
(fun pg -> model.tab = pg)
(fun pg _ -> SetTab pg |> dispatch)
tabs
cond model.tab <| function
| ReadMeTab ->
if model.readMeData.IsNone then
text "loading…"
else
bulmaContainer
ContainerWidthFluid
NoCssClasses
(bulmaNotification
(HasClasses <| CssClasses [ ColorPrimary.CssClass ])
(rawHtml model.readMeData.Value))
| BoleroJsRuntimeTab ->
bulmaContainer
ContainerWidthFluid
NoCssClasses
(BoleroJsRuntimeElmishComponent.EComp model dispatch)
| BulmaVisualsTab ->
bulmaContainer
ContainerWidthFluid
NoCssClasses
(BulmaVisualsElmishComponent.EComp model dispatch)
}
Warning
This approach to the <acronym title="Domain-Specific Language">DSL</acronym> is wrapping functions around <acronym title="Computation Expression">CE</acronym>s instead of wrapping <acronym title="Computation Expression">CE</acronym>s with <acronym title="Computation Expression">CE</acronym>s. Research in this direction is underway… on and off…
The preference here (at the moment) is to have more types than functions for the <acronym title="Domain-Specific Language">DSL</acronym>. These types are grouped into four models of primitives:
These models support the functions of the Visuals:
- HTML Body Visuals [src]
- CSS Declarations [src]
- HTML Head Elements [src]
- Bulma Component Visuals [src]
- Bulma CSS Class names [src]
- Bulma Element Visuals [src]
- Bulma Layout Visuals [src]
The coverage of HTML is quite limited because Bulma itself has its own, excellent HTML <acronym title="Domain-Specific Language">DSL</acronym> on which this work depends heavily. The generic <acronym title="Cascading Style Sheets">CSS</acronym> coverage is starting off with typography. The Bulma-specific coverage is the most extensive but lacking in the following areas:
I look forward to working a bit more on this Bulma coverage, likely starting with Bulma pagination.
custom JavaScript is needed for the Bulma Navbar
In order to toggle the Bulma Navbar burger and its dropdown menu, the following JavaScript is needed:
(() => {
window.addEventListener('DOMContentLoaded', () => {
const burger = document.querySelector('.navbar-burger');
const nav = document.querySelector(`#${burger.dataset.target}`);
const isActiveCssClass = 'is-active';
burger.addEventListener('click', () => {
burger.classList.toggle(isActiveCssClass);
nav.classList.toggle(isActiveCssClass);
});
});
})();
This JavaScript is similar to the code provided in the Bulma documentation.
setting up a Typescript pipeline for JavaScript edge cases
The whole point of this work is to avoid using JavaScript. However, this Microsoft-sponsored WebAssembly journey is a work in progress which means some JavaScript is still needed. The Songhay.StudioFloor.Client
in this Solution [GitHub] features a Typescript pipeline that should provide guidelines around how to deal with what is needed from JavaScript.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net6.0
- Bolero (>= 0.22.44)
- FsToolkit.ErrorHandling (>= 4.8.0)
- Songhay.Modules (>= 6.3.7)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Songhay.Modules.Bolero:
Package | Downloads |
---|---|
Songhay.Player.YouTube
Bolero Components, Elmish types and JSON handlers for the b-roll player for YouTube 🎥 content |
|
Songhay.Player.ProgressiveAudio
Bolero Components, Elmish types and JSON handlers for b-roll player for progressive audio 🎤 content |
GitHub repositories
This package is not used by any popular GitHub repositories.