Skip to content

Commit 2f32a92

Browse files
committed
minor #1377 [Site] LiveMemory demo (smnandre)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [Site] LiveMemory demo Ready to review :) Commits ------- 1c57719 [Site] LiveMemory demo
2 parents 1a4bdc0 + 1c57719 commit 2f32a92

File tree

115 files changed

+4423
-480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+4423
-480
lines changed

ux.symfony.com/assets/controllers.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"@symfony/ux-turbo": {
8888
"turbo-core": {
8989
"enabled": true,
90-
"fetch": "eager"
90+
"fetch": "lazy"
9191
},
9292
"mercure-turbo-stream": {
9393
"enabled": true,
@@ -97,7 +97,7 @@
9797
"@symfony/ux-typed": {
9898
"typed": {
9999
"enabled": true,
100-
"fetch": "eager"
100+
"fetch": "lazy"
101101
}
102102
},
103103
"@symfony/ux-vue": {

ux.symfony.com/assets/controllers/bootstrap-modal-controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { Modal } from 'bootstrap';
1010
* See templates/components/BootstrapModal.html.twig to see how this is
1111
* attached to Bootstrap modal.
1212
*/
13+
/* stimulusFetch: 'lazy' */
1314
export default class extends Controller {
1415
modal = null;
1516

ux.symfony.com/assets/controllers/code-expander-controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Controller } from '@hotwired/stimulus';
22

3+
/* stimulusFetch: 'lazy' */
34
export default class extends Controller {
45
static targets = ['useStatements', 'expandCodeButton', 'codeContent'];
56

ux.symfony.com/assets/controllers/code-highlighter-controller.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ hljs.registerLanguage('twig', hljs_twig);
1111
// xml is the language used for HTML
1212
hljs.registerLanguage('xml', hljs_xml);
1313

14+
15+
/* stimulusFetch: 'lazy' */
1416
export default class extends Controller {
1517
static targets = ['codeBlock'];
1618

ux.symfony.com/assets/controllers/markdown-controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Controller } from '@hotwired/stimulus';
22
import snarkdown from 'snarkdown';
33

4+
/* stimulusFetch: 'lazy' */
45
export default class extends Controller {
56
static targets = ['input', 'preview'];
67

ux.symfony.com/assets/controllers/theme-switcher-controller.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,21 @@ export default class extends Controller {
88
}
99

1010
const theme = currentTheme === 'dark' ? 'light' : 'dark';
11+
12+
this.select(theme);
13+
}
14+
15+
select (theme) {
16+
clearTimeout(this.timeout);
17+
18+
this.element.setAttribute('data-switch', theme);
1119
localStorage.setItem('user-theme', theme);
12-
document.documentElement.setAttribute('data-bs-theme', theme);
20+
21+
this.timeout = setTimeout(() => {
22+
/**
23+
* Small delay to allow CSS transitions during theme switch.
24+
*/
25+
document.documentElement.setAttribute('data-bs-theme', theme);
26+
}, 250);
1327
}
1428
}

ux.symfony.com/assets/controllers/tooltips-controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Controller } from '@hotwired/stimulus';
22
import { Tooltip } from 'bootstrap';
33

4+
/* stimulusFetch: 'lazy' */
45
export default class extends Controller {
56
connect() {
67
this.element.querySelectorAll('[data-bs-toggle="tooltip"]').forEach((element) => {

ux.symfony.com/assets/controllers/translator-demo-controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function highlight({ code, language = 'javascript' }) {
2121
return hljs.highlight(code, { language }).value;
2222
}
2323

24+
/* stimulusFetch: 'lazy' */
2425
export default class extends Controller {
2526
static targets = [
2627
'helloCode',

ux.symfony.com/assets/controllers/ux-clipboard-controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Clipboard from 'stimulus-clipboard'
22

3+
/* stimulusFetch: 'lazy' */
34
export default class extends Clipboard {
45
static values = {
56
source: String,
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { startStimulusApp } from '@symfony/stimulus-bundle';
2+
3+
const app = startStimulusApp();

0 commit comments

Comments
 (0)