Skip to content

Commit bd080e6

Browse files
committed
[Site] Remove stimulus_* helpers
1 parent 5688875 commit bd080e6

10 files changed

+51
-51
lines changed

ux.symfony.com/templates/components/BootstrapModal.html.twig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
tabindex: '-1',
44
'aria-hidden': 'true',
55
id: id ? id : false,
6-
}).defaults(stimulus_controller('bootstrap-modal')) }}>
6+
}) }}
7+
data-controller="bootstrap-modal"
8+
>
79
<div class="modal-dialog">
810
<div class="modal-content">
911
{% block modal_full_content %}

ux.symfony.com/templates/components/CodeBlock.html.twig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
</div>
1212
{% endif %}
1313

14-
<div class="Terminal_body" {{ stimulus_controller('code-expander') }}>
14+
<div class="Terminal_body" data-controller="code-expander">
1515
{% if not showFilename %}
1616
<div class="Terminal_actions">
1717
<twig:CodeBlockButtons source="{{ this.rawSource }}" link="{{ this.githubLink }}"/>
1818
</div>
1919
{% endif %}
2020
<div class="Terminal_content" style="height: {{ height }};"
21-
{{ stimulus_target('code-expander', 'codeContent') }}
22-
{{ stimulus_controller('code-highlighter') }}
21+
data-code-expander-target="codeContent"
22+
data-controller="code-highlighter"
2323
>
2424
{% for piece in this.prepareSource %}
2525
{% if piece.highlight ?? true %}
26-
<pre><code class="language-{{ this.language }}" {{ stimulus_target('code-highlighter', 'codeBlock') }}>
26+
<pre><code class="language-{{ this.language }}" data-code-highlighter-target="codeBlock">
2727
{{- piece.content -}}
2828
</code></pre>
2929
{% else %}
@@ -36,13 +36,13 @@
3636
<button
3737
type="button"
3838
class="btn btn-expand-code pt-2 text-center"
39-
{{ stimulus_target('code-expander', 'expandCodeButton') }}
40-
{{ stimulus_action('code-expander', 'expandCode') }}
39+
data-code-expander-target="expandCodeButton"
40+
data-action="code-expander#expandCode"
4141
style="display: none;"
4242
>
43-
<twig:Icon name="arrow-down" />
43+
<twig:Icon name="arrow-down"/>
4444
Expand code
45-
<twig:Icon name="arrow-down" />
45+
<twig:Icon name="arrow-down"/>
4646
</button>
4747
{% endblock %}
4848
</div>

ux.symfony.com/templates/components/CodeBlockButtons.html.twig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{% props source, link %}
22

3-
<div {{ stimulus_controller('ux-clipboard', {
4-
source: source,
5-
})|stimulus_controller('tooltips') }}
3+
<div
4+
data-controller="ux-clipboard tooltips"
5+
data-ux-clipboard-source-value="{{ source }}"
66
data-ux-clipboard-success-content="Copied!"
77
class="code-buttons"
88
>
@@ -19,8 +19,8 @@
1919
<button
2020
type="button"
2121
class="btn btn-copy btn-sm"
22-
{{ stimulus_action('ux-clipboard', 'copy') }}
22+
data-action="ux-clipboard#copy"
2323
><twig:Icon name="copy"/>
24-
<span {{ stimulus_target('ux-clipboard', 'button') }}> Copy</span>
24+
<span data-ux-clipboard-target="button"> Copy</span>
2525
</button>
2626
</div>

ux.symfony.com/templates/components/DinoChart.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
data-model="currentTypes"
3535
multiple
3636
id="dinoTypes"
37-
{{ stimulus_controller('symfony/ux-autocomplete/autocomplete') }}
37+
data-controller="symfony--ux-autocomplete--autocomplete"
3838
>
3939
{% for type in allTypes %}
4040
<option value="{{ type }}">{{ type }}</option>

ux.symfony.com/templates/components/HomepageTerminalSwapper.html.twig

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
{% block content -%}
66
<span
77
style="font-size: 1.2em;"
8-
{{ stimulus_controller('symfony/ux-typed', {
9-
strings: typedStrings,
10-
loop: true,
11-
showCursor: true,
12-
typeSpeed: 20,
13-
cursorChar: '🖱',
14-
contentType: 'html'
15-
}) }}
8+
data-controller="symfony--ux-typed"
9+
data-symfony--ux-typed-loop-value="true"
10+
data-symfony--ux-typed-show-cursor-value="true"
11+
data-symfony--ux-typed-type-speed-value="20"
12+
data-symfony--ux-typed-cursor-char-value="🖱"
13+
data-symfony--ux-typed-content-type-value="html"
14+
data-symfony--ux-typed-strings-value="{{ typedStrings|json_encode|e('html_attr') }}"
1615
></span>
1716
{%- endblock %}
1817
{% endcomponent %}

