djhtmx 1.2.6__tar.gz → 1.2.7__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 (39) hide show
  1. {djhtmx-1.2.6 → djhtmx-1.2.7}/CHANGELOG.md +5 -0
  2. {djhtmx-1.2.6 → djhtmx-1.2.7}/PKG-INFO +1 -1
  3. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/__init__.py +1 -1
  4. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/templatetags/htmx.py +7 -3
  5. {djhtmx-1.2.6 → djhtmx-1.2.7}/.gitignore +0 -0
  6. {djhtmx-1.2.6 → djhtmx-1.2.7}/LICENSE +0 -0
  7. {djhtmx-1.2.6 → djhtmx-1.2.7}/MANIFEST.in +0 -0
  8. {djhtmx-1.2.6 → djhtmx-1.2.7}/README.md +0 -0
  9. {djhtmx-1.2.6 → djhtmx-1.2.7}/pyproject.toml +0 -0
  10. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/apps.py +0 -0
  11. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/command_queue.py +0 -0
  12. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/commands.py +0 -0
  13. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/component.py +0 -0
  14. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/consumer.py +0 -0
  15. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/context.py +0 -0
  16. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/exceptions.py +0 -0
  17. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/global_events.py +0 -0
  18. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/introspection.py +0 -0
  19. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/json.py +0 -0
  20. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/management/commands/htmx.py +0 -0
  21. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/middleware.py +0 -0
  22. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/query.py +0 -0
  23. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/repo.py +0 -0
  24. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/settings.py +0 -0
  25. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/static/htmx/2.0.4/ext/ws.js +0 -0
  26. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/static/htmx/2.0.4/htmx.amd.js +0 -0
  27. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/static/htmx/2.0.4/htmx.cjs.js +0 -0
  28. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/static/htmx/2.0.4/htmx.esm.d.ts +0 -0
  29. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/static/htmx/2.0.4/htmx.esm.js +0 -0
  30. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/static/htmx/2.0.4/htmx.js +0 -0
  31. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/static/htmx/2.0.4/htmx.min.js +0 -0
  32. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/static/htmx/django.js +0 -0
  33. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/templates/htmx/headers.html +0 -0
  34. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/templates/htmx/lazy.html +0 -0
  35. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/templatetags/__init__.py +0 -0
  36. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/testing.py +0 -0
  37. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/tracing.py +0 -0
  38. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/urls.py +0 -0
  39. {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/utils.py +0 -0
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.7] - 2026-01-05
11
+
12
+ ### Changed
13
+ - The `htmx` template tag now accepts component types directly as the first parameter, automatically extracting the component name. You can now use `{% htmx MyComponent data=value %}` instead of `{% htmx 'MyComponent' data=value %}`
14
+
10
15
  ## [1.2.6] - 2025-12-24
11
16
 
12
17
  ### Changed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: djhtmx
3
- Version: 1.2.6
3
+ Version: 1.2.7
4
4
  Summary: Interactive UI Components for Django using HTMX
5
5
  Project-URL: Homepage, https://github.com/edelvalle/djhtmx
6
6
  Project-URL: Documentation, https://github.com/edelvalle/djhtmx#readme
@@ -1,4 +1,4 @@
1
1
  from .middleware import middleware
2
2
 
3
- __version__ = "1.2.6"
3
+ __version__ = "1.2.7"
4
4
  __all__ = ("middleware",)
@@ -73,7 +73,7 @@ def add_delay_jitter(event, arg=None):
73
73
  @register.simple_tag(takes_context=True)
74
74
  def htmx(
75
75
  context,
76
- _name: str,
76
+ _name: str | type[HtmxComponent],
77
77
  _state: dict[str, Any] | None = None,
78
78
  *,
79
79
  lazy: Literal["once"] | bool = False,
@@ -81,12 +81,16 @@ def htmx(
81
81
  ):
82
82
  """Inserts an HTMX Component.
83
83
 
84
- Pass the component name and the initial state:
84
+ Pass the component name (as a string) or component type, and the initial state:
85
85
 
86
86
  ```html
87
87
  {% htmx 'AmazinData' data=some_data %}
88
+ {% htmx MyComponent data=some_data %}
88
89
  ```
89
90
  """
91
+ # Extract component name if a type is passed
92
+ component_name = _name.__name__ if isinstance(_name, type) else _name
93
+
90
94
  state = (_state or {}) | state
91
95
  repo: Repository = context["htmx_repo"]
92
96
  state |= {"lazy": lazy is True}
@@ -94,7 +98,7 @@ def htmx(
94
98
  # Extract parent component ID from context if available
95
99
  parent_id = getattr(context.get("this"), "id", None)
96
100
 
97
- component = repo.build(_name, state, parent_id=parent_id)
101
+ component = repo.build(component_name, state, parent_id=parent_id)
98
102
  return repo.render_html(
99
103
  component,
100
104
  lazy=lazy if isinstance(lazy, bool) else False,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes