plain.htmx 0.10.4__py3-none-any.whl → 0.11.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
plain/htmx/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # plain-htmx changelog
2
2
 
3
+ ## [0.11.0](https://github.com/dropseed/plain/releases/plain-htmx@0.11.0) (2025-10-29)
4
+
5
+ ### What's changed
6
+
7
+ - Added Content Security Policy (CSP) nonce support for inline scripts and styles generated by htmx ([784f3dd](https://github.com/dropseed/plain/commit/784f3dd972))
8
+
9
+ ### Upgrade instructions
10
+
11
+ - No changes required
12
+
3
13
  ## [0.10.4](https://github.com/dropseed/plain/releases/plain-htmx@0.10.4) (2025-10-20)
4
14
 
5
15
  ### What's changed
@@ -1,4 +1,11 @@
1
1
  (() => {
2
+ // Get nonce from our own script tag's data attribute
3
+ const nonce = document.currentScript?.getAttribute("data-csp-nonce");
4
+
5
+ // Configure htmx for CSP compatibility
6
+ htmx.config.inlineScriptNonce = nonce;
7
+ htmx.config.inlineStyleNonce = nonce;
8
+
2
9
  htmx.defineExtension("plain-views", {
3
10
  init() {
4
11
  // Set or append this extension to the body hx-ext automatically
@@ -15,4 +15,4 @@
15
15
  <script src="{{ asset('htmx/vendor/src/ext/' ~ extension ~ '.js') }}" defer></script>
16
16
  {%- endfor -%}
17
17
 
18
- <script src="{{ asset('htmx/plainhtmx.js') }}" defer></script>
18
+ <script src="{{ asset('htmx/plainhtmx.js') }}" defer data-csp-nonce="{{ csp_nonce }}"></script>
plain/htmx/templates.py CHANGED
@@ -24,6 +24,7 @@ class HTMXJSExtension(InclusionTagExtension):
24
24
  return {
25
25
  "DEBUG": settings.DEBUG,
26
26
  "extensions": kwargs.get("extensions", []),
27
+ "csp_nonce": context.get("request").csp_nonce,
27
28
  }
28
29
 
29
30
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.htmx
3
- Version: 0.10.4
3
+ Version: 0.11.0
4
4
  Summary: Integrate HTMX with templates and views.
5
5
  Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
6
  License-Expression: BSD-3-Clause
@@ -1,9 +1,9 @@
1
- plain/htmx/CHANGELOG.md,sha256=dXcu6vdahPLhQZCD5NUC3pRhg5g3WnO_Qczw1nf0JYc,2507
1
+ plain/htmx/CHANGELOG.md,sha256=RVR38ExgmwEVq8GqsZzggsTIN0zd4O095obt0g3z_so,2830
2
2
  plain/htmx/README.md,sha256=C9H_66JD9tykCiTbKjZFAzX7MkVrym58wsEaA1wjxqY,12690
3
3
  plain/htmx/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- plain/htmx/templates.py,sha256=Ipki_eWMCVufFuishbf5rVnLQOU9skIh7FeWSvKiBpY,6536
4
+ plain/htmx/templates.py,sha256=NUAubXV_FR3RDTbokof4TEwZocDStR6hk-YJR3HFAhI,6595
5
5
  plain/htmx/views.py,sha256=YN-I8yvfNhTlt4lLvKTJtaVDB8CmcMPBTHtxf-8MR7Y,2237
6
- plain/htmx/assets/htmx/plainhtmx.js,sha256=FzKKB26QZ6EN3y0Rz5lRthSRuX8-iKtYsIi6yJxuHmI,1761
6
+ plain/htmx/assets/htmx/plainhtmx.js,sha256=rFFS_ogFTAeON7EX6HRwbyKH3voM5MVcPFfQzSX77cY,2014
7
7
  plain/htmx/assets/htmx/vendor/idiomorph/idiomorph-ext.js,sha256=UvnPpQ3Jg380QwIF5PzlxmUQJuoMt6BxsmS_PMd2ayM,48004
8
8
  plain/htmx/assets/htmx/vendor/idiomorph/idiomorph-ext.min.js,sha256=Ax3YbD9-2A-Ha_81wI5E4NLHHOjAvNJw4GvDocg2i-s,10313
9
9
  plain/htmx/assets/htmx/vendor/idiomorph/idiomorph-htmx.js,sha256=ASBB00mwLYQY25neGwIQHU1A-NNdHpXp28ACHPIvoxE,813
@@ -43,8 +43,8 @@ plain/htmx/assets/htmx/vendor/src/ext/response-targets.js,sha256=TYKCHq9lyFGnL6u
43
43
  plain/htmx/assets/htmx/vendor/src/ext/restored.js,sha256=0td3Ga2ZIcVdFKJm6FoCXTm245EVOqQtfJ9Y5ry2Agw,874
44
44
  plain/htmx/assets/htmx/vendor/src/ext/sse.js,sha256=ju2N9N81ASa-ncT6JJbm65iQ4y9iAqKXRuPDwOcATBM,10320
45
45
  plain/htmx/assets/htmx/vendor/src/ext/ws.js,sha256=KMVp1yOrFb6ncZUprsnN3OPRpmV9GG0YBuLSW1wekMc,13899
46
- plain/htmx/templates/htmx/js.html,sha256=ushWY8JEQua_6gfCBZZovjWr-3E7__XMDGF9c4VcLko,682
47
- plain_htmx-0.10.4.dist-info/METADATA,sha256=TCkhV7WtGkAVi4Oug7vYfnRzVGCDPhwbrLsk0OqkZY0,12999
48
- plain_htmx-0.10.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
49
- plain_htmx-0.10.4.dist-info/licenses/LICENSE,sha256=cvKM3OlqHx3ijD6e34zsSUkPvzl-ya3Dd63A6EHL94U,1500
50
- plain_htmx-0.10.4.dist-info/RECORD,,
46
+ plain/htmx/templates/htmx/js.html,sha256=ZHD4IjufD4tTUZB_TEDCACgZwXBzYDHJa7PmfQcJeOg,715
47
+ plain_htmx-0.11.0.dist-info/METADATA,sha256=-yzxTILvGDFDNq2Y73ETcpU6QRvBF6depPovxaHRxdQ,12999
48
+ plain_htmx-0.11.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
49
+ plain_htmx-0.11.0.dist-info/licenses/LICENSE,sha256=cvKM3OlqHx3ijD6e34zsSUkPvzl-ya3Dd63A6EHL94U,1500
50
+ plain_htmx-0.11.0.dist-info/RECORD,,