@@ -16,6 +16,7 @@ These function take options map whose keys are:
1616- [[selector]]
1717- [[patch-mode]]
1818- [[use-view-transition]]
19+ - [[element-ns]]
1920- [[only-if-missing]]
2021- [[auto-remove]]
2122- [[attributes]]
@@ -54,13 +55,13 @@ Some scripts are provided:
5455; ; -----------------------------------------------------------------------------
5556(def CDN-url
5657 " URL for the Datastar js bundle tracking the latest Datastar, currently
57- v1.0.0-RC6 ."
58+ v1.0.0-RC7 ."
5859
59- " https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.6 /bundles/datastar.js" )
60+ " https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.7 /bundles/datastar.js" )
6061
6162(def CDN-map-url
6263 " URL for the Datastar source map going with [[CDN-url]]."
63- " https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.6 /bundles/datastar.js.map" )
64+ " https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.7 /bundles/datastar.js.map" )
6465
6566; ; -----------------------------------------------------------------------------
6667; ; SSE generator management
@@ -180,6 +181,17 @@ Some scripts are provided:
180181 Datastar client side will default to false."
181182 common /use-view-transition )
182183
184+
185+ (def element-ns
186+ " [[patch-elements!]] & [[patch-elements-seq!]] option, boolean:
187+
188+ Use a namespace when patching elements.
189+ Possible values are:
190+ - [[ns-html]] default
191+ - [[ns-svg]]
192+ - [[ns-mathml]]"
193+ common /element-namespace )
194+
183195; ;Signals opts
184196(def only-if-missing
185197 " [[patch-signals!]] option, boolean:
@@ -240,6 +252,17 @@ Some scripts are provided:
240252 related state."
241253 consts /element-patch-mode-replace )
242254
255+ (def ns-html
256+ " element namespace: default html namespace"
257+ consts /element-namespace-html )
258+
259+ (def ns-svg
260+ " element namespace: svg namespace"
261+ consts /element-namespace-svg )
262+
263+ (def ns-mathml
264+ " element namespace: mathMl namespace"
265+ consts /element-namespace-mathml )
243266
244267(defn patch-elements!
245268 " Send HTML elements to the browser to be patchd into the DOM.
@@ -255,6 +278,7 @@ Some scripts are provided:
255278 - [[selector]]
256279 - [[patch-mode]]
257280 - [[use-view-transition]]
281+ - [[element-ns]]
258282
259283 Return value:
260284 - `false` if the connection is closed
@@ -378,7 +402,7 @@ Some scripts are provided:
378402 (scripts/execute-script! sse-gen script-text opts)))
379403
380404
381-
405+
382406; ; -----------------------------------------------------------------------------
383407; ; SSE helpers
384408; ; -----------------------------------------------------------------------------
@@ -483,4 +507,3 @@ Some scripts are provided:
483507 of the header means the request is issued from a datastar action."
484508 [request]
485509 (= " true" (get-in request [:headers " datastar-request" ])))
486-
0 commit comments