ux.symfony.com/templates/components/TerminalCommand.html.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<div {{ attributes.defaults({class: 'TerminalCommand'}).defaults(stimulus_controller('clipboard')) }}>
1+
<div {{ attributes.defaults({class: 'TerminalCommand'}) }} data-controller="ux-clipboard">
22
<pre
33
class="TerminalCommand_input"
44
aria-label="{{ label|default }}"
5-
><code {{ stimulus_target('clipboard', 'source') }}>{{ command }}</code></pre>
5+
><code data-clipboard-target="source">{{ command }}</code></pre>
66
<button
77
type="button"
88
class="TerminalCommand_action btn btn-copy"
99
aria-label="Copy command"
10-
{{ stimulus_action('clipboard', 'copy') }}
10+
data-action="clipboard#copy"
1111
>
1212
<twig:Icon name="copy"/>
1313
</button>

ux.symfony.com/templates/main/homepage.html.twig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</div>
3838

3939
<div class="col-12 col-md-6 mt-3 mt-md-0">
40-
<div {{ stimulus_controller('tooltips') }} class="ux-container file-tree flex-grow-1 ms-2 py-3">
40+
<div data-controller="tooltips" class="ux-container file-tree flex-grow-1 ms-2 py-3">
4141
<div style="height: 185px; overflow: auto;">
4242
<ul class="list-unstyled file-tree-main">
4343
{{ include('main/_fileTreeLevel.html.twig', {
@@ -77,19 +77,19 @@
7777
</div>
7878

7979
{% block markdown_example %}
80-
<div class="p-4 markdown-container background-glass shadow-blur shadow-blur--rainbow mt-5 row" {{ stimulus_controller('markdown') }}>
80+
<div class="p-4 markdown-container background-glass shadow-blur shadow-blur--rainbow mt-5 row" data-controller="markdown">
8181
<div class="col-12 col-md-5">
8282
<textarea rows="3" class="form-control" aria-label="Type markdown into this box"
83-
{{ stimulus_target('markdown', 'input') }}
83+
data-markdown-target="input"
8484
>Writing JavaScript is a **dream** with Stimulus 🤩</textarea>
8585
</div>
8686
<div class="col-12 col-md-2 d-flex justify-content-center align-items-center py-3">
87-
<button class="btn btn-dark"
88-
{{ stimulus_action('markdown', 'render') }}
89-
>Convert <twig:Icon name="arrow-right"/></button>
87+
<button class="btn btn-dark" data-action="markdown#render">
88+
Convert <twig:Icon name="arrow-right"/>
89+
</button>
9090
</div>
9191
<div class="col-12 col-md-5">
92-
<div style="min-height: 86px;" class="markdown-form-render-container p-2" {{ stimulus_target('markdown', 'preview') }} >
92+
<div style="min-height: 86px;" class="markdown-form-render-container p-2" data-markdown-target="preview">
9393
<small class="fw-light">(click "Convert")</small>
9494
</div>
9595
</div>

ux.symfony.com/templates/ux_packages/lazy-image.html.twig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@
4141
{% block code_block_right %}
4242
<img
4343
src="{{ data_uri_thumbnail(legosFilePath, 40, 30) }}"
44-
{{ stimulus_controller('symfony/ux-lazy-image/lazy-image', {
45-
src: asset('images/legos.jpg')
46-
}) }}
44+
data-controller="symfony--ux-lazy-image--lazy-image"
45+
data-symfony--ux-lazy-image--lazy-image-src="{{ asset('images/legos.jpg') }}"
4746
alt="A blurhash image that is replaced by the real image on load"
4847
width="578"
4948
height="275"

ux.symfony.com/templates/ux_packages/swup.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
{% block demo_content %}
3232
{% block swup_specific_demo_content %}
33-
<div {{ stimulus_controller('symfony/ux-swup/swup') }} id="swup" data-turbo="false">
33+
<div data-controller="symfony--ux-swup--swup" id="swup" data-turbo="false">
3434
<div class="row">
3535
{% for package in pager %}
3636
{{ include('main/_package_in_list.html.twig') }}

ux.symfony.com/templates/ux_packages/typed.html.twig

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@
2525

2626
{% block code_block_right %}
2727
<div class="p-5" style="font-size: 1.3em;">
28+
{% set strings = [
29+
'I ❤️ Symfony UX!',
30+
'Symfony UX Typed loves to type',
31+
'Symfony UX Typed and backspace',
32+
'Control the speed',
33+
'Control the cursor',
34+
'Control your destiny!!!',
35+
'Control your destiny... sort of',
36+
] %}
2837
<span
29-
{{ stimulus_controller('symfony/ux-typed', {
30-
strings: [
31-
'I ❤️ Symfony UX!',
32-
'Symfony UX Typed loves to type',
33-
'Symfony UX Typed and backspace',
34-
'Control the speed',
35-
'Control the cursor',
36-
'Control your destiny!!!',
37-
'Control your destiny... sort of',
38-
],
39-
loop: true,
40-
showCursor: true,
41-
cursorChar: '',
42-
}) }}
38+
data-controller="symfony--ux-typed"
39+
data-symfony--ux-typed-loop-value="true"
40+
data-symfony--ux-typed-show-cursor-value="true"
41+
data-symfony--ux-typed-cursor-char-value=""
42+
data-symfony--ux-typed-strings-value="{{ strings|json_encode|e('html_attr') }}"
4343
></span>
4444
</div>
4545
{% endblock %}

0 commit comments

Comments
 (0)