@soba-so/react 0.0.13 → 0.0.15

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/session.d.ts CHANGED
@@ -49,6 +49,9 @@ export declare class SessionHolder {
49
49
  ensure(): Promise<string>;
50
50
  refresh(): Promise<string>;
51
51
  }
52
+ export declare function sharedHolder(options: SessionSourceOptions): SessionHolder;
53
+ export declare function retainHolder(holder: SessionHolder): void;
54
+ export declare function releaseHolder(holder: SessionHolder): void;
52
55
  /**
53
56
  * A `fetch` that heals a dead session.
54
57
  *
package/dist/styles.css CHANGED
@@ -12,6 +12,10 @@
12
12
  --sc-ok: #22a06b;
13
13
  --sc-warn: #b06f14;
14
14
 
15
+ --sc-tray: var(--sc-raised, #f6f6f7);
16
+ --sc-tray-card: var(--sc-sheet, #ffffff);
17
+ --sc-tray-sunk: var(--sc-raised, #f6f6f7);
18
+
15
19
  --sc-font-size: 15px;
16
20
  --sc-fs-label: max(11px, calc(var(--sc-font-size) * 0.77));
17
21
 
@@ -239,121 +243,182 @@ a.sc-btn {
239
243
  min-width: 92px;
240
244
  }
241
245
 
242
- .sc-machine {
243
- border-top: 1px solid var(--sc-line, #e9e9eb);
244
- padding-top: 12px;
245
- margin-top: 12px;
246
+ .sc-tray {
247
+ display: grid;
248
+ gap: 8px;
249
+ padding: 6px;
250
+ border-radius: 18px;
251
+ background: var(--sc-tray, #f6f6f7);
246
252
  }
247
- .sc-machine:first-child {
248
- border-top: 0;
249
- padding-top: 0;
250
- margin-top: 0;
253
+
254
+ .sc-group {
255
+ min-width: 0;
251
256
  }
252
257
 
253
- .sc-machine-meta {
258
+ .sc-group-cap {
254
259
  display: flex;
255
- flex-wrap: wrap;
256
260
  align-items: center;
257
- gap: 3px 10px;
258
-
259
- margin-top: 1px;
260
- font-size: var(--sc-fs-small);
261
- line-height: 1.35;
262
- color: var(--sc-muted, #6b6b73);
261
+ gap: 4px;
262
+ min-height: 24px;
263
+ padding: 0 2px 3px 12px;
263
264
  }
264
265
 
265
- .sc-machine-tag {
266
+ .sc-group-title {
267
+ flex: 1;
268
+ min-width: 0;
269
+ margin: 0;
270
+ overflow: hidden;
271
+ text-overflow: ellipsis;
272
+ white-space: nowrap;
266
273
  font-size: var(--sc-fs-label);
267
- font-weight: 600;
268
- padding: 1px 6px;
269
- border-radius: var(--sc-r-sm, 6px);
270
- background: var(--sc-raised, #f6f6f7);
274
+ letter-spacing: 0;
275
+ color: var(--sc-muted, #6b6b73);
271
276
  }
272
277
 
273
- .sc-machine-state {
274
- display: inline-flex;
275
- align-items: center;
276
- gap: 6px;
277
- font-size: var(--sc-fs-small);
278
- color: var(--sc-muted, #6b6b73);
279
- white-space: nowrap;
278
+ .sc-group-card {
279
+ padding: 6px 0 6px 12px;
280
+ border-radius: var(--sc-r-lg, 14px);
281
+ background: var(--sc-tray-card, #ffffff);
282
+ box-shadow: var(--sc-shadow-1);
280
283
  }
281
284
 
282
- .sc-runtimes {
285
+ .sc-disc {
286
+ flex: none;
283
287
  display: grid;
284
- gap: 2px;
285
- margin: 12px 0 0;
286
-
287
- --sc-branch: calc(var(--sc-tile, 32px) + 11px);
288
- padding: 0 0 0 var(--sc-branch);
289
- list-style: none;
290
- font-size: var(--sc-fs-small);
288
+ place-items: center;
289
+ width: 26px;
290
+ height: 26px;
291
+ padding: 0;
292
+ border: 0;
293
+ border-radius: 50%;
294
+ background: var(--sc-tray-card, #ffffff);
295
+ box-shadow: var(--sc-shadow-1);
296
+ color: var(--sc-muted, #6b6b73);
297
+ cursor: pointer;
298
+ transition: color 120ms ease;
291
299
  }
292
300
 
293
- .sc-compute-act {
294
- margin-top: 16px;
301
+ .sc-disc:hover:not(:disabled) {
302
+ color: var(--sc-text, #1a1a1c);
295
303
  }
296
304
 
297
- .sc-compute-act:first-child {
298
- margin-top: 0;
305
+ .sc-disc:disabled {
306
+ opacity: 0.6;
307
+ cursor: default;
299
308
  }
300
309
 
301
- .sc-note + .sc-compute-act,
302
- .sc-error + .sc-compute-act {
303
- margin-top: 9px;
310
+ .sc-dglyph {
311
+ width: 13px;
312
+ height: 13px;
313
+ }
314
+
315
+ @keyframes sc-spin {
316
+ to {
317
+ transform: rotate(360deg);
318
+ }
319
+ }
320
+
321
+ .sc-spin {
322
+ animation: sc-spin 900ms linear infinite;
304
323
  }
305
324
 
306
- .sc-runtime {
325
+ .sc-mrow {
326
+ display: flex;
327
+ align-items: center;
328
+ gap: 10px;
329
+ min-height: 52px;
330
+ padding: 4px 12px 4px 0;
331
+ }
332
+
333
+ .sc-mtile {
307
334
  position: relative;
335
+ flex: none;
308
336
  display: grid;
309
- grid-template-columns: auto 1fr auto;
310
- align-items: center;
311
- gap: 9px;
312
- min-height: 26px;
337
+ place-items: center;
338
+ width: 38px;
339
+ height: 38px;
340
+ border-radius: 12px;
341
+ background: var(--sc-tray-sunk, #f6f6f7);
342
+ box-shadow: inset 0 0 0 1px var(--sc-line, #e9e9eb);
343
+ color: var(--sc-text, #1a1a1c);
313
344
  }
314
345
 
315
- .sc-runtime::before {
316
- content: "";
346
+ .sc-mglyph {
347
+ width: 24px;
348
+ height: 18px;
349
+ }
350
+
351
+ .sc-mbadge {
317
352
  position: absolute;
318
- left: calc(var(--sc-tile, 32px) / 2 - var(--sc-branch));
319
- top: -2px;
320
- bottom: -2px;
321
- width: 1px;
353
+ right: 0;
354
+ bottom: 0;
355
+ width: 10px;
356
+ height: 10px;
357
+ border-radius: 50%;
358
+ transform: translate(30%, 30%);
359
+ box-shadow: 0 0 0 2.5px var(--sc-tray-card, #ffffff);
360
+ }
361
+
362
+ .sc-mbadge-ok {
363
+ background: var(--sc-ok, #22a06b);
364
+ }
365
+
366
+ .sc-mbadge-busy {
367
+ background: var(--sc-warn, #b06f14);
368
+ }
369
+
370
+ .sc-mbadge-off {
322
371
  background: var(--sc-line-2, #dcdce0);
323
372
  }
324
373
 
325
- .sc-runtime:first-child::before {
326
- top: -13px;
374
+ .sc-mid {
375
+ display: flex;
376
+ flex: 1;
377
+ min-width: 0;
378
+ flex-direction: column;
379
+ gap: 1px;
327
380
  }
328
381
 
329
- .sc-runtime:last-child::before {
330
- bottom: auto;
331
- height: calc(50% + 2px);
382
+ .sc-mname {
383
+ overflow: hidden;
384
+ text-overflow: ellipsis;
385
+ white-space: nowrap;
386
+ font-size: var(--sc-fs-small);
387
+ font-weight: 550;
332
388
  }
333
389
 
334
- .sc-runtime:first-child:last-child::before {
335
- height: calc(50% + 13px);
390
+ .sc-mmeta {
391
+ display: flex;
392
+ flex-wrap: wrap;
393
+ align-items: center;
394
+ gap: 1px 6px;
395
+ font-size: var(--sc-fs-label);
396
+ line-height: 1.35;
397
+ color: var(--sc-muted, #6b6b73);
336
398
  }
337
399
 
338
- .sc-runtime::after {
339
- content: "";
340
- position: absolute;
341
- left: calc(var(--sc-tile, 32px) / 2 - var(--sc-branch));
342
- top: 50%;
343
- width: 22px;
344
- height: 1px;
345
- background: var(--sc-line-2, #dcdce0);
400
+ .sc-mmeta-sep {
401
+ padding-right: 6px;
402
+ color: var(--sc-line-2, #dcdce0);
403
+ }
404
+
405
+ .sc-arow {
406
+ display: flex;
407
+ align-items: center;
408
+ gap: 10px;
409
+ min-height: 30px;
410
+ padding-right: 12px;
346
411
  }
347
412
 
348
413
  .sc-runtime-tile {
349
- width: 22px;
350
- height: 22px;
351
414
  flex: none;
352
415
  display: grid;
353
416
  place-items: center;
417
+ width: 22px;
418
+ height: 22px;
354
419
  border-radius: var(--sc-r-sm, 6px);
355
420
  border: 1px solid var(--sc-line, #e9e9eb);
356
- background: var(--sc-raised, #f6f6f7);
421
+ background: var(--sc-tray-sunk, #f6f6f7);
357
422
  }
358
423
 
359
424
  .sc-runtime-mark {
@@ -362,16 +427,200 @@ a.sc-btn {
362
427
  color: var(--sc-text-2, #3f3f46);
363
428
  }
364
429
 
365
- .sc-runtime-verdict {
430
+ .sc-aname {
431
+ flex: 1;
432
+ min-width: 0;
433
+ overflow: hidden;
434
+ text-overflow: ellipsis;
435
+ white-space: nowrap;
436
+ font-size: var(--sc-fs-small);
437
+ }
438
+
439
+ .sc-aversion {
440
+ color: var(--sc-muted, #6b6b73);
441
+ }
442
+
443
+ .sc-averdict {
444
+ flex: none;
445
+ display: inline-flex;
446
+ align-items: center;
366
447
  font-size: var(--sc-fs-label);
367
448
  white-space: nowrap;
449
+ color: var(--sc-muted, #6b6b73);
450
+ }
451
+
452
+ .sc-orow {
453
+ display: flex;
454
+ align-items: center;
455
+ gap: 10px;
456
+ min-height: 34px;
457
+ padding-right: 12px;
458
+ }
459
+
460
+ .sc-otile {
461
+ flex: none;
462
+ display: grid;
463
+ place-items: center;
464
+ width: 22px;
465
+ height: 22px;
466
+ border-radius: var(--sc-r-sm, 6px);
467
+ background: var(--sc-tray-sunk, #f6f6f7);
468
+ color: var(--sc-muted, #6b6b73);
469
+ }
470
+
471
+ .sc-otile .sc-mglyph {
472
+ width: 15px;
473
+ height: 11px;
474
+ }
475
+
476
+ .sc-oglyph,
477
+ .sc-omark {
478
+ width: 13px;
479
+ height: 13px;
368
480
  }
369
481
 
370
- .sc-runtime-name {
482
+ .sc-oname {
483
+ flex: 1;
371
484
  min-width: 0;
372
485
  overflow: hidden;
373
486
  text-overflow: ellipsis;
374
487
  white-space: nowrap;
488
+ font-size: var(--sc-fs-small);
489
+ color: var(--sc-text-2, #3f3f46);
490
+ }
491
+
492
+ .sc-oword {
493
+ flex: none;
494
+ font-size: var(--sc-fs-label);
495
+ color: var(--sc-muted, #6b6b73);
496
+ }
497
+
498
+ .sc-pair {
499
+ display: flex;
500
+ align-items: center;
501
+ gap: 10px;
502
+ width: calc(100% + 4px);
503
+ min-height: 34px;
504
+ margin-left: -4px;
505
+ padding: 0 12px 0 4px;
506
+ border: 0;
507
+ border-radius: 8px;
508
+ background: transparent;
509
+ font: inherit;
510
+ font-size: var(--sc-fs-small);
511
+ text-align: left;
512
+ cursor: pointer;
513
+ transition: background-color 120ms ease;
514
+ }
515
+
516
+ .sc-pair:hover {
517
+ background: var(--sc-tray-sunk, #f6f6f7);
518
+ }
519
+
520
+ .sc-hrow {
521
+ padding-bottom: 2px;
522
+ }
523
+
524
+ .sc-row-note {
525
+ margin: 0;
526
+ padding: 2px 12px 4px 0;
527
+ font-size: var(--sc-fs-label);
528
+ line-height: 1.45;
529
+ color: var(--sc-muted, #6b6b73);
530
+ }
531
+
532
+ .sc-row-act {
533
+ flex: none;
534
+ padding: 3px 9px;
535
+ border: 1px solid transparent;
536
+ border-radius: var(--sc-r-pill, 999px);
537
+ background: var(--sc-tray-sunk, #f6f6f7);
538
+ font: inherit;
539
+ font-size: var(--sc-fs-label);
540
+ font-weight: 500;
541
+ color: var(--sc-text-2, #3f3f46);
542
+ cursor: pointer;
543
+ white-space: nowrap;
544
+ }
545
+
546
+ .sc-row-act:hover:not(:disabled) {
547
+ color: var(--sc-text, #1a1a1c);
548
+ }
549
+
550
+ .sc-row-act:disabled {
551
+ opacity: 0.5;
552
+ cursor: default;
553
+ }
554
+
555
+ .sc-tray-error {
556
+ margin: 0;
557
+ padding: 0 12px 2px;
558
+ }
559
+
560
+ .sc-pop {
561
+ position: fixed;
562
+ top: 0;
563
+ left: 0;
564
+ right: auto;
565
+ bottom: auto;
566
+ z-index: 2147483000;
567
+ width: min(92vw, 320px);
568
+ max-width: min(92vw, 320px);
569
+
570
+ max-height: calc(100vh - 24px);
571
+ overflow-y: auto;
572
+ overscroll-behavior: contain;
573
+ margin: 0;
574
+ padding: 0;
575
+ border: 0;
576
+ border-radius: 20px;
577
+ background: var(--sc-tray, #f6f6f7);
578
+
579
+ box-shadow:
580
+ 0 0 0 1px var(--sc-line, #e9e9eb),
581
+ var(--sc-shadow-2);
582
+ }
583
+
584
+ .sc-pop > .sc-tray {
585
+ background: transparent;
586
+ border-radius: inherit;
587
+ }
588
+
589
+ @keyframes sc-pop-in {
590
+ from {
591
+ opacity: 0;
592
+ transform: translateY(-6px) scale(0.98);
593
+ }
594
+ }
595
+
596
+ .sc-pop {
597
+ animation: sc-pop-in 120ms cubic-bezier(0.2, 0.8, 0.2, 1);
598
+ transform-origin: top right;
599
+ }
600
+
601
+ @media (prefers-reduced-motion: reduce) {
602
+ .sc-pop {
603
+ animation: none;
604
+ }
605
+ .sc-spin {
606
+ animation: none;
607
+ }
608
+ .sc-pair {
609
+ transition: none;
610
+ }
611
+ }
612
+
613
+ .sc-compute-act {
614
+ margin-top: 16px;
615
+ }
616
+
617
+ .sc-compute-act:first-child {
618
+ margin-top: 0;
619
+ }
620
+
621
+ .sc-note + .sc-compute-act,
622
+ .sc-error + .sc-compute-act {
623
+ margin-top: 9px;
375
624
  }
376
625
 
377
626
  .soba-connect[data-theme="dark"],
@@ -398,6 +647,10 @@ a.sc-btn {
398
647
  --sc-ok: #4cb782;
399
648
  --sc-warn: #f2994a;
400
649
 
650
+ --sc-tray: var(--sc-ground, #0f0f11);
651
+ --sc-tray-card: var(--sc-raised, #1d1d20);
652
+ --sc-tray-sunk: var(--sc-sheet, #161618);
653
+
401
654
  --sc-shadow-1: 0 1px 2px rgb(0 0 0 / 34%);
402
655
  --sc-shadow-2: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px -12px rgb(0 0 0 / 64%);
403
656
  }
@@ -419,6 +672,10 @@ a.sc-btn {
419
672
  --sc-ok: #4cb782;
420
673
  --sc-warn: #f2994a;
421
674
 
675
+ --sc-tray: var(--sc-ground, #0f0f11);
676
+ --sc-tray-card: var(--sc-raised, #1d1d20);
677
+ --sc-tray-sunk: var(--sc-sheet, #161618);
678
+
422
679
  --sc-shadow-1: 0 1px 2px rgb(0 0 0 / 34%);
423
680
  --sc-shadow-2: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px -12px rgb(0 0 0 / 64%);
424
681
  }
@@ -756,22 +1013,6 @@ a.sc-btn {
756
1013
  box-shadow: none;
757
1014
  }
758
1015
 
759
- .sc-modal-sheet .sc-machine {
760
- border: 1px solid var(--sc-line, #e9e9eb);
761
- border-radius: var(--sc-r, 10px);
762
- padding: 11px 12px;
763
- margin-top: 14px;
764
- }
765
-
766
- .sc-conns {
767
- display: grid;
768
- gap: 14px;
769
- }
770
-
771
- .sc-modal-sheet .sc-machine:first-child {
772
- margin-top: 0;
773
- }
774
-
775
1016
  .sc-modal-sheet .sc-title {
776
1017
  font-size: 17px;
777
1018
  font-weight: 600;
@@ -1011,51 +1252,6 @@ a.sc-btn {
1011
1252
  color: var(--sc-text, #1a1a1c);
1012
1253
  }
1013
1254
 
1014
- .sc-conn,
1015
- .sc-idrow {
1016
- display: grid;
1017
- grid-template-columns: auto 1fr auto;
1018
- align-items: center;
1019
- gap: 12px;
1020
- }
1021
-
1022
- .sc-conn {
1023
- padding: 10px 12px;
1024
- border: 1px solid var(--sc-line, #e9e9eb);
1025
- border-radius: var(--sc-r, 10px);
1026
- background: var(--sc-sheet, #ffffff);
1027
- }
1028
-
1029
- .sc-conn-note {
1030
- grid-column: 1 / -1;
1031
- margin: 2px 0 0;
1032
- font-size: 12px;
1033
- line-height: 1.4;
1034
- color: var(--sc-muted, #6b6b73);
1035
- }
1036
-
1037
- .sc-conn-action {
1038
- font: inherit;
1039
- font-size: var(--sc-fs-small);
1040
- font-weight: 500;
1041
- padding: 5px 9px;
1042
- border: 1px solid transparent;
1043
- border-radius: var(--sc-r-sm, 6px);
1044
- background: transparent;
1045
- color: var(--sc-muted, #6b6b73);
1046
- cursor: pointer;
1047
- }
1048
-
1049
- .sc-conn-action:hover:not(:disabled) {
1050
- border-color: var(--sc-line-2, #dcdce0);
1051
- color: var(--sc-text, #1a1a1c);
1052
- }
1053
-
1054
- .sc-conn-action:disabled {
1055
- opacity: 0.5;
1056
- cursor: default;
1057
- }
1058
-
1059
1255
  .sc-btn-wide {
1060
1256
  width: 100%;
1061
1257
  }
@@ -1324,7 +1520,9 @@ a.sc-btn {
1324
1520
  .sc-step-lead:focus-visible,
1325
1521
  .sc-step-links a:focus-visible,
1326
1522
  .sc-alt-link:focus-visible,
1327
- .sc-conn-action:focus-visible,
1523
+ .sc-row-act:focus-visible,
1524
+ .sc-disc:focus-visible,
1525
+ .sc-pair:focus-visible,
1328
1526
  .sc-input:focus-visible,
1329
1527
  .sc-modal-close:focus-visible {
1330
1528
  outline: 2px solid var(--sc-accent, #18181b);
@@ -1375,7 +1573,7 @@ a.sc-btn {
1375
1573
  max-width: 100%;
1376
1574
  min-width: 0;
1377
1575
 
1378
- padding: 4px 13px 4px 4px;
1576
+ padding: 3px 12px 3px 3px;
1379
1577
  border-radius: var(--sc-r-pill, 999px);
1380
1578
  border-color: var(--sc-line, #e9e9eb);
1381
1579
 
@@ -1399,14 +1597,33 @@ a.sc-btn {
1399
1597
  transform: translateY(0.5px);
1400
1598
  }
1401
1599
 
1402
- .sc-btn-connected .sc-runtime-tile {
1600
+ .sc-pill-tile {
1601
+ flex: none;
1602
+ display: grid;
1603
+ place-items: center;
1604
+ width: 26px;
1605
+ height: 26px;
1403
1606
  border-radius: 50%;
1607
+ background: var(--sc-raised, #f6f6f7);
1608
+ box-shadow: inset 0 0 0 1px var(--sc-line, #e9e9eb);
1609
+ color: var(--sc-text, #1a1a1c);
1404
1610
  }
1405
1611
 
1406
- .sc-btn-connected:hover .sc-runtime-tile {
1612
+ .sc-btn-connected:hover .sc-pill-tile {
1407
1613
  background: var(--sc-sheet, #ffffff);
1408
1614
  }
1409
1615
 
1616
+ .sc-pill-mark {
1617
+ width: 16px;
1618
+ height: 16px;
1619
+ }
1620
+
1621
+ @media (prefers-reduced-motion: no-preference) {
1622
+ .sc-pill-mark-busy {
1623
+ animation: sc-spin 2400ms linear infinite;
1624
+ }
1625
+ }
1626
+
1410
1627
  .sc-btn-connected .sc-dot {
1411
1628
  flex: none;
1412
1629
  margin-left: 1px;
@@ -1538,6 +1755,36 @@ a.sc-btn {
1538
1755
  min-width: 0;
1539
1756
  }
1540
1757
 
1758
+ .sc-nudge {
1759
+ position: relative;
1760
+ }
1761
+ .sc-nudge-dismiss {
1762
+ position: absolute;
1763
+ top: 7px;
1764
+ right: 8px;
1765
+ display: grid;
1766
+ place-items: center;
1767
+ width: 28px;
1768
+ height: 28px;
1769
+ padding: 0;
1770
+ border: 0;
1771
+ border-radius: 999px;
1772
+ background: none;
1773
+ color: var(--sc-muted, #6b6b73);
1774
+ cursor: pointer;
1775
+ transition:
1776
+ background-color 0.12s,
1777
+ color 0.12s;
1778
+ }
1779
+ .sc-nudge-dismiss:hover {
1780
+ background: var(--sc-raised, #f6f6f7);
1781
+ color: var(--sc-text, #1a1a1c);
1782
+ }
1783
+ .sc-nudge-x {
1784
+ width: 14px;
1785
+ height: 14px;
1786
+ }
1787
+
1541
1788
  .sc-nudge > .sc-btn {
1542
1789
  grid-column: 2;
1543
1790
  align-self: end;
@@ -2277,6 +2524,18 @@ li.sc-plan-row.sc-plan-current {
2277
2524
  color: var(--sc-muted, #6b6b73);
2278
2525
  }
2279
2526
 
2527
+ .sc-run-error {
2528
+ border-color: color-mix(in srgb, var(--sc-warn, #b06f14) 28%, var(--sc-line, #e9e9eb));
2529
+ }
2530
+ .sc-run-error-mark {
2531
+ background: color-mix(in srgb, var(--sc-warn, #b06f14) 12%, var(--sc-raised, #f6f6f7));
2532
+ color: var(--sc-warn, #b06f14);
2533
+ }
2534
+
2535
+ .sc-run-error-message {
2536
+ overflow-wrap: anywhere;
2537
+ }
2538
+
2280
2539
  .sc-modal-sheet .sc-limit-head {
2281
2540
  flex-direction: column;
2282
2541
  align-items: center;
@@ -2362,13 +2621,13 @@ li.sc-plan-row.sc-plan-current {
2362
2621
  }
2363
2622
  }
2364
2623
 
2365
- .sc-modal-sheet .sc-machine {
2624
+ .sc-modal-sheet .sc-tray {
2366
2625
  animation: sc-arrive 200ms cubic-bezier(0.2, 0.8, 0.2, 1) 60ms both;
2367
2626
  }
2368
2627
 
2369
2628
  @media (prefers-reduced-motion: reduce) {
2370
2629
  .sc-modal-sheet .sc-card,
2371
- .sc-modal-sheet .sc-machine {
2630
+ .sc-modal-sheet .sc-tray {
2372
2631
  animation: none;
2373
2632
  }
2374
2633
  .sc-modal-sheet {