electrobun 0.4.1 → 0.6.0-beta.0

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.
Files changed (78) hide show
  1. package/{templates/multitab-browser/bun.lock → bun.lock} +20 -13
  2. package/dist/api/bun/proc/native.ts +84 -16
  3. package/package.json +14 -16
  4. package/BETA_RELEASE.md +0 -67
  5. package/BUILD.md +0 -90
  6. package/LICENSE +0 -21
  7. package/README.md +0 -102
  8. package/debug.js +0 -5
  9. package/templates/hello-world/README.md +0 -57
  10. package/templates/hello-world/bun.lock +0 -225
  11. package/templates/hello-world/electrobun.config.ts +0 -28
  12. package/templates/hello-world/package.json +0 -16
  13. package/templates/hello-world/src/bun/index.ts +0 -15
  14. package/templates/hello-world/src/mainview/index.css +0 -124
  15. package/templates/hello-world/src/mainview/index.html +0 -46
  16. package/templates/hello-world/src/mainview/index.ts +0 -1
  17. package/templates/interactive-playground/README.md +0 -26
  18. package/templates/interactive-playground/assets/tray-icon.png +0 -0
  19. package/templates/interactive-playground/electrobun.config.ts +0 -36
  20. package/templates/interactive-playground/package-lock.json +0 -1112
  21. package/templates/interactive-playground/package.json +0 -15
  22. package/templates/interactive-playground/src/bun/demos/files.ts +0 -70
  23. package/templates/interactive-playground/src/bun/demos/menus.ts +0 -139
  24. package/templates/interactive-playground/src/bun/demos/rpc.ts +0 -83
  25. package/templates/interactive-playground/src/bun/demos/system.ts +0 -72
  26. package/templates/interactive-playground/src/bun/demos/updates.ts +0 -105
  27. package/templates/interactive-playground/src/bun/demos/windows.ts +0 -90
  28. package/templates/interactive-playground/src/bun/index.ts +0 -124
  29. package/templates/interactive-playground/src/bun/types/rpc.ts +0 -109
  30. package/templates/interactive-playground/src/mainview/components/EventLog.ts +0 -107
  31. package/templates/interactive-playground/src/mainview/components/Sidebar.ts +0 -65
  32. package/templates/interactive-playground/src/mainview/components/Toast.ts +0 -57
  33. package/templates/interactive-playground/src/mainview/demos/FileDemo.ts +0 -211
  34. package/templates/interactive-playground/src/mainview/demos/MenuDemo.ts +0 -102
  35. package/templates/interactive-playground/src/mainview/demos/RPCDemo.ts +0 -229
  36. package/templates/interactive-playground/src/mainview/demos/TrayDemo.ts +0 -132
  37. package/templates/interactive-playground/src/mainview/demos/WebViewDemo.ts +0 -465
  38. package/templates/interactive-playground/src/mainview/demos/WindowDemo.ts +0 -207
  39. package/templates/interactive-playground/src/mainview/index.css +0 -538
  40. package/templates/interactive-playground/src/mainview/index.html +0 -103
  41. package/templates/interactive-playground/src/mainview/index.ts +0 -238
  42. package/templates/multitab-browser/README.md +0 -34
  43. package/templates/multitab-browser/electrobun.config.ts +0 -32
  44. package/templates/multitab-browser/package-lock.json +0 -20
  45. package/templates/multitab-browser/package.json +0 -12
  46. package/templates/multitab-browser/src/bun/index.ts +0 -144
  47. package/templates/multitab-browser/src/bun/tabManager.ts +0 -200
  48. package/templates/multitab-browser/src/bun/types/rpc.ts +0 -78
  49. package/templates/multitab-browser/src/mainview/index.css +0 -487
  50. package/templates/multitab-browser/src/mainview/index.html +0 -94
  51. package/templates/multitab-browser/src/mainview/index.ts +0 -634
  52. package/templates/photo-booth/README.md +0 -108
  53. package/templates/photo-booth/bun.lock +0 -239
  54. package/templates/photo-booth/electrobun.config.ts +0 -32
  55. package/templates/photo-booth/package.json +0 -17
  56. package/templates/photo-booth/src/bun/index.ts +0 -92
  57. package/templates/photo-booth/src/mainview/index.css +0 -465
  58. package/templates/photo-booth/src/mainview/index.html +0 -124
  59. package/templates/photo-booth/src/mainview/index.ts +0 -499
  60. package/test-new-window-events.ts +0 -26
  61. package/test-new-window.html +0 -75
  62. package/test-npm-install.sh +0 -34
  63. package/tests/bun.lock +0 -14
  64. package/tests/electrobun.config.ts +0 -45
  65. package/tests/package-lock.json +0 -36
  66. package/tests/package.json +0 -13
  67. package/tests/src/bun/index.ts +0 -100
  68. package/tests/src/bun/test-runner.ts +0 -508
  69. package/tests/src/mainview/index.html +0 -110
  70. package/tests/src/mainview/index.ts +0 -458
  71. package/tests/src/mainview/styles/main.css +0 -451
  72. package/tests/src/testviews/tray-test.html +0 -57
  73. package/tests/src/testviews/webview-mask.html +0 -114
  74. package/tests/src/testviews/webview-navigation.html +0 -36
  75. package/tests/src/testviews/window-create.html +0 -17
  76. package/tests/src/testviews/window-events.html +0 -29
  77. package/tests/src/testviews/window-focus.html +0 -37
  78. package/tests/src/webviewtag/index.ts +0 -11
