webserial-core 2.0.0-dev.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/demo-style.css +255 -0
- package/dist/demos/assets/demo-shared-DLFsukQx.css +1 -0
- package/dist/demos/assets/demo-shared-DnvFynUr.js +272 -0
- package/dist/demos/assets/web-bluetooth-VVwTClLx.js +1 -0
- package/dist/demos/assets/web-serial-CsBUUDvz.js +1 -0
- package/dist/demos/assets/web-usb-D7sSHjku.js +1 -0
- package/dist/demos/assets/websocket-DREvCVt-.js +1 -0
- package/dist/demos/web-bluetooth.html +408 -0
- package/dist/demos/web-serial.html +483 -0
- package/dist/demos/web-usb.html +526 -0
- package/dist/demos/websocket.html +498 -0
- package/dist/dist/webserial-core.umd.js +1 -0
- package/dist/favicon.svg +10 -0
- package/dist/images/cover.svg +145 -0
- package/dist/images/icons/adapters.svg +13 -0
- package/dist/images/icons/events.svg +4 -0
- package/dist/images/icons/parsers.svg +7 -0
- package/dist/images/icons/queue.svg +8 -0
- package/dist/images/icons/reconnect.svg +7 -0
- package/dist/images/icons/typed.svg +5 -0
- package/dist/images/logo.svg +10 -0
- package/dist/robots.txt +4 -0
- package/dist/types/index.d.ts +6 -30
- package/package.json +5 -4
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" data-theme="dark">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
|
+
<title>WebUSB — webserial-core demo</title>
|
|
8
|
+
<style>
|
|
9
|
+
:root {
|
|
10
|
+
--accent: #3b82f6;
|
|
11
|
+
--accent-dark: #2563eb;
|
|
12
|
+
--accent-glow: rgba(59, 130, 246, 0.12);
|
|
13
|
+
--accent-badge: #eff6ff;
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
16
|
+
<script
|
|
17
|
+
type="module"
|
|
18
|
+
crossorigin
|
|
19
|
+
src="/demos/assets/web-usb-D7sSHjku.js"
|
|
20
|
+
></script>
|
|
21
|
+
<link
|
|
22
|
+
rel="modulepreload"
|
|
23
|
+
crossorigin
|
|
24
|
+
href="/demos/assets/demo-shared-DnvFynUr.js"
|
|
25
|
+
/>
|
|
26
|
+
<link
|
|
27
|
+
rel="stylesheet"
|
|
28
|
+
crossorigin
|
|
29
|
+
href="/demos/assets/demo-shared-DLFsukQx.css"
|
|
30
|
+
/>
|
|
31
|
+
</head>
|
|
32
|
+
<body>
|
|
33
|
+
<!-- ── Topbar ──────────────────────────────────────────── -->
|
|
34
|
+
<header class="topbar">
|
|
35
|
+
<button class="icon-btn" id="menu-btn" title="Toggle sidebar">
|
|
36
|
+
<i data-lucide="menu"></i>
|
|
37
|
+
</button>
|
|
38
|
+
<a class="topbar-brand" href="/demos/web-serial.html">
|
|
39
|
+
<span class="brand-icon"><i data-lucide="usb"></i></span>
|
|
40
|
+
<span class="brand-name">webserial-core</span>
|
|
41
|
+
<span class="brand-ver">v2</span>
|
|
42
|
+
</a>
|
|
43
|
+
<span class="provider-pill">WebUSB</span>
|
|
44
|
+
<span class="flex-1"></span>
|
|
45
|
+
|
|
46
|
+
<nav class="topbar-nav">
|
|
47
|
+
<a class="nav-item" href="/demos/web-serial.html"
|
|
48
|
+
><i data-lucide="zap"></i><span class="nav-lbl"> Web Serial</span></a
|
|
49
|
+
>
|
|
50
|
+
<a class="nav-item" href="/demos/web-bluetooth.html"
|
|
51
|
+
><i data-lucide="bluetooth"></i
|
|
52
|
+
><span class="nav-lbl"> Bluetooth</span></a
|
|
53
|
+
>
|
|
54
|
+
<a class="nav-item active" href="/demos/web-usb.html"
|
|
55
|
+
><i data-lucide="usb"></i><span class="nav-lbl"> WebUSB</span></a
|
|
56
|
+
>
|
|
57
|
+
<a class="nav-item" href="/demos/websocket.html"
|
|
58
|
+
><i data-lucide="globe"></i><span class="nav-lbl"> WebSocket</span></a
|
|
59
|
+
>
|
|
60
|
+
</nav>
|
|
61
|
+
|
|
62
|
+
<div class="topbar-actions">
|
|
63
|
+
<div class="status-pill">
|
|
64
|
+
<div class="status-dot" id="status-dot"></div>
|
|
65
|
+
<span id="status-text">Disconnected</span>
|
|
66
|
+
</div>
|
|
67
|
+
<button class="icon-btn" id="theme-btn" title="Toggle theme">🌙</button>
|
|
68
|
+
<button
|
|
69
|
+
class="icon-btn code-toggle"
|
|
70
|
+
id="code-toggle-btn"
|
|
71
|
+
title="Toggle code panel"
|
|
72
|
+
>
|
|
73
|
+
<i data-lucide="code-2"></i>
|
|
74
|
+
</button>
|
|
75
|
+
<button class="btn btn-connect" id="btn-connect">Connect USB</button>
|
|
76
|
+
<button class="btn btn-disconnect" id="btn-disconnect" disabled>
|
|
77
|
+
Disconnect
|
|
78
|
+
</button>
|
|
79
|
+
</div>
|
|
80
|
+
</header>
|
|
81
|
+
|
|
82
|
+
<!-- ── App layout ───────────────────────────────────────── -->
|
|
83
|
+
<div class="app-layout">
|
|
84
|
+
<!-- ── Sidebar ─────────────────────────────────────────── -->
|
|
85
|
+
<aside class="sidebar" id="sidebar">
|
|
86
|
+
<div class="sidebar-scroll">
|
|
87
|
+
<!-- Info notice -->
|
|
88
|
+
<div class="sb-section">
|
|
89
|
+
<div class="notice">
|
|
90
|
+
Uses <strong>WebUsbProvider</strong> to bypass the native Web
|
|
91
|
+
Serial API. Useful on <strong>Android Chrome</strong> where Web
|
|
92
|
+
Serial is unavailable. Set the correct Vendor / Product IDs for
|
|
93
|
+
your hardware.
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<!-- USB-specific settings -->
|
|
98
|
+
<div class="sb-section">
|
|
99
|
+
<div class="sb-title">USB Interface Classes</div>
|
|
100
|
+
<div class="field-row">
|
|
101
|
+
<div class="field">
|
|
102
|
+
<label for="cfg-ctrl-class">Control Interface Class</label>
|
|
103
|
+
<input
|
|
104
|
+
type="number"
|
|
105
|
+
id="cfg-ctrl-class"
|
|
106
|
+
value="255"
|
|
107
|
+
min="0"
|
|
108
|
+
max="255"
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
<div class="field">
|
|
112
|
+
<label for="cfg-xfer-class">Transfer Interface Class</label>
|
|
113
|
+
<input
|
|
114
|
+
type="number"
|
|
115
|
+
id="cfg-xfer-class"
|
|
116
|
+
value="255"
|
|
117
|
+
min="0"
|
|
118
|
+
max="255"
|
|
119
|
+
/>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
<!-- Connection settings -->
|
|
125
|
+
<div class="sb-section">
|
|
126
|
+
<div class="sb-title">Connection</div>
|
|
127
|
+
|
|
128
|
+
<div class="field">
|
|
129
|
+
<label for="cfg-baud">Baud Rate</label>
|
|
130
|
+
<select id="cfg-baud">
|
|
131
|
+
<option>300</option>
|
|
132
|
+
<option>600</option>
|
|
133
|
+
<option>1200</option>
|
|
134
|
+
<option>2400</option>
|
|
135
|
+
<option>4800</option>
|
|
136
|
+
<option value="9600" selected>9600</option>
|
|
137
|
+
<option>14400</option>
|
|
138
|
+
<option>19200</option>
|
|
139
|
+
<option>38400</option>
|
|
140
|
+
<option>57600</option>
|
|
141
|
+
<option>115200</option>
|
|
142
|
+
<option>230400</option>
|
|
143
|
+
<option>250000</option>
|
|
144
|
+
<option>500000</option>
|
|
145
|
+
<option>1000000</option>
|
|
146
|
+
</select>
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
<div class="field-row">
|
|
150
|
+
<div class="field">
|
|
151
|
+
<label for="cfg-databits">Data Bits</label>
|
|
152
|
+
<select id="cfg-databits">
|
|
153
|
+
<option value="7">7</option>
|
|
154
|
+
<option value="8" selected>8</option>
|
|
155
|
+
</select>
|
|
156
|
+
</div>
|
|
157
|
+
<div class="field">
|
|
158
|
+
<label for="cfg-stopbits">Stop Bits</label>
|
|
159
|
+
<select id="cfg-stopbits">
|
|
160
|
+
<option value="1" selected>1</option>
|
|
161
|
+
<option value="2">2</option>
|
|
162
|
+
</select>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
|
|
166
|
+
<div class="field-row">
|
|
167
|
+
<div class="field">
|
|
168
|
+
<label for="cfg-parity">Parity</label>
|
|
169
|
+
<select id="cfg-parity">
|
|
170
|
+
<option value="none" selected>None</option>
|
|
171
|
+
<option value="even">Even</option>
|
|
172
|
+
<option value="odd">Odd</option>
|
|
173
|
+
</select>
|
|
174
|
+
</div>
|
|
175
|
+
<div class="field">
|
|
176
|
+
<label for="cfg-flow">Flow Control</label>
|
|
177
|
+
<select id="cfg-flow">
|
|
178
|
+
<option value="none" selected>None</option>
|
|
179
|
+
<option value="hardware">Hardware</option>
|
|
180
|
+
</select>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
|
|
184
|
+
<div class="field-row">
|
|
185
|
+
<div class="field">
|
|
186
|
+
<label for="cfg-bufsize">Buffer Size</label>
|
|
187
|
+
<input
|
|
188
|
+
type="number"
|
|
189
|
+
id="cfg-bufsize"
|
|
190
|
+
value="255"
|
|
191
|
+
min="64"
|
|
192
|
+
max="65536"
|
|
193
|
+
/>
|
|
194
|
+
</div>
|
|
195
|
+
<div class="field">
|
|
196
|
+
<label for="cfg-timeout">Cmd Timeout (ms)</label>
|
|
197
|
+
<input type="number" id="cfg-timeout" value="3000" min="0" />
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
<div class="field-row">
|
|
202
|
+
<div class="field">
|
|
203
|
+
<label for="cfg-handshake">Handshake (ms)</label>
|
|
204
|
+
<input type="number" id="cfg-handshake" value="2000" min="0" />
|
|
205
|
+
</div>
|
|
206
|
+
<div class="field">
|
|
207
|
+
<label for="cfg-reconnect-ms">Reconnect (ms)</label>
|
|
208
|
+
<input
|
|
209
|
+
type="number"
|
|
210
|
+
id="cfg-reconnect-ms"
|
|
211
|
+
value="1500"
|
|
212
|
+
min="500"
|
|
213
|
+
/>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
<div class="field-toggle">
|
|
218
|
+
<label for="cfg-autoreconnect">Auto Reconnect</label>
|
|
219
|
+
<label class="sw">
|
|
220
|
+
<input type="checkbox" id="cfg-autoreconnect" checked />
|
|
221
|
+
<span class="sw-knob"></span>
|
|
222
|
+
</label>
|
|
223
|
+
</div>
|
|
224
|
+
|
|
225
|
+
<div class="field-row">
|
|
226
|
+
<div class="field">
|
|
227
|
+
<label for="cfg-vendor">Vendor ID (hex)</label>
|
|
228
|
+
<input
|
|
229
|
+
type="text"
|
|
230
|
+
id="cfg-vendor"
|
|
231
|
+
value="10c4"
|
|
232
|
+
placeholder="e.g. 10c4"
|
|
233
|
+
/>
|
|
234
|
+
</div>
|
|
235
|
+
<div class="field">
|
|
236
|
+
<label for="cfg-product">Product ID (hex)</label>
|
|
237
|
+
<input
|
|
238
|
+
type="text"
|
|
239
|
+
id="cfg-product"
|
|
240
|
+
value="ea60"
|
|
241
|
+
placeholder="e.g. ea60"
|
|
242
|
+
/>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
|
|
247
|
+
<!-- Message format -->
|
|
248
|
+
<div class="sb-section">
|
|
249
|
+
<div class="sb-title">Message Format</div>
|
|
250
|
+
<div class="field">
|
|
251
|
+
<label for="cfg-delim">Delimiter</label>
|
|
252
|
+
<input
|
|
253
|
+
type="text"
|
|
254
|
+
id="cfg-delim"
|
|
255
|
+
value="\n"
|
|
256
|
+
placeholder="\n \r\n | etc."
|
|
257
|
+
/>
|
|
258
|
+
</div>
|
|
259
|
+
<div class="field-row">
|
|
260
|
+
<div class="field">
|
|
261
|
+
<label for="cfg-prepend">Prepend</label>
|
|
262
|
+
<input
|
|
263
|
+
type="text"
|
|
264
|
+
id="cfg-prepend"
|
|
265
|
+
value=""
|
|
266
|
+
placeholder="e.g. STX"
|
|
267
|
+
/>
|
|
268
|
+
</div>
|
|
269
|
+
<div class="field">
|
|
270
|
+
<label for="cfg-append">Append</label>
|
|
271
|
+
<input
|
|
272
|
+
type="text"
|
|
273
|
+
id="cfg-append"
|
|
274
|
+
value="\n"
|
|
275
|
+
placeholder="e.g. \n"
|
|
276
|
+
/>
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
|
|
281
|
+
<!-- Handshake -->
|
|
282
|
+
<div class="sb-section">
|
|
283
|
+
<div class="sb-title">Handshake on Connect</div>
|
|
284
|
+
<div class="notice" style="margin-bottom: 6px">
|
|
285
|
+
Sent automatically right after the USB interface is claimed. Leave
|
|
286
|
+
<em>Command</em> empty to skip entirely.
|
|
287
|
+
</div>
|
|
288
|
+
<div class="field-row">
|
|
289
|
+
<div class="field">
|
|
290
|
+
<label for="cfg-hs-cmd">Command to send</label>
|
|
291
|
+
<input
|
|
292
|
+
type="text"
|
|
293
|
+
id="cfg-hs-cmd"
|
|
294
|
+
value=""
|
|
295
|
+
placeholder="e.g. PING\n or FF 01 A3"
|
|
296
|
+
/>
|
|
297
|
+
</div>
|
|
298
|
+
<div class="field" style="flex: 0 0 62px">
|
|
299
|
+
<label for="cfg-hs-cmd-mode">Mode</label>
|
|
300
|
+
<select id="cfg-hs-cmd-mode">
|
|
301
|
+
<option value="text" selected>TXT</option>
|
|
302
|
+
<option value="hex">HEX</option>
|
|
303
|
+
</select>
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
<div class="field-row">
|
|
307
|
+
<div class="field">
|
|
308
|
+
<label for="cfg-hs-expect"
|
|
309
|
+
>Expected <small>(empty = no check)</small></label
|
|
310
|
+
>
|
|
311
|
+
<input
|
|
312
|
+
type="text"
|
|
313
|
+
id="cfg-hs-expect"
|
|
314
|
+
value=""
|
|
315
|
+
placeholder="e.g. PONG or OK"
|
|
316
|
+
/>
|
|
317
|
+
</div>
|
|
318
|
+
<div class="field" style="flex: 0 0 62px">
|
|
319
|
+
<label for="cfg-hs-expect-mode">Mode</label>
|
|
320
|
+
<select id="cfg-hs-expect-mode">
|
|
321
|
+
<option value="text" selected>TXT</option>
|
|
322
|
+
<option value="hex">HEX</option>
|
|
323
|
+
</select>
|
|
324
|
+
</div>
|
|
325
|
+
</div>
|
|
326
|
+
</div>
|
|
327
|
+
|
|
328
|
+
<!-- Saved Commands -->
|
|
329
|
+
<div class="sb-section">
|
|
330
|
+
<div class="sb-title">Saved Commands</div>
|
|
331
|
+
<div class="notice" style="margin-bottom: 6px">
|
|
332
|
+
Pre-defined commands to send. Use <em>HEX</em> for raw bytes.
|
|
333
|
+
</div>
|
|
334
|
+
<div class="field-row">
|
|
335
|
+
<div class="field" style="flex: 0 0 72px">
|
|
336
|
+
<label for="cmd-name">Name</label>
|
|
337
|
+
<input type="text" id="cmd-name" placeholder="LED ON" />
|
|
338
|
+
</div>
|
|
339
|
+
<div class="field">
|
|
340
|
+
<label for="cmd-value">Command</label>
|
|
341
|
+
<input type="text" id="cmd-value" placeholder="LED_ON\n" />
|
|
342
|
+
</div>
|
|
343
|
+
<div class="field" style="flex: 0 0 62px">
|
|
344
|
+
<label for="cmd-mode">Mode</label>
|
|
345
|
+
<select id="cmd-mode">
|
|
346
|
+
<option value="text" selected>TXT</option>
|
|
347
|
+
<option value="hex">HEX</option>
|
|
348
|
+
</select>
|
|
349
|
+
</div>
|
|
350
|
+
</div>
|
|
351
|
+
<button
|
|
352
|
+
class="btn btn-ghost"
|
|
353
|
+
id="cmd-add"
|
|
354
|
+
style="width: 100%; margin-top: 3px"
|
|
355
|
+
>
|
|
356
|
+
<i data-lucide="plus"></i> Add Command
|
|
357
|
+
</button>
|
|
358
|
+
<div class="chip-list" id="cmd-list"></div>
|
|
359
|
+
</div>
|
|
360
|
+
|
|
361
|
+
<!-- Data Listeners -->
|
|
362
|
+
<div class="sb-section">
|
|
363
|
+
<div class="sb-title">Data Listeners</div>
|
|
364
|
+
<div class="notice" style="margin-bottom: 6px">
|
|
365
|
+
Patterns for <code>on('serial:data')</code> — skeleton code in
|
|
366
|
+
download.
|
|
367
|
+
</div>
|
|
368
|
+
<div class="field-row">
|
|
369
|
+
<div class="field" style="flex: 0 0 64px">
|
|
370
|
+
<label for="lst-name">Name</label>
|
|
371
|
+
<input type="text" id="lst-name" placeholder="Temp" />
|
|
372
|
+
</div>
|
|
373
|
+
<div class="field">
|
|
374
|
+
<label for="lst-pattern">Pattern</label>
|
|
375
|
+
<input type="text" id="lst-pattern" placeholder="TEMP:" />
|
|
376
|
+
</div>
|
|
377
|
+
<div class="field" style="flex: 0 0 62px">
|
|
378
|
+
<label for="lst-match">Match</label>
|
|
379
|
+
<select id="lst-match">
|
|
380
|
+
<option value="exact">exact</option>
|
|
381
|
+
<option value="contains" selected>has</option>
|
|
382
|
+
<option value="startsWith">starts</option>
|
|
383
|
+
<option value="hex">hex</option>
|
|
384
|
+
</select>
|
|
385
|
+
</div>
|
|
386
|
+
</div>
|
|
387
|
+
<button
|
|
388
|
+
class="btn btn-ghost"
|
|
389
|
+
id="lst-add"
|
|
390
|
+
style="width: 100%; margin-top: 3px"
|
|
391
|
+
>
|
|
392
|
+
<i data-lucide="plus"></i> Add Listener
|
|
393
|
+
</button>
|
|
394
|
+
<div class="chip-list" id="lst-list"></div>
|
|
395
|
+
</div>
|
|
396
|
+
|
|
397
|
+
<!-- Download -->
|
|
398
|
+
<div class="sb-section">
|
|
399
|
+
<div class="sb-title">Download Code</div>
|
|
400
|
+
<div class="field">
|
|
401
|
+
<label for="dl-name">Class / File name</label>
|
|
402
|
+
<input
|
|
403
|
+
type="text"
|
|
404
|
+
id="dl-name"
|
|
405
|
+
value="MyUsbDevice"
|
|
406
|
+
placeholder="MyUsbDevice"
|
|
407
|
+
/>
|
|
408
|
+
</div>
|
|
409
|
+
<div class="dl-lang-row">
|
|
410
|
+
<label class="dl-opt"
|
|
411
|
+
><input type="radio" name="dl-lang" value="ts" checked />
|
|
412
|
+
TypeScript</label
|
|
413
|
+
>
|
|
414
|
+
<label class="dl-opt"
|
|
415
|
+
><input type="radio" name="dl-lang" value="js" />
|
|
416
|
+
JavaScript</label
|
|
417
|
+
>
|
|
418
|
+
</div>
|
|
419
|
+
<div class="dl-type-row">
|
|
420
|
+
<label class="dl-opt"
|
|
421
|
+
><input type="radio" name="dl-type" value="file" checked />
|
|
422
|
+
Standalone file</label
|
|
423
|
+
>
|
|
424
|
+
<label class="dl-opt"
|
|
425
|
+
><input type="radio" name="dl-type" value="project" /> Full
|
|
426
|
+
project (ZIP)</label
|
|
427
|
+
>
|
|
428
|
+
</div>
|
|
429
|
+
<div class="dl-btns">
|
|
430
|
+
<button class="btn btn-dl" id="dl-btn">
|
|
431
|
+
<i data-lucide="download"></i> Download
|
|
432
|
+
</button>
|
|
433
|
+
<button
|
|
434
|
+
class="btn btn-ghost"
|
|
435
|
+
id="cfg-export-btn"
|
|
436
|
+
title="Export configuration as JSON"
|
|
437
|
+
>
|
|
438
|
+
<i data-lucide="share"></i> Export config
|
|
439
|
+
</button>
|
|
440
|
+
<label
|
|
441
|
+
class="btn btn-ghost"
|
|
442
|
+
title="Import configuration from JSON"
|
|
443
|
+
>
|
|
444
|
+
<i data-lucide="upload"></i> Import config
|
|
445
|
+
<input
|
|
446
|
+
type="file"
|
|
447
|
+
id="cfg-import-input"
|
|
448
|
+
accept=".json"
|
|
449
|
+
style="display: none"
|
|
450
|
+
/>
|
|
451
|
+
</label>
|
|
452
|
+
</div>
|
|
453
|
+
</div>
|
|
454
|
+
</div>
|
|
455
|
+
<!-- /sidebar-scroll -->
|
|
456
|
+
</aside>
|
|
457
|
+
<div class="sidebar-resize-handle" id="sidebar-resize-handle"></div>
|
|
458
|
+
|
|
459
|
+
<!-- ── Chat console ─────────────────────────────────── -->
|
|
460
|
+
<main class="console-area">
|
|
461
|
+
<div class="console-hdr">
|
|
462
|
+
<div class="status-pill">
|
|
463
|
+
<div class="status-dot" id="console-dot"></div>
|
|
464
|
+
<span id="console-text">Connect a USB device to begin</span>
|
|
465
|
+
</div>
|
|
466
|
+
<button
|
|
467
|
+
class="btn btn-ghost"
|
|
468
|
+
id="clear-btn"
|
|
469
|
+
style="margin-left: auto; font-size: 0.7rem; padding: 4px 10px"
|
|
470
|
+
>
|
|
471
|
+
Clear
|
|
472
|
+
</button>
|
|
473
|
+
</div>
|
|
474
|
+
|
|
475
|
+
<div class="messages" id="messages">
|
|
476
|
+
<div class="empty-state">
|
|
477
|
+
<div class="empty-icon">🔌</div>
|
|
478
|
+
<span>Connect a WebUSB device to begin</span>
|
|
479
|
+
</div>
|
|
480
|
+
</div>
|
|
481
|
+
|
|
482
|
+
<div class="input-bar">
|
|
483
|
+
<button class="btn btn-mode" id="mode-toggle">TXT</button>
|
|
484
|
+
<input
|
|
485
|
+
class="msg-input"
|
|
486
|
+
id="input-send"
|
|
487
|
+
type="text"
|
|
488
|
+
placeholder="Type a command, e.g. LED_ON"
|
|
489
|
+
disabled
|
|
490
|
+
/>
|
|
491
|
+
<button class="btn btn-send" id="btn-send" disabled>Send</button>
|
|
492
|
+
</div>
|
|
493
|
+
</main>
|
|
494
|
+
|
|
495
|
+
<!-- ── Code panel ────────────────────────────────────── -->
|
|
496
|
+
<div class="resize-handle" id="resize-handle"></div>
|
|
497
|
+
<aside class="code-panel" id="code-panel">
|
|
498
|
+
<div class="cp-hdr">
|
|
499
|
+
<div class="cp-title">
|
|
500
|
+
<span>Code Preview</span>
|
|
501
|
+
<span class="cp-tab" id="code-tab">device.ts</span>
|
|
502
|
+
</div>
|
|
503
|
+
<div class="cp-actions">
|
|
504
|
+
<button class="cp-btn" id="copy-btn">Copy</button>
|
|
505
|
+
</div>
|
|
506
|
+
</div>
|
|
507
|
+
<pre class="code-view" id="code-view"></pre>
|
|
508
|
+
</aside>
|
|
509
|
+
</div>
|
|
510
|
+
<!-- /app-layout -->
|
|
511
|
+
|
|
512
|
+
<footer class="app-footer">
|
|
513
|
+
© 2025
|
|
514
|
+
<a
|
|
515
|
+
href="https://github.com/danidoble"
|
|
516
|
+
style="color: inherit; text-decoration: none"
|
|
517
|
+
>@danidoble</a
|
|
518
|
+
>
|
|
519
|
+
· webserial-core v2
|
|
520
|
+
</footer>
|
|
521
|
+
<script src="https://unpkg.com/lucide@latest/dist/umd/lucide.min.js"></script>
|
|
522
|
+
<script>
|
|
523
|
+
lucide.createIcons();
|
|
524
|
+
</script>
|
|
525
|
+
</body>
|
|
526
|
+
</html>
|