plain.htmx 0.11.1__tar.gz → 0.13.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.13.0}/PKG-INFO +1 -1
  2. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/CHANGELOG.md +21 -0
  3. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/templates.py +2 -1
  4. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/views.py +8 -5
  5. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/pyproject.toml +1 -1
  6. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/tests/test_views.py +2 -3
  7. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/.gitignore +0 -0
  8. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/LICENSE +0 -0
  9. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/README.md +0 -0
  10. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/deps.yml +0 -0
  11. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/package-lock.json +0 -0
  12. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/package.json +0 -0
  13. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/README.md +0 -0
  14. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/__init__.py +0 -0
  15. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/plainhtmx.js +0 -0
  16. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/idiomorph/idiomorph-ext.js +0 -0
  17. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/idiomorph/idiomorph-ext.min.js +0 -0
  18. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/idiomorph/idiomorph-htmx.js +0 -0
  19. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/idiomorph/idiomorph.amd.js +0 -0
  20. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/idiomorph/idiomorph.cjs.js +0 -0
  21. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/idiomorph/idiomorph.esm.js +0 -0
  22. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/idiomorph/idiomorph.js +0 -0
  23. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/idiomorph/idiomorph.min.js +0 -0
  24. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/README.md +0 -0
  25. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/ajax-header.js +0 -0
  26. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/alpine-morph.js +0 -0
  27. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/class-tools.js +0 -0
  28. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/client-side-templates.js +0 -0
  29. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/debug.js +0 -0
  30. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/disable-element.js +0 -0
  31. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/event-header.js +0 -0
  32. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/head-support.js +0 -0
  33. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/include-vals.js +0 -0
  34. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/json-enc.js +0 -0
  35. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/loading-states.js +0 -0
  36. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/method-override.js +0 -0
  37. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/morphdom-swap.js +0 -0
  38. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/multi-swap.js +0 -0
  39. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/path-deps.js +0 -0
  40. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/path-params.js +0 -0
  41. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/preload.js +0 -0
  42. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/rails-method.js +0 -0
  43. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/remove-me.js +0 -0
  44. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/response-targets.js +0 -0
  45. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/restored.js +0 -0
  46. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/sse.js +0 -0
  47. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/ext/ws.js +0 -0
  48. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/htmx.amd.js +0 -0
  49. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/htmx.cjs.js +0 -0
  50. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/htmx.esm.d.ts +0 -0
  51. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/htmx.esm.js +0 -0
  52. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/htmx.js +0 -0
  53. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/htmx.min.js +0 -0
  54. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/assets/htmx/vendor/src/htmx.min.js.gz +0 -0
  55. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/plain/htmx/templates/htmx/js.html +0 -0
  56. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/tests/app/settings.py +0 -0
  57. {plain_htmx-0.11.1 → plain_htmx-0.13.0}/tests/app/urls.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.13.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,26 @@
1
1
  # plain-htmx changelog
2
2
 
3
+ ## [0.13.0](https://github.com/dropseed/plain/releases/plain-htmx@0.13.0) (2025-11-24)
4
+
5
+ ### What's changed
6
+
7
+ - Replaced `HTMXViewMixin` with `HTMXView` class that inherits from `TemplateView` for better type checking support ([569afd6](https://github.com/dropseed/plain/commit/569afd6))
8
+
9
+ ### Upgrade instructions
10
+
11
+ - Replace `class MyView(HTMXViewMixin, TemplateView)` with `class MyView(HTMXView)` - the new `HTMXView` class already inherits from `TemplateView`
12
+ - Update imports from `from plain.htmx.views import HTMXViewMixin` to `from plain.htmx.views import HTMXView`
13
+
14
+ ## [0.12.0](https://github.com/dropseed/plain/releases/plain-htmx@0.12.0) (2025-11-12)
15
+
16
+ ### What's changed
17
+
18
+ - 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))
19
+
20
+ ### Upgrade instructions
21
+
22
+ - No changes required
23
+
3
24
  ## [0.11.1](https://github.com/dropseed/plain/releases/plain-htmx@0.11.1) (2025-10-31)
4
25
 
5
26
  ### 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
 
@@ -3,13 +3,16 @@ from __future__ import annotations
3
3
  from collections.abc import Callable
4
4
  from typing import Any
5
5
 
6
- from plain.http import Response
6
+ from plain.http import ResponseBase
7
7
  from plain.utils.cache import patch_vary_headers
8
+ from plain.views import TemplateView
8
9
 
9
10
  from .templates import render_template_fragment
10
11
 
11
12
 
12
- class HTMXViewMixin:
13
+ class HTMXView(TemplateView):
14
+ """View with HTMX-specific functionality."""
15
+
13
16
  def render_template(self) -> str:
14
17
  template = self.get_template()
15
18
  context = self.get_template_context()
@@ -23,7 +26,7 @@ class HTMXViewMixin:
23
26
 
24
27
  return template.render(context)
25
28
 
26
- def get_response(self) -> Response:
29
+ def get_response(self) -> ResponseBase:
27
30
  response = super().get_response()
28
31
  # Tell browser caching to also consider the fragment header,
29
32
  # not just the url/cookie.
@@ -32,8 +35,8 @@ class HTMXViewMixin:
32
35
  )
33
36
  return response
34
37
 
35
- def get_request_handler(self) -> Callable[..., Any]:
36
- if self.is_htmx_request():
38
+ def get_request_handler(self) -> Callable[[], Any] | None:
39
+ if self.is_htmx_request() and self.request.method:
37
40
  # You can use an htmx_{method} method on views
38
41
  # (or htmx_{method}_{action} for specific actions)
39
42
  method = f"htmx_{self.request.method.lower()}"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "plain.htmx"
3
- version = "0.11.1"
3
+ version = "0.13.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"
@@ -1,10 +1,9 @@
1
- from plain.htmx.views import HTMXViewMixin
1
+ from plain.htmx.views import HTMXView
2
2
  from plain.http import Response
3
3
  from plain.test import RequestFactory
4
- from plain.views import View
5
4
 
6
5
 
7
- class V(HTMXViewMixin, View):
6
+ class V(HTMXView):
8
7
  def get(self):
9
8
  return Response("Ok")
10
9
 
File without changes
File without changes
File without changes
File without changes
File without changes