@@ -1,538 +0,0 @@
1
- /* Reset and base styles */
2
- * {
3
- margin: 0;
4
- padding: 0;
5
- box-sizing: border-box;
6
- }
7
-
8
- body {
9
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
10
- background: #f5f7fa;
11
- color: #2d3748;
12
- height: 100vh;
13
- overflow: hidden;
14
- }
15
-
16
- /* App layout */
17
- .app {
18
- display: flex;
19
- flex-direction: column;
20
- height: 100vh;
21
- }
22
-
23
- /* Header */
24
- .header {
25
- background: #fff;
26
- border-bottom: 1px solid #e2e8f0;
27
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
28
- z-index: 100;
29
- }
30
-
31
- .header-content {
32
- display: flex;
33
- align-items: center;
34
- justify-content: space-between;
35
- padding: 1rem 1.5rem;
36
- max-width: none;
37
- }
38
-
39
- .header-title {
40
- display: flex;
41
- align-items: center;
42
- font-size: 1.5rem;
43
- font-weight: 600;
44
- color: #1a365d;
45
- }
46
-
47
- .logo {
48
- font-size: 2rem;
49
- margin-right: 0.75rem;
50
- }
51
-
52
- .header-actions {
53
- display: flex;
54
- align-items: center;
55
- gap: 1rem;
56
- }
57
-
58
- .search-container {
59
- position: relative;
60
- }
61
-
62
- .search-input {
63
- padding: 0.5rem 2.5rem 0.5rem 1rem;
64
- border: 1px solid #cbd5e0;
65
- border-radius: 0.5rem;
66
- font-size: 0.875rem;
67
- width: 250px;
68
- background: #f7fafc;
69
- }
70
-
71
- .search-input:focus {
72
- outline: none;
73
- border-color: #4299e1;
74
- background: #fff;
75
- }
76
-
77
- .search-icon {
78
- position: absolute;
79
- right: 0.75rem;
80
- top: 50%;
81
- transform: translateY(-50%);
82
- color: #a0aec0;
83
- }
84
-
85
- /* Main content */
86
- .main-content {
87
- display: flex;
88
- flex: 1;
89
- overflow: hidden;
90
- }
91
-
92
- /* Sidebar */
93
- .sidebar {
94
- width: 260px;
95
- background: #fff;
96
- border-right: 1px solid #e2e8f0;
97
- overflow-y: auto;
98
- }
99
-
100
- .nav {
101
- padding: 1.5rem 0;
102
- }
103
-
104
- .nav-section {
105
- margin-bottom: 2rem;
106
- }
107
-
108
- .nav-section-title {
109
- font-size: 0.75rem;
110
- font-weight: 600;
111
- text-transform: uppercase;
112
- letter-spacing: 0.05em;
113
- color: #718096;
114
- margin: 0 1.5rem 1rem;
115
- }
116
-
117
- .nav-list {
118
- list-style: none;
119
- }
120
-
121
- .nav-item {
122
- display: flex;
123
- align-items: center;
124
- padding: 0.75rem 1.5rem;
125
- cursor: pointer;
126
- transition: all 0.2s;
127
- border-left: 3px solid transparent;
128
- }
129
-
130
- .nav-item:hover {
131
- background: #f7fafc;
132
- }
133
-
134
- .nav-item.active {
135
- background: #ebf8ff;
136
- border-left-color: #4299e1;
137
- color: #2b6cb0;
138
- }
139
-
140
- .nav-icon {
141
- font-size: 1.25rem;
142
- margin-right: 0.75rem;
143
- width: 1.5rem;
144
- text-align: center;
145
- }
146
-
147
- .nav-label {
148
- font-weight: 500;
149
- }
150
-
151
- /* Content area */
152
- .content {
153
- flex: 1;
154
- padding: 2rem;
155
- overflow-y: auto;
156
- background: #f5f7fa;
157
- }
158
-
159
- .demo-content {
160
- background: #fff;
161
- border-radius: 0.75rem;
162
- padding: 2rem;
163
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
164
- min-height: calc(100vh - 8rem);
165
- }
166
-
167
- /* Demo sections */
168
- .demo-section {
169
- margin-bottom: 3rem;
170
- }
171
-
172
- .demo-header {
173
- display: flex;
174
- align-items: center;
175
- margin-bottom: 1.5rem;
176
- padding-bottom: 1rem;
177
- border-bottom: 2px solid #e2e8f0;
178
- }
179
-
180
- .demo-icon {
181
- font-size: 2rem;
182
- margin-right: 1rem;
183
- }
184
-
185
- .demo-title {
186
- font-size: 1.75rem;
187
- font-weight: 600;
188
- color: #1a365d;
189
- }
190
-
191
- .demo-description {
192
- color: #718096;
193
- margin-top: 0.25rem;
194
- font-size: 1rem;
195
- }
196
-
197
- .demo-controls {
198
- background: #f7fafc;
199
- border: 1px solid #e2e8f0;
200
- border-radius: 0.5rem;
201
- padding: 1.5rem;
202
- margin-bottom: 1.5rem;
203
- }
204
-
205
- .control-group {
206
- display: flex;
207
- flex-wrap: wrap;
208
- gap: 1rem;
209
- align-items: center;
210
- margin-bottom: 1rem;
211
- }
212
-
213
- .control-group:last-child {
214
- margin-bottom: 0;
215
- }
216
-
217
- .control-label {
218
- font-weight: 500;
219
- min-width: 80px;
220
- }
221
-
222
- .control-input {
223
- padding: 0.5rem;
224
- border: 1px solid #cbd5e0;
225
- border-radius: 0.25rem;
226
- font-size: 0.875rem;
227
- width: 100px;
228
- }
229
-
230
- .control-checkbox {
231
- display: flex;
232
- align-items: center;
233
- gap: 0.5rem;
234
- }
235
-
236
- .demo-results {
237
- background: #f8fafc;
238
- border: 1px solid #e2e8f0;
239
- border-radius: 0.5rem;
240
- padding: 1.5rem;
241
- }
242
-
243
- .results-header {
244
- font-weight: 600;
245
- margin-bottom: 1rem;
246
- color: #2d3748;
247
- }
248
-
249
- .window-grid {
250
- display: grid;
251
- grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
252
- gap: 1rem;
253
- margin-bottom: 1rem;
254
- }
255
-
256
- .window-card {
257
- background: #fff;
258
- border: 1px solid #e2e8f0;
259
- border-radius: 0.5rem;
260
- padding: 1rem;
261
- text-align: center;
262
- }
263
-
264
- .window-preview {
265
- width: 100%;
266
- height: 80px;
267
- background: #edf2f7;
268
- border-radius: 0.25rem;
269
- margin-bottom: 0.75rem;
270
- display: flex;
271
- align-items: center;
272
- justify-content: center;
273
- color: #718096;
274
- font-size: 0.875rem;
275
- }
276
-
277
- .window-actions {
278
- display: flex;
279
- gap: 0.5rem;
280
- justify-content: center;
281
- }
282
-
283
- /* Buttons */
284
- .btn {
285
- padding: 0.75rem 1.5rem;
286
- border: none;
287
- border-radius: 0.5rem;
288
- font-weight: 500;
289
- cursor: pointer;
290
- transition: all 0.2s;
291
- font-size: 0.875rem;
292
- text-decoration: none;
293
- display: inline-flex;
294
- align-items: center;
295
- gap: 0.5rem;
296
- }
297
-
298
- .btn-primary {
299
- background: #4299e1;
300
- color: #fff;
301
- }
302
-
303
- .btn-primary:hover {
304
- background: #3182ce;
305
- }
306
-
307
- .btn-secondary {
308
- background: #edf2f7;
309
- color: #4a5568;
310
- }
311
-
312
- .btn-secondary:hover {
313
- background: #e2e8f0;
314
- }
315
-
316
- .btn-danger {
317
- background: #f56565;
318
- color: #fff;
319
- }
320
-
321
- .btn-danger:hover {
322
- background: #e53e3e;
323
- }
324
-
325
- .btn-small {
326
- padding: 0.5rem 1rem;
327
- font-size: 0.75rem;
328
- }
329
-
330
- /* Event log */
331
- .event-log {
332
- position: fixed;
333
- top: 0;
334
- right: -350px;
335
- width: 350px;
336
- height: 100vh;
337
- background: #fff;
338
- border-left: 1px solid #e2e8f0;
339
- transition: right 0.3s ease;
340
- z-index: 200;
341
- display: flex;
342
- flex-direction: column;
343
- }
344
-
345
- .event-log.open {
346
- right: 0;
347
- }
348
-
349
- .event-log-header {
350
- display: flex;
351
- align-items: center;
352
- justify-content: space-between;
353
- padding: 1rem 1.5rem;
354
- border-bottom: 1px solid #e2e8f0;
355
- background: #f7fafc;
356
- }
357
-
358
- .event-log-toggle {
359
- position: absolute;
360
- left: -40px;
361
- top: 1rem;
362
- background: #4299e1;
363
- color: #fff;
364
- border: none;
365
- padding: 0.5rem;
366
- border-radius: 0.25rem 0 0 0.25rem;
367
- cursor: pointer;
368
- font-size: 1rem;
369
- }
370
-
371
- .event-log-content {
372
- flex: 1;
373
- display: flex;
374
- flex-direction: column;
375
- }
376
-
377
- .event-log-filters {
378
- padding: 1rem;
379
- background: #f7fafc;
380
- border-bottom: 1px solid #e2e8f0;
381
- display: flex;
382
- gap: 1rem;
383
- align-items: center;
384
- flex-wrap: wrap;
385
- }
386
-
387
- .event-log-filters label {
388
- display: flex;
389
- align-items: center;
390
- gap: 0.25rem;
391
- font-size: 0.875rem;
392
- }
393
-
394
- .event-log-list {
395
- flex: 1;
396
- overflow-y: auto;
397
- padding: 1rem;
398
- }
399
-
400
- .event-entry {
401
- background: #f8fafc;
402
- border-left: 3px solid #cbd5e0;
403
- padding: 0.75rem;
404
- margin-bottom: 0.5rem;
405
- border-radius: 0 0.25rem 0.25rem 0;
406
- font-size: 0.875rem;
407
- }
408
-
409
- .event-entry.info {
410
- border-left-color: #4299e1;
411
- }
412
-
413
- .event-entry.warn {
414
- border-left-color: #ed8936;
415
- }
416
-
417
- .event-entry.error {
418
- border-left-color: #f56565;
419
- }
420
-
421
- .event-time {
422
- color: #718096;
423
- font-size: 0.75rem;
424
- margin-bottom: 0.25rem;
425
- }
426
-
427
- .event-message {
428
- color: #2d3748;
429
- }
430
-
431
- /* Toast notifications */
432
- .toast-container {
433
- position: fixed;
434
- top: 1rem;
435
- right: 1rem;
436
- z-index: 1000;
437
- display: flex;
438
- flex-direction: column;
439
- gap: 0.5rem;
440
- }
441
-
442
- .toast {
443
- background: #fff;
444
- border-left: 4px solid #4299e1;
445
- border-radius: 0.5rem;
446
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
447
- padding: 1rem;
448
- min-width: 300px;
449
- max-width: 400px;
450
- animation: slideIn 0.3s ease;
451
- }
452
-
453
- .toast.success {
454
- border-left-color: #48bb78;
455
- }
456
-
457
- .toast.error {
458
- border-left-color: #f56565;
459
- }
460
-
461
- .toast.warning {
462
- border-left-color: #ed8936;
463
- }
464
-
465
- @keyframes slideIn {
466
- from {
467
- transform: translateX(100%);
468
- opacity: 0;
469
- }
470
- to {
471
- transform: translateX(0);
472
- opacity: 1;
473
- }
474
- }
475
-
476
- @keyframes slideOut {
477
- from {
478
- transform: translateX(0);
479
- opacity: 1;
480
- }
481
- to {
482
- transform: translateX(100%);
483
- opacity: 0;
484
- }
485
- }
486
-
487
- /* Progress bar */
488
- .progress-bar {
489
- width: 100%;
490
- height: 8px;
491
- background: #e2e8f0;
492
- border-radius: 4px;
493
- overflow: hidden;
494
- margin: 0.5rem 0;
495
- }
496
-
497
- .progress-fill {
498
- height: 100%;
499
- background: #4299e1;
500
- transition: width 0.3s ease;
501
- border-radius: 4px;
502
- }
503
-
504
- /* Code blocks */
505
- .code-block {
506
- background: #1a202c;
507
- color: #e2e8f0;
508
- padding: 1rem;
509
- border-radius: 0.5rem;
510
- font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
511
- font-size: 0.875rem;
512
- overflow-x: auto;
513
- margin: 1rem 0;
514
- }
515
-
516
- /* Responsive design */
517
- @media (max-width: 768px) {
518
- .sidebar {
519
- width: 200px;
520
- }
521
-
522
- .content {
523
- padding: 1rem;
524
- }
525
-
526
- .header-content {
527
- padding: 1rem;
528
- }
529
-
530
- .search-input {
531
- width: 150px;
532
- }
533
- }
534
-
535
- /* Hidden class */
536
- .hidden {
537
- display: none !important;
538
- }
@@ -1,103 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Electrobun Interactive Playground</title>
7
- <link rel="stylesheet" href="views://mainview/index.css">
8
- </head>
9
- <body>
10
- <div class="app">
11
- <!-- Header -->
12
- <header class="header">
13
- <div class="header-content">
14
- <h1 class="header-title">
15
- <span class="logo">⚡</span>
16
- Electrobun Interactive Playground
17
- </h1>
18
- <div class="header-actions">
19
- <div class="search-container">
20
- <input type="text" id="search" placeholder="Search features..." class="search-input">
21
- <span class="search-icon">🔍</span>
22
- </div>
23
- </div>
24
- </div>
25
- </header>
26
-
27
- <div class="main-content">
28
- <!-- Sidebar -->
29
- <aside class="sidebar">
30
- <nav class="nav">
31
- <div class="nav-section">
32
- <h3 class="nav-section-title">Core Features</h3>
33
- <ul class="nav-list">
34
- <li class="nav-item active" data-demo="windows">
35
- <span class="nav-icon">🪟</span>
36
- <span class="nav-label">Windows</span>
37
- </li>
38
- <li class="nav-item" data-demo="webviews">
39
- <span class="nav-icon">🌐</span>
40
- <span class="nav-label">WebViews</span>
41
- </li>
42
- <li class="nav-item" data-demo="rpc">
43
- <span class="nav-icon">📡</span>
44
- <span class="nav-label">RPC</span>
45
- </li>
46
- <li class="nav-item" data-demo="menus">
47
- <span class="nav-icon">🎛️</span>
48
- <span class="nav-label">Menus</span>
49
- </li>
50
- </ul>
51
- </div>
52
-
53
- <div class="nav-section">
54
- <h3 class="nav-section-title">System Integration</h3>
55
- <ul class="nav-list">
56
- <li class="nav-item" data-demo="tray">
57
- <span class="nav-icon">🔔</span>
58
- <span class="nav-label">System Tray</span>
59
- </li>
60
- <li class="nav-item" data-demo="files">
61
- <span class="nav-icon">🗂️</span>
62
- <span class="nav-label">File Operations</span>
63
- </li>
64
- </ul>
65
- </div>
66
-
67
- </nav>
68
- </aside>
69
-
70
- <!-- Content Area -->
71
- <main class="content">
72
- <div id="demo-content" class="demo-content">
73
- <!-- Demo content will be dynamically loaded here -->
74
- </div>
75
- </main>
76
- </div>
77
-
78
- <!-- Toast notifications -->
79
- <div id="toast-container" class="toast-container"></div>
80
-
81
- <!-- Event log sidebar (collapsible) -->
82
- <div class="event-log" id="event-log">
83
- <div class="event-log-header">
84
- <h3>Event Log</h3>
85
- <button class="event-log-toggle" id="event-log-toggle">📋</button>
86
- </div>
87
- <div class="event-log-content" id="event-log-content">
88
- <div class="event-log-filters">
89
- <label><input type="checkbox" checked data-level="info"> Info</label>
90
- <label><input type="checkbox" checked data-level="warn"> Warn</label>
91
- <label><input type="checkbox" checked data-level="error"> Error</label>
92
- <button id="clear-log">Clear</button>
93
- </div>
94
- <div class="event-log-list" id="event-log-list">
95
- <!-- Event log entries will be added here -->
96
- </div>
97
- </div>
98
- </div>
99
- </div>
100
-
101
- <script src="views://mainview/index.js"></script>
102
- </body>
103
- </html>