Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dea2323499 | |||
| fcaaa693bc | |||
| 8fd6af8c26 | |||
| 69a4034661 | |||
| 5aa9408e60 | |||
| 98f53a5e53 |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
dotnet-version: [ "6.0", "7.0" ]
|
dotnet-version: [ "6.0", "7.0", "8.0" ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
**htmx version: 1.9.2**
|
**htmx version: 1.9.8**
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
|
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
|
||||||
<VersionPrefix>1.9.2</VersionPrefix>
|
<VersionPrefix>1.9.8</VersionPrefix>
|
||||||
<PackageReleaseNotes>Update script tags to pull htmx 1.9.2</PackageReleaseNotes>
|
<PackageReleaseNotes>Update script tags to pull htmx 1.9.8; add support for .NET 8</PackageReleaseNotes>
|
||||||
<Authors>danieljsummers</Authors>
|
<Authors>danieljsummers</Authors>
|
||||||
<Company>Bit Badger Solutions</Company>
|
<Company>Bit Badger Solutions</Company>
|
||||||
<PackageProjectUrl>https://github.com/bit-badger/Giraffe.Htmx</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/bit-badger/Giraffe.Htmx</PackageProjectUrl>
|
||||||
|
|||||||
@@ -94,6 +94,10 @@ module Handlers =
|
|||||||
let withHxNoReplaceUrl : HttpHandler =
|
let withHxNoReplaceUrl : HttpHandler =
|
||||||
toLowerBool false |> withHxReplaceUrl
|
toLowerBool false |> withHxReplaceUrl
|
||||||
|
|
||||||
|
/// Override which portion of the response will be swapped into the target document
|
||||||
|
let withHxReselect : string -> HttpHandler =
|
||||||
|
setHttpHeader "HX-Reselect"
|
||||||
|
|
||||||
/// Override the `hx-swap` attribute from the initiating element
|
/// Override the `hx-swap` attribute from the initiating element
|
||||||
let withHxReswap : string -> HttpHandler =
|
let withHxReswap : string -> HttpHandler =
|
||||||
setHttpHeader "HX-Reswap"
|
setHttpHeader "HX-Reswap"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
This package enables server-side support for [htmx](https://htmx.org) within [Giraffe](https://giraffe.wiki) and ASP.NET's `HttpContext`.
|
This package enables server-side support for [htmx](https://htmx.org) within [Giraffe](https://giraffe.wiki) and ASP.NET's `HttpContext`.
|
||||||
|
|
||||||
**htmx version: 1.9.2**
|
**htmx version: 1.9.8**
|
||||||
|
|
||||||
### Setup
|
### Setup
|
||||||
|
|
||||||
|
|||||||
@@ -265,6 +265,14 @@ let handlers =
|
|||||||
Expect.isTrue (dic.ContainsKey "HX-Replace-Url") "The HX-Replace-Url header should be present"
|
Expect.isTrue (dic.ContainsKey "HX-Replace-Url") "The HX-Replace-Url header should be present"
|
||||||
Expect.equal dic["HX-Replace-Url"].[0] "false" "The HX-Replace-Url value was incorrect"
|
Expect.equal dic["HX-Replace-Url"].[0] "false" "The HX-Replace-Url value was incorrect"
|
||||||
}
|
}
|
||||||
|
testTask "withHxReselect succeeds" {
|
||||||
|
let ctx = Substitute.For<HttpContext> ()
|
||||||
|
let dic = HeaderDictionary ()
|
||||||
|
ctx.Response.Headers.ReturnsForAnyArgs dic |> ignore
|
||||||
|
let! _ = withHxReselect "#test" next ctx
|
||||||
|
Expect.isTrue (dic.ContainsKey "HX-Reselect") "The HX-Reselect header should be present"
|
||||||
|
Expect.equal dic["HX-Reselect"].[0] "#test" "The HX-Reselect value was incorrect"
|
||||||
|
}
|
||||||
testTask "withHxReswap succeeds" {
|
testTask "withHxReswap succeeds" {
|
||||||
let ctx = Substitute.For<HttpContext> ()
|
let ctx = Substitute.For<HttpContext> ()
|
||||||
let dic = HeaderDictionary ()
|
let dic = HeaderDictionary ()
|
||||||
|
|||||||
@@ -313,6 +313,9 @@ let attributes =
|
|||||||
test "_hxDisable succeeds" {
|
test "_hxDisable succeeds" {
|
||||||
p [ _hxDisable ] [] |> shouldRender """<p hx-disable></p>"""
|
p [ _hxDisable ] [] |> shouldRender """<p hx-disable></p>"""
|
||||||
}
|
}
|
||||||
|
test "_hxDisabledElt succeeds" {
|
||||||
|
button [ _hxDiabledElt "this" ] [] |> shouldRender """<button hx-disabled-elt="this"></button>"""
|
||||||
|
}
|
||||||
test "_hxDisinherit succeeds" {
|
test "_hxDisinherit succeeds" {
|
||||||
strong [ _hxDisinherit "*" ] [] |> shouldRender """<strong hx-disinherit="*"></strong>"""
|
strong [ _hxDisinherit "*" ] [] |> shouldRender """<strong hx-disinherit="*"></strong>"""
|
||||||
}
|
}
|
||||||
@@ -422,14 +425,14 @@ let script =
|
|||||||
let html = RenderView.AsString.htmlNode Script.minified
|
let html = RenderView.AsString.htmlNode Script.minified
|
||||||
Expect.equal
|
Expect.equal
|
||||||
html
|
html
|
||||||
"""<script src="https://unpkg.com/htmx.org@1.9.2" integrity="sha384-L6OqL9pRWyyFU3+/bjdSri+iIphTN/bvYyM37tICVyOJkWZLpP2vGn6VUEXgzg6h" crossorigin="anonymous"></script>"""
|
"""<script src="https://unpkg.com/htmx.org@1.9.8" integrity="sha384-rgjA7mptc2ETQqXoYC3/zJvkU7K/aP44Y+z7xQuJiVnB/422P/Ak+F/AqFR7E4Wr" crossorigin="anonymous"></script>"""
|
||||||
"Minified script tag is incorrect"
|
"Minified script tag is incorrect"
|
||||||
}
|
}
|
||||||
test "unminified succeeds" {
|
test "unminified succeeds" {
|
||||||
let html = RenderView.AsString.htmlNode Script.unminified
|
let html = RenderView.AsString.htmlNode Script.unminified
|
||||||
Expect.equal
|
Expect.equal
|
||||||
html
|
html
|
||||||
"""<script src="https://unpkg.com/htmx.org@1.9.2/dist/htmx.js" integrity="sha384-8ADa8Z9mz9MtKHmL1vCmqgEM5Q7eIiradzjEpmeELJ4kex3ibvmnctBNHlpLr/Zl" crossorigin="anonymous"></script>"""
|
"""<script src="https://unpkg.com/htmx.org@1.9.8/dist/htmx.js" integrity="sha384-zOAIsdGekNHQVAjCjVrQ1xHoxyvnxgr63EH6IyXsCfvKZdRFRyG1u8GbWxO5oZ38" crossorigin="anonymous"></script>"""
|
||||||
"Unminified script tag is incorrect"
|
"Unminified script tag is incorrect"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -193,6 +193,9 @@ module HtmxAttrs =
|
|||||||
/// Disables htmx processing for the given node and any children nodes
|
/// Disables htmx processing for the given node and any children nodes
|
||||||
let _hxDisable = flag "hx-disable"
|
let _hxDisable = flag "hx-disable"
|
||||||
|
|
||||||
|
/// Specifies elements that should be disabled when an htmx request is in flight
|
||||||
|
let _hxDiabledElt = attr "hx-disabled-elt"
|
||||||
|
|
||||||
/// Disinherit all ("*") or specific htmx attributes
|
/// Disinherit all ("*") or specific htmx attributes
|
||||||
let _hxDisinherit = attr "hx-disinherit"
|
let _hxDisinherit = attr "hx-disinherit"
|
||||||
|
|
||||||
@@ -296,14 +299,14 @@ module Script =
|
|||||||
|
|
||||||
/// Script tag to load the minified version from unpkg.com
|
/// Script tag to load the minified version from unpkg.com
|
||||||
let minified =
|
let minified =
|
||||||
script [ _src "https://unpkg.com/htmx.org@1.9.2"
|
script [ _src "https://unpkg.com/htmx.org@1.9.8"
|
||||||
_integrity "sha384-L6OqL9pRWyyFU3+/bjdSri+iIphTN/bvYyM37tICVyOJkWZLpP2vGn6VUEXgzg6h"
|
_integrity "sha384-rgjA7mptc2ETQqXoYC3/zJvkU7K/aP44Y+z7xQuJiVnB/422P/Ak+F/AqFR7E4Wr"
|
||||||
_crossorigin "anonymous" ] []
|
_crossorigin "anonymous" ] []
|
||||||
|
|
||||||
/// Script tag to load the unminified version from unpkg.com
|
/// Script tag to load the unminified version from unpkg.com
|
||||||
let unminified =
|
let unminified =
|
||||||
script [ _src "https://unpkg.com/htmx.org@1.9.2/dist/htmx.js"
|
script [ _src "https://unpkg.com/htmx.org@1.9.8/dist/htmx.js"
|
||||||
_integrity "sha384-8ADa8Z9mz9MtKHmL1vCmqgEM5Q7eIiradzjEpmeELJ4kex3ibvmnctBNHlpLr/Zl"
|
_integrity "sha384-zOAIsdGekNHQVAjCjVrQ1xHoxyvnxgr63EH6IyXsCfvKZdRFRyG1u8GbWxO5oZ38"
|
||||||
_crossorigin "anonymous" ] []
|
_crossorigin "anonymous" ] []
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
This package enables [htmx](https://htmx.org) support within the [Giraffe](https://giraffe.wiki) view engine.
|
This package enables [htmx](https://htmx.org) support within the [Giraffe](https://giraffe.wiki) view engine.
|
||||||
|
|
||||||
**htmx version: 1.9.2**
|
**htmx version: 1.9.8**
|
||||||
|
|
||||||
### Setup
|
### Setup
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user