Skip to content

Commit

Permalink
Add <twig:Turbo:Stream:*> components
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Oct 2, 2024
1 parent d72aa7e commit 56fea2e
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Turbo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 2.20.0

- Add `<twig:turbo-stream-*>` components

## 2.19.0

- Fix Doctrine proxies are not Broadcasted #3139
Expand Down
5 changes: 5 additions & 0 deletions src/Turbo/templates/components/Stream/After.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% props target -%}

<turbo-stream action="after" targets="{{ target }}" {{ attributes }}>
<template>{% block content %}{% endblock %}</template>
</turbo-stream>
5 changes: 5 additions & 0 deletions src/Turbo/templates/components/Stream/Append.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% props target -%}

<turbo-stream action="append" targets="{{ target }}" {{ attributes }}>
<template>{% block content %}{% endblock %}</template>
</turbo-stream>
5 changes: 5 additions & 0 deletions src/Turbo/templates/components/Stream/Before.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% props target -%}

<turbo-stream action="before" targets="{{ target }}" {{ attributes }}>
<template>{% block content %}{% endblock %}</template>
</turbo-stream>
5 changes: 5 additions & 0 deletions src/Turbo/templates/components/Stream/Prepend.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% props target -%}

<turbo-stream action="prepend" targets="{{ target }}" {{ attributes }}>
<template>{% block content %}{% endblock %}</template>
</turbo-stream>
3 changes: 3 additions & 0 deletions src/Turbo/templates/components/Stream/Refresh.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% props requestId = null -%}

<turbo-stream action="refresh"{% if requestId is not null %} request-id="{{ requestId }}"{% endif %} {{ attributes }}></turbo-stream>
3 changes: 3 additions & 0 deletions src/Turbo/templates/components/Stream/Remove.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% props target -%}

<turbo-stream action="remove" targets="{{ target }}" {{ attributes }}></turbo-stream>
5 changes: 5 additions & 0 deletions src/Turbo/templates/components/Stream/Replace.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% props target, morph = false -%}

<turbo-stream action="replace" targets="{{ target }}"{% if morph %} method="morph"{% endif %} {{ attributes }}>
<template>{% block content %}{% endblock %}</template>
</turbo-stream>
5 changes: 5 additions & 0 deletions src/Turbo/templates/components/Stream/Update.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% props target, morph = false -%}

<turbo-stream action="update" targets="{{ target }}"{% if morph %} method="morph"{% endif %} {{ attributes }}>
<template>{% block content %}{% endblock %}</template>
</turbo-stream>

0 comments on commit 56fea2e

Please sign in to comment.