Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/datastar_py/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class EventType(StrEnum):
NAMESPACE_DATALINE_LITERAL = "namespace"
ELEMENTS_DATALINE_LITERAL = "elements"
USE_VIEW_TRANSITION_DATALINE_LITERAL = "useViewTransition"
VIEW_TRANSITION_SELECTOR_DATALINE_LITERAL = "viewTransitionSelector"
SIGNALS_DATALINE_LITERAL = "signals"
ONLY_IF_MISSING_DATALINE_LITERAL = "onlyIfMissing"
# endregion Dataline literals
Expand Down
7 changes: 7 additions & 0 deletions src/datastar_py/sse.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def patch_elements(
selector: str,
mode: Literal[consts.ElementPatchMode.REMOVE],
use_view_transition: bool | None = None,
view_transition_selector: str | None = None,
namespace: consts.ElementPatchNamespace | None = None,
event_id: str | None = None,
retry_duration: int | None = None,
Expand All @@ -80,6 +81,7 @@ def patch_elements(
selector: str | None = None,
mode: consts.ElementPatchMode | None = None,
use_view_transition: bool | None = None,
view_transition_selector: str | None = None,
namespace: consts.ElementPatchNamespace | None = None,
event_id: str | None = None,
retry_duration: int | None = None,
Expand All @@ -91,6 +93,7 @@ def patch_elements( # noqa: PLR0913 too many arguments
selector: str | None = None,
mode: consts.ElementPatchMode | None = None,
use_view_transition: bool | None = None,
view_transition_selector: str | None = None,
namespace: consts.ElementPatchNamespace | None = None,
event_id: str | None = None,
retry_duration: int | None = None,
Expand All @@ -109,6 +112,10 @@ def patch_elements( # noqa: PLR0913 too many arguments
data_lines.append(
f"{consts.USE_VIEW_TRANSITION_DATALINE_LITERAL} {_js_bool(use_view_transition)}"
)
if view_transition_selector:
data_lines.append(
f"{consts.VIEW_TRANSITION_SELECTOR_DATALINE_LITERAL} {view_transition_selector}"
)
if namespace and namespace != consts.ElementPatchNamespace.HTML:
data_lines.append(f"{consts.NAMESPACE_DATALINE_LITERAL} {namespace}")

Expand Down