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.
- {djhtmx-1.2.6 → djhtmx-1.2.7}/CHANGELOG.md +5 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/PKG-INFO +1 -1
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/__init__.py +1 -1
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/templatetags/htmx.py +7 -3
- {djhtmx-1.2.6 → djhtmx-1.2.7}/.gitignore +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/LICENSE +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/MANIFEST.in +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/README.md +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/pyproject.toml +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/apps.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/command_queue.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/commands.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/component.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/consumer.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/context.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/exceptions.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/global_events.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/introspection.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/json.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/management/commands/htmx.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/middleware.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/query.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/repo.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/settings.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/static/htmx/2.0.4/ext/ws.js +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/static/htmx/2.0.4/htmx.amd.js +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/static/htmx/2.0.4/htmx.cjs.js +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/static/htmx/2.0.4/htmx.esm.d.ts +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/static/htmx/2.0.4/htmx.esm.js +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/static/htmx/2.0.4/htmx.js +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/static/htmx/2.0.4/htmx.min.js +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/static/htmx/django.js +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/templates/htmx/headers.html +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/templates/htmx/lazy.html +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/templatetags/__init__.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/testing.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/tracing.py +0 -0
- {djhtmx-1.2.6 → djhtmx-1.2.7}/src/djhtmx/urls.py +0 -0
- {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
|
|
@@ -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(
|
|
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
|
|
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
|