plain.htmx 0.11.1__tar.gz → 0.12.0__tar.gz

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.
Files changed (57) hide show
  1. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/PKG-INFO +1 -1
  2. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/CHANGELOG.md +10 -0
  3. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/templates.py +2 -1
  4. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/views.py +11 -8
  5. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/pyproject.toml +1 -1
  6. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/.gitignore +0 -0
  7. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/LICENSE +0 -0
  8. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/README.md +0 -0
  9. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/deps.yml +0 -0
  10. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/package-lock.json +0 -0
  11. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/package.json +0 -0
  12. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/README.md +0 -0
  13. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/__init__.py +0 -0
  14. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/plainhtmx.js +0 -0
  15. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/idiomorph/idiomorph-ext.js +0 -0
  16. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/idiomorph/idiomorph-ext.min.js +0 -0
  17. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/idiomorph/idiomorph-htmx.js +0 -0
  18. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/idiomorph/idiomorph.amd.js +0 -0
  19. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/idiomorph/idiomorph.cjs.js +0 -0
  20. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/idiomorph/idiomorph.esm.js +0 -0
  21. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/idiomorph/idiomorph.js +0 -0
  22. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/idiomorph/idiomorph.min.js +0 -0
  23. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/README.md +0 -0
  24. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/ajax-header.js +0 -0
  25. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/alpine-morph.js +0 -0
  26. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/class-tools.js +0 -0
  27. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/client-side-templates.js +0 -0
  28. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/debug.js +0 -0
  29. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/disable-element.js +0 -0
  30. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/event-header.js +0 -0
  31. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/head-support.js +0 -0
  32. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/include-vals.js +0 -0
  33. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/json-enc.js +0 -0
  34. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/loading-states.js +0 -0
  35. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/method-override.js +0 -0
  36. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/morphdom-swap.js +0 -0
  37. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/multi-swap.js +0 -0
  38. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/path-deps.js +0 -0
  39. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/path-params.js +0 -0
  40. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/preload.js +0 -0
  41. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/rails-method.js +0 -0
  42. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/remove-me.js +0 -0
  43. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/response-targets.js +0 -0
  44. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/restored.js +0 -0
  45. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/sse.js +0 -0
  46. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/ext/ws.js +0 -0
  47. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/htmx.amd.js +0 -0
  48. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/htmx.cjs.js +0 -0
  49. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/htmx.esm.d.ts +0 -0
  50. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/htmx.esm.js +0 -0
  51. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/htmx.js +0 -0
  52. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/htmx.min.js +0 -0
  53. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/assets/htmx/vendor/src/htmx.min.js.gz +0 -0
  54. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/plain/htmx/templates/htmx/js.html +0 -0
  55. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/tests/app/settings.py +0 -0
  56. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/tests/app/urls.py +0 -0
  57. {plain_htmx-0.11.1 → plain_htmx-0.12.0}/tests/test_views.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.htmx
3
- Version: 0.11.1
3
+ Version: 0.12.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,5 +1,15 @@
1
1
  # plain-htmx changelog
2
2
 
3
+ ## [0.12.0](https://github.com/dropseed/plain/releases/plain-htmx@0.12.0) (2025-11-12)
4
+
5
+ ### What's changed
6
+
7
+ - Improved type checking compatibility by adding type ignore comments for mixin methods and ensuring proper None handling ([f4dbcef](https://github.com/dropseed/plain/commit/f4dbcef))
8
+
9
+ ### Upgrade instructions
10
+
11
+ - No changes required
12
+
3
13
  ## [0.11.1](https://github.com/dropseed/plain/releases/plain-htmx@0.11.1) (2025-10-31)
4
14
 
5
15
  ### What's changed
@@ -21,10 +21,11 @@ class HTMXJSExtension(InclusionTagExtension):
21
21
  def get_context(
22
22
  self, context: dict[str, Any], *args: Any, **kwargs: Any
23
23
  ) -> dict[str, Any]:
24
+ request = context.get("request")
24
25
  return {
25
26
  "DEBUG": settings.DEBUG,
26
27
  "extensions": kwargs.get("extensions", []),
27
- "csp_nonce": context.get("request").csp_nonce,
28
+ "csp_nonce": request.csp_nonce if request else None, # type: ignore[attr-defined]
28
29
  }
29
30
 
30
31
 
@@ -10,9 +10,12 @@ from .templates import render_template_fragment
10
10
 
11
11
 
12
12
  class HTMXViewMixin:
13
+ """Mixin for View classes to add HTMX-specific functionality."""
14
+
13
15
  def render_template(self) -> str:
14
- template = self.get_template()
15
- context = self.get_template_context()
16
+ # These methods are provided by the View base class
17
+ template = self.get_template() # type: ignore[attr-defined]
18
+ context = self.get_template_context() # type: ignore[attr-defined]
16
19
 
17
20
  if self.is_htmx_request() and self.get_htmx_fragment_name():
18
21
  return render_template_fragment(
@@ -24,7 +27,7 @@ class HTMXViewMixin:
24
27
  return template.render(context)
25
28
 
26
29
  def get_response(self) -> Response:
27
- response = super().get_response()
30
+ response = super().get_response() # type: ignore[misc]
28
31
  # Tell browser caching to also consider the fragment header,
29
32
  # not just the url/cookie.
30
33
  patch_vary_headers(
@@ -36,7 +39,7 @@ class HTMXViewMixin:
36
39
  if self.is_htmx_request():
37
40
  # You can use an htmx_{method} method on views
38
41
  # (or htmx_{method}_{action} for specific actions)
39
- method = f"htmx_{self.request.method.lower()}"
42
+ method = f"htmx_{self.request.method.lower()}" # type: ignore[attr-defined]
40
43
 
41
44
  if action := self.get_htmx_action_name():
42
45
  # If an action is specified, we throw an error if
@@ -49,14 +52,14 @@ class HTMXViewMixin:
49
52
  # to a regular post method if it's not found
50
53
  return handler
51
54
 
52
- return super().get_request_handler()
55
+ return super().get_request_handler() # type: ignore[misc]
53
56
 
54
57
  def is_htmx_request(self) -> bool:
55
- return self.request.headers.get("HX-Request") == "true"
58
+ return self.request.headers.get("HX-Request") == "true" # type: ignore[attr-defined]
56
59
 
57
60
  def get_htmx_fragment_name(self) -> str:
58
61
  # A custom header that we pass with the {% htmxfragment %} tag
59
- return self.request.headers.get("Plain-HX-Fragment", "")
62
+ return self.request.headers.get("Plain-HX-Fragment", "") # type: ignore[attr-defined]
60
63
 
61
64
  def get_htmx_action_name(self) -> str:
62
- return self.request.headers.get("Plain-HX-Action", "")
65
+ return self.request.headers.get("Plain-HX-Action", "") # type: ignore[attr-defined]
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "plain.htmx"
3
- version = "0.11.1"
3
+ version = "0.12.0"
4
4
  description = "Integrate HTMX with templates and views."
5
5
  authors = [{name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev"}]
6
6
  license = "BSD-3-Clause"
File without changes
File without changes
File without changes
File without changes
File without changes