Rework state management, public API, and events; DRY up state changes

This commit is contained in:
Rockwell Schrock
2025-12-18 15:23:06 -05:00
parent 26e7a353d3
commit 9728309ca9
3 changed files with 145 additions and 282 deletions
+2 -1
View File
@@ -483,6 +483,7 @@
</div>
<div class="panel">
<h2>trmnl:change event</h2>
<pre id="event-output">Waiting for picker to load...</pre>
</div>
</div>
@@ -493,7 +494,7 @@
// Listen for changes (including initial state)
// Attach listener BEFORE creating picker to catch initial event
document.getElementById('picker-form').addEventListener('trmnl:changed', (event) => {
document.getElementById('picker-form').addEventListener('trmnl:change', (event) => {
// Display event data
document.getElementById('event-output').textContent = JSON.stringify(event.detail, null, 2)
+1 -1
View File
@@ -137,7 +137,7 @@ pre {
display: inline-block;
}
.screen-preview h2 {
h2 {
margin: 0 0 1.5rem 0;
color: #333;
font-size: 1.25rem;
+142 -280
View File
File diff suppressed because it is too large Load Diff