@tomorrowos/sdk 0.2.5 → 0.3.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.
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/playlist-catalog.d.ts +35 -0
- package/dist/playlist-catalog.d.ts.map +1 -0
- package/dist/playlist-catalog.js +133 -0
- package/dist/store/memory-store.d.ts +9 -1
- package/dist/store/memory-store.d.ts.map +1 -1
- package/dist/store/memory-store.js +35 -0
- package/dist/store/types.d.ts +41 -0
- package/dist/store/types.d.ts.map +1 -1
- package/dist/tomorrowos.d.ts +14 -0
- package/dist/tomorrowos.d.ts.map +1 -1
- package/dist/tomorrowos.js +136 -0
- package/package.json +1 -1
- package/templates/cms-starter/public/index.html +42 -14
- package/templates/cms-starter/public/methods.js +451 -372
- package/templates/cms-starter/public/panel.css +130 -1
- package/templates/cms-starter/server.ts +7 -0
|
@@ -39,8 +39,58 @@ body {
|
|
|
39
39
|
overflow: auto;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
.panel-playlist-nav {
|
|
43
|
+
width: 220px;
|
|
44
|
+
flex-shrink: 0;
|
|
45
|
+
background: #fff;
|
|
46
|
+
border-right: 1px solid #e4e1dc;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
padding: 0.75rem;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.playlist-nav-header {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: space-between;
|
|
56
|
+
margin-bottom: 0.5rem;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.playlist-nav-header h2 {
|
|
60
|
+
margin: 0;
|
|
61
|
+
font-size: 0.95rem;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.playlist-catalog {
|
|
65
|
+
list-style: none;
|
|
66
|
+
margin: 0;
|
|
67
|
+
padding: 0;
|
|
68
|
+
overflow: auto;
|
|
69
|
+
flex: 1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.playlist-catalog-item {
|
|
73
|
+
border: 1px solid #e4e1dc;
|
|
74
|
+
border-radius: 6px;
|
|
75
|
+
padding: 0.5rem 0.6rem;
|
|
76
|
+
margin-bottom: 0.4rem;
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
font-size: 0.85rem;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.playlist-catalog-item--active {
|
|
82
|
+
border-color: #ff8a3d;
|
|
83
|
+
background: #fff5ee;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.playlist-catalog-item small {
|
|
87
|
+
display: block;
|
|
88
|
+
color: #666;
|
|
89
|
+
margin-top: 0.2rem;
|
|
90
|
+
}
|
|
91
|
+
|
|
42
92
|
.panel-playlist {
|
|
43
|
-
width:
|
|
93
|
+
width: 300px;
|
|
44
94
|
flex-shrink: 0;
|
|
45
95
|
background: #fff;
|
|
46
96
|
border-left: 1px solid #e4e1dc;
|
|
@@ -327,3 +377,82 @@ button.danger {
|
|
|
327
377
|
.hidden {
|
|
328
378
|
display: none !important;
|
|
329
379
|
}
|
|
380
|
+
|
|
381
|
+
.field-label {
|
|
382
|
+
display: block;
|
|
383
|
+
margin-bottom: 0.75rem;
|
|
384
|
+
font-size: 0.85rem;
|
|
385
|
+
font-weight: 600;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.field-label input {
|
|
389
|
+
display: block;
|
|
390
|
+
width: 100%;
|
|
391
|
+
margin-top: 0.35rem;
|
|
392
|
+
font-weight: 400;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.subheading {
|
|
396
|
+
margin: 0.5rem 0 0.35rem;
|
|
397
|
+
font-size: 0.9rem;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.editor-actions {
|
|
401
|
+
display: flex;
|
|
402
|
+
flex-wrap: wrap;
|
|
403
|
+
gap: 0.5rem;
|
|
404
|
+
margin-top: 0.75rem;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.device-published-list {
|
|
408
|
+
margin: 0 0 0.65rem;
|
|
409
|
+
padding: 0;
|
|
410
|
+
list-style: none;
|
|
411
|
+
font-size: 0.78rem;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.device-published-list li {
|
|
415
|
+
display: flex;
|
|
416
|
+
align-items: center;
|
|
417
|
+
justify-content: space-between;
|
|
418
|
+
gap: 0.35rem;
|
|
419
|
+
margin-bottom: 0.25rem;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.modal {
|
|
423
|
+
position: fixed;
|
|
424
|
+
inset: 0;
|
|
425
|
+
z-index: 1000;
|
|
426
|
+
display: flex;
|
|
427
|
+
align-items: center;
|
|
428
|
+
justify-content: center;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.modal-backdrop {
|
|
432
|
+
position: absolute;
|
|
433
|
+
inset: 0;
|
|
434
|
+
background: rgba(0, 0, 0, 0.45);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.modal-card {
|
|
438
|
+
position: relative;
|
|
439
|
+
background: #fff;
|
|
440
|
+
border-radius: 10px;
|
|
441
|
+
padding: 1.25rem;
|
|
442
|
+
width: min(92vw, 420px);
|
|
443
|
+
max-height: 80vh;
|
|
444
|
+
overflow: auto;
|
|
445
|
+
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.publish-checklist label {
|
|
449
|
+
display: block;
|
|
450
|
+
margin-bottom: 0.45rem;
|
|
451
|
+
font-size: 0.9rem;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.modal-actions {
|
|
455
|
+
display: flex;
|
|
456
|
+
gap: 0.5rem;
|
|
457
|
+
margin-top: 1rem;
|
|
458
|
+
}
|
|
@@ -25,6 +25,13 @@ tomorrowos.on("device.paired", (event) => {
|
|
|
25
25
|
|
|
26
26
|
tomorrowos.on("device.online", (event) => {
|
|
27
27
|
console.log(`[TomorrowOS] device online: ${event.deviceId}`);
|
|
28
|
+
void tomorrowos.pushLatestPolicyToDevice(event.deviceId).then((r) => {
|
|
29
|
+
if (r.pushed) {
|
|
30
|
+
console.log(`[TomorrowOS] pushed latest policy to ${event.deviceId}`);
|
|
31
|
+
}
|
|
32
|
+
}).catch((err) => {
|
|
33
|
+
console.error(`[TomorrowOS] latest policy push failed for ${event.deviceId}:`, err);
|
|
34
|
+
});
|
|
28
35
|
});
|
|
29
36
|
|
|
30
37
|
tomorrowos.on("device.offline", (event) => {
|