Classes
ChangeEvent
3
▼
Emitted by a store after a data mutation.
ChangeEvent
3
▼
Emitted by a store after a data mutation.
Attributes
| Name | Type | Description |
|---|---|---|
scope |
str
|
Scope identifier (e.g., a document ID) so subscribers only receive events for their scope. |
changed_paths |
frozenset[str]
|
The set of context paths that changed (e.g., |
origin |
str | None
|
Opaque identifier for who caused this change (e.g., user ID, session ID). Used by |
BlockRef
4
▼
Reference to a renderable block within a template.
BlockRef
4
▼
Reference to a renderable block within a template.
Attributes
| Name | Type | Description |
|---|---|---|
template_name |
str
|
Kida template name. |
block_name |
str
|
Block name within the template. |
dom_id |
str | None
|
DOM element ID to target for OOB swap. Defaults to the block name. |
Methods
target_id
0
str
▼
DOM element ID for OOB targeting.
property
target_id
0
str
▼
def target_id(self) -> str
Returns
str
_SSESwapElement
3
▼
Parsed info about an HTML element with ``sse-swap``.
_SSESwapElement
3
▼
Parsed info about an HTML element withsse-swap.
Attributes
| Name | Type | Description |
|---|---|---|
swap_event |
str
|
— |
dom_id |
str | None
|
— |
inner_block |
str | None
|
— |
Functions
_extract_sse_swap_elements
1
list[_SSESwapElement]
▼
Extract elements with ``sse-swap`` and find their associated blocks.
For each …
_extract_sse_swap_elements
1
list[_SSESwapElement]
▼
def _extract_sse_swap_elements(source: str) -> list[_SSESwapElement]
Extract elements withsse-swapand find their associated blocks.
For each<tag ... sse-swap="event" ...>found, captures the swap
event name, elementid, and the associated {% block NAME %}.
Handles two common patterns:
-
Block inside element (block is a child)::
<span id="status" sse-swap="status"> {% block toolbar_status %}v{{ doc.version }}{% endblock %} </span> -
Block wraps element (block is the parent)::
{% block toolbar_status %} <span id="status" sse-swap="status">v{{ doc.version }}</span> {% endblock %}
Parameters
| Name | Type | Description |
|---|---|---|
source |
str |
Returns
list[_SSESwapElement]