v4, alpha 6 (#17)

Reviewed-on: #17
This commit was merged in pull request #17.
This commit is contained in:
2026-01-07 11:37:26 +00:00
parent 121eb95d87
commit de75672bb3
11 changed files with 1144 additions and 569 deletions

View File

@@ -3,7 +3,7 @@
module Giraffe.Htmx.Common
/// <summary>The version of htmx embedded in the package</summary>
let HtmxVersion = "2.0.8"
let HtmxVersion = "4.0.0-alpha6"
/// <summary>The path for the provided htmx script</summary>
let internal htmxLocalScript = $"/_content/Giraffe.Htmx.Common/htmx.min.js?ver={HtmxVersion}"
@@ -25,8 +25,8 @@ let internal toLowerBool (boolValue: bool) =
/// <summary>Valid values for the <c>hx-swap</c> attribute / <c>HX-Reswap</c> header</summary>
/// <remarks>May be combined with <c>swap</c> / <c>settle</c> / <c>scroll</c> / <c>show</c> config)</remarks>
/// <seealso href="https://htmx.org/attributes/hx-swap/">Documentation</seealso>
/// <remarks>May be combined with <c>swap</c> / <c>scroll</c> / <c>show</c> config)</remarks>
/// <seealso href="https://four.htmx.org/attributes/hx-swap/">Documentation</seealso>
[<RequireQualifiedAccess>]
module HxSwap =
@@ -38,22 +38,60 @@ module HxSwap =
[<Literal>]
let OuterHtml = "outerHTML"
/// <summary>Morph the inner HTML of the target to the new content</summary>
[<Literal>]
let InnerMorph = "innerMorph"
/// <summary>Morph the outer HTML of the target to the new content</summary>
[<Literal>]
let OuterMorph = "innerMorph"
/// <summary>Replace the text content of the target without parsing the response as HTML</summary>
[<Literal>]
let TextContent = "textContent"
/// <summary>Insert the response before the target element</summary>
[<Literal>]
let BeforeBegin = "beforebegin"
let Before = "before"
/// <summary>Insert the response before the target element (pre-v4 name)</summary>
[<Literal>]
let BeforeBegin = Before
/// <summary>Insert the response before the first child of the target element</summary>
[<Literal>]
let AfterBegin = "afterbegin"
let Prepend = "prepend"
/// <summary>Insert the response before the first child of the target element (pre-v4 name)</summary>
[<Literal>]
let AfterBegin = Prepend
/// <summary>Insert the response after the last child of the target element</summary>
[<Literal>]
let BeforeEnd = "beforeend"
let Append = "append"
/// <summary>Insert the response after the last child of the target element (pre-v4 name)</summary>
[<Literal>]
let BeforeEnd = Append
/// <summary>Insert the response after the target element</summary>
[<Literal>]
let AfterEnd = "afterend"
let After = "after"
/// <summary>Insert the response after the target element (pre-v4 name)</summary>
[<Literal>]
let AfterEnd = After
/// <summary>Does not append content from response (out of band items will still be processed).</summary>
/// <summary>Delete the target element regardless of response</summary>
[<Literal>]
let Delete = "delete"
/// <summary>Does not append content from response (out of band items will still be processed)</summary>
[<Literal>]
let None = "none"
/// <summary>Update existing elements by <c>id</c> and add new ones</summary>
/// <remarks>This requires the <c>upsert</c> extension</remarks>
/// <seealso href="https://four.htmx.org/extensions/upsert">Extension</seealso>
[<Literal>]
let Upsert = "upsert"

View File

@@ -2,4 +2,6 @@
This package contains common code shared between [`Giraffe.Htmx`](https://www.nuget.org/packages/Giraffe.Htmx) and [`Giraffe.ViewEngine.Htmx`](https://www.nuget.org/packages/Giraffe.ViewEngine.Htmx), and will be automatically installed when you install either one. It also contains htmx as a static web asset, allowing it to be loaded from your local (or published) project.
**htmx version: 2.0.8**
**htmx version: 4.0.0-alpha6**
_**NOTE:** Pay special attention to breaking changes highlighted in the packages listed above._

File diff suppressed because one or more lines are too long