@liberation-data/desk 0.14.0 → 0.16.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/README.md +70 -7
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/look.d.ts +12 -0
- package/dist/core/look.d.ts.map +1 -0
- package/dist/core/look.js +26 -0
- package/dist/core/look.js.map +1 -0
- package/dist/css/conversation.css +21 -0
- package/dist/css/dock.css +123 -3
- package/dist/css/looks.css +258 -0
- package/dist/css/tokens.css +5 -1
- package/dist/desk.css +408 -4
- package/dist/fx/fx.d.ts +29 -0
- package/dist/fx/fx.d.ts.map +1 -0
- package/dist/fx/fx.js +119 -0
- package/dist/fx/fx.js.map +1 -0
- package/dist/fx/index.d.ts +7 -0
- package/dist/fx/index.d.ts.map +1 -0
- package/dist/fx/index.js +4 -0
- package/dist/fx/index.js.map +1 -0
- package/dist/fx/measure.d.ts +18 -0
- package/dist/fx/measure.d.ts.map +1 -0
- package/dist/fx/measure.js +37 -0
- package/dist/fx/measure.js.map +1 -0
- package/dist/fx/sounds.d.ts +108 -0
- package/dist/fx/sounds.d.ts.map +1 -0
- package/dist/fx/sounds.js +148 -0
- package/dist/fx/sounds.js.map +1 -0
- package/dist/react/Desktop.d.ts.map +1 -1
- package/dist/react/Desktop.js +44 -9
- package/dist/react/Desktop.js.map +1 -1
- package/dist/react/Dock.d.ts +11 -1
- package/dist/react/Dock.d.ts.map +1 -1
- package/dist/react/Dock.js +4 -3
- package/dist/react/Dock.js.map +1 -1
- package/dist/react/context.d.ts +9 -1
- package/dist/react/context.d.ts.map +1 -1
- package/dist/react/context.js +15 -3
- package/dist/react/context.js.map +1 -1
- package/dist/react/conversation.d.ts +12 -0
- package/dist/react/conversation.d.ts.map +1 -1
- package/dist/react/conversation.js +1 -1
- package/dist/react/conversation.js.map +1 -1
- package/dist/react/index.d.ts +4 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +2 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/shell.d.ts +4 -1
- package/dist/react/shell.d.ts.map +1 -1
- package/dist/react/shell.js +2 -2
- package/dist/react/shell.js.map +1 -1
- package/dist/react/soundsToggle.d.ts +14 -0
- package/dist/react/soundsToggle.d.ts.map +1 -0
- package/dist/react/soundsToggle.js +12 -0
- package/dist/react/soundsToggle.js.map +1 -0
- package/llms.txt +44 -14
- package/package.json +7 -2
- package/src/core/index.ts +2 -0
- package/src/core/look.ts +43 -0
- package/src/css/conversation.css +21 -0
- package/src/css/dock.css +123 -3
- package/src/css/looks.css +257 -0
- package/src/css/tokens.css +5 -1
- package/src/fx/fx.ts +145 -0
- package/src/fx/index.ts +6 -0
- package/src/fx/measure.ts +70 -0
- package/src/fx/sounds.ts +213 -0
- package/src/react/Desktop.tsx +97 -29
- package/src/react/Dock.tsx +16 -3
- package/src/react/context.tsx +25 -3
- package/src/react/conversation.tsx +18 -1
- package/src/react/index.ts +4 -2
- package/src/react/shell.tsx +5 -2
- package/src/react/soundsToggle.tsx +19 -0
package/dist/desk.css
CHANGED
|
@@ -47,11 +47,15 @@
|
|
|
47
47
|
--desk-on-accent: #ffffff;
|
|
48
48
|
--desk-ease: cubic-bezier(.32, .72, 0, 1);
|
|
49
49
|
--desk-dock-size: 48px;
|
|
50
|
+
/* How far an overlay dock stands off the edge of the desk. */
|
|
51
|
+
--desk-dock-offset: 12px;
|
|
52
|
+
/* The room an overlay dock takes from the stage beside it: the offset, the dock, its border and padding. */
|
|
53
|
+
--desk-dock-room: calc(var(--desk-dock-offset) + var(--desk-dock-size) + 16px);
|
|
50
54
|
--desk-dock-glass: rgb(255 255 255 / 72%);
|
|
51
55
|
--desk-dock-icon: linear-gradient(160deg, #ffffff, #eceff5);
|
|
52
56
|
--desk-badge: #ef4444;
|
|
53
57
|
--desk-badge-ink: #ffffff;
|
|
54
|
-
/* Room the stage leaves at the bottom for
|
|
58
|
+
/* Room the stage leaves at the bottom for something of the app's own. An overlay dock makes its own. */
|
|
55
59
|
--desk-inset-bottom: 0px;
|
|
56
60
|
}
|
|
57
61
|
|
|
@@ -468,12 +472,56 @@
|
|
|
468
472
|
|
|
469
473
|
.desk-dock[data-placement="overlay"] {
|
|
470
474
|
position: absolute;
|
|
471
|
-
left: 50%;
|
|
472
|
-
bottom: 12px;
|
|
473
475
|
z-index: 1000;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.desk-dock[data-placement="overlay"][data-side="bottom"] {
|
|
479
|
+
left: 50%;
|
|
480
|
+
bottom: var(--desk-dock-offset);
|
|
474
481
|
transform: translateX(-50%);
|
|
475
482
|
}
|
|
476
483
|
|
|
484
|
+
.desk-dock[data-placement="overlay"]:not([data-side="bottom"]) {
|
|
485
|
+
top: 50%;
|
|
486
|
+
transform: translateY(-50%);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.desk-dock[data-placement="overlay"][data-side="left"] {
|
|
490
|
+
left: var(--desk-dock-offset);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.desk-dock[data-placement="overlay"][data-side="right"] {
|
|
494
|
+
right: var(--desk-dock-offset);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/* Standing in a column: items top to bottom, and never taller than the room it stands in. */
|
|
498
|
+
.desk-dock:not([data-side="bottom"]) {
|
|
499
|
+
flex-direction: column;
|
|
500
|
+
align-items: center;
|
|
501
|
+
max-width: none;
|
|
502
|
+
max-height: calc(100% - 2 * var(--desk-dock-offset));
|
|
503
|
+
/* The same thickness standing up as lying down, so --desk-dock-room holds on every side. */
|
|
504
|
+
padding: 9px 7px;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/*
|
|
508
|
+
* An overlay dock makes its own room. The stage beside it starts where the dock ends — a margin, not
|
|
509
|
+
* padding, because windows are placed from the stage's own corner: padding would keep filled windows
|
|
510
|
+
* clear and still open every free one underneath the dock.
|
|
511
|
+
*/
|
|
512
|
+
:has(> .desk-dock[data-placement="overlay"][data-side="left"]) > .desk-stage {
|
|
513
|
+
margin-left: var(--desk-dock-room);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
:has(> .desk-dock[data-placement="overlay"][data-side="right"]) > .desk-stage {
|
|
517
|
+
margin-right: var(--desk-dock-room);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
:has(> .desk-dock[data-placement="overlay"][data-side="bottom"]) > .desk-stage {
|
|
521
|
+
/* The stage is `height: 100%`, so a margin would push it past its parent rather than shorten it. */
|
|
522
|
+
height: calc(100% - var(--desk-dock-room));
|
|
523
|
+
}
|
|
524
|
+
|
|
477
525
|
.desk-dock-separator {
|
|
478
526
|
flex: none;
|
|
479
527
|
align-self: stretch;
|
|
@@ -482,6 +530,12 @@
|
|
|
482
530
|
background: var(--desk-rule);
|
|
483
531
|
}
|
|
484
532
|
|
|
533
|
+
.desk-dock:not([data-side="bottom"]) .desk-dock-separator {
|
|
534
|
+
width: auto;
|
|
535
|
+
height: 1px;
|
|
536
|
+
margin: 4px 6px;
|
|
537
|
+
}
|
|
538
|
+
|
|
485
539
|
.desk-dock-slot {
|
|
486
540
|
position: relative;
|
|
487
541
|
display: flex;
|
|
@@ -515,11 +569,22 @@
|
|
|
515
569
|
outline-offset: 2px;
|
|
516
570
|
}
|
|
517
571
|
|
|
572
|
+
/* Magnified toward the desk, whichever side that is. */
|
|
518
573
|
@media (hover: hover) and (pointer: fine) {
|
|
519
|
-
.desk-dock-item:hover:not(:disabled) {
|
|
574
|
+
.desk-dock[data-side="bottom"] .desk-dock-item:hover:not(:disabled) {
|
|
520
575
|
transform: translateY(-8px) scale(1.14);
|
|
521
576
|
margin: 0 5px;
|
|
522
577
|
}
|
|
578
|
+
|
|
579
|
+
.desk-dock[data-side="left"] .desk-dock-item:hover:not(:disabled) {
|
|
580
|
+
transform: translateX(8px) scale(1.14);
|
|
581
|
+
margin: 5px 0;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.desk-dock[data-side="right"] .desk-dock-item:hover:not(:disabled) {
|
|
585
|
+
transform: translateX(-8px) scale(1.14);
|
|
586
|
+
margin: 5px 0;
|
|
587
|
+
}
|
|
523
588
|
}
|
|
524
589
|
|
|
525
590
|
.desk-dock-icon {
|
|
@@ -575,6 +640,22 @@
|
|
|
575
640
|
background: var(--desk-muted);
|
|
576
641
|
}
|
|
577
642
|
|
|
643
|
+
/* On a dock at the side the dot sits between the item and the edge of the screen, as it does under a bottom one. */
|
|
644
|
+
.desk-dock:not([data-side="bottom"]) .desk-dock-item[data-running]::after {
|
|
645
|
+
top: 50%;
|
|
646
|
+
bottom: auto;
|
|
647
|
+
margin: -2px 0 0;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
.desk-dock[data-side="left"] .desk-dock-item[data-running]::after {
|
|
651
|
+
left: -6px;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
.desk-dock[data-side="right"] .desk-dock-item[data-running]::after {
|
|
655
|
+
left: auto;
|
|
656
|
+
right: -6px;
|
|
657
|
+
}
|
|
658
|
+
|
|
578
659
|
.desk-dock-item[data-focused]::after {
|
|
579
660
|
background: var(--desk-accent);
|
|
580
661
|
}
|
|
@@ -622,6 +703,21 @@
|
|
|
622
703
|
transition: opacity .12s;
|
|
623
704
|
}
|
|
624
705
|
|
|
706
|
+
.desk-dock:not([data-side="bottom"]) .desk-dock-tip {
|
|
707
|
+
bottom: auto;
|
|
708
|
+
top: 50%;
|
|
709
|
+
transform: translateY(-50%);
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
.desk-dock[data-side="left"] .desk-dock-tip {
|
|
713
|
+
left: calc(100% + 14px);
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
.desk-dock[data-side="right"] .desk-dock-tip {
|
|
717
|
+
left: auto;
|
|
718
|
+
right: calc(100% + 14px);
|
|
719
|
+
}
|
|
720
|
+
|
|
625
721
|
.desk-dock-item:hover .desk-dock-tip,
|
|
626
722
|
.desk-dock-item:focus-visible .desk-dock-tip {
|
|
627
723
|
opacity: 1;
|
|
@@ -659,6 +755,30 @@
|
|
|
659
755
|
}
|
|
660
756
|
}
|
|
661
757
|
|
|
758
|
+
/* Beside a dock at the side, level with the stack it came from, opening toward the desk. */
|
|
759
|
+
.desk-dock:not([data-side="bottom"]) .desk-stack {
|
|
760
|
+
bottom: auto;
|
|
761
|
+
top: 0;
|
|
762
|
+
transform: none;
|
|
763
|
+
animation-name: desk-pop-aside;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
.desk-dock[data-side="left"] .desk-stack {
|
|
767
|
+
left: calc(100% + 18px);
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
.desk-dock[data-side="right"] .desk-stack {
|
|
771
|
+
left: auto;
|
|
772
|
+
right: calc(100% + 18px);
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
@keyframes desk-pop-aside {
|
|
776
|
+
from {
|
|
777
|
+
opacity: 0;
|
|
778
|
+
scale: .98;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
662
782
|
.desk-stack-title {
|
|
663
783
|
margin: 0 0 8px 4px;
|
|
664
784
|
font-size: 11px;
|
|
@@ -725,6 +845,10 @@
|
|
|
725
845
|
box-shadow: -6px 0 0 -2px var(--desk-accent);
|
|
726
846
|
}
|
|
727
847
|
|
|
848
|
+
.desk-dock:not([data-side="bottom"]) .desk-dock-item[data-desk-drop][data-over] {
|
|
849
|
+
box-shadow: 0 -6px 0 -2px var(--desk-accent);
|
|
850
|
+
}
|
|
851
|
+
|
|
728
852
|
/* @liberation-data/desk — menus.css */
|
|
729
853
|
/* ── Menu bar ── */
|
|
730
854
|
|
|
@@ -2316,8 +2440,29 @@
|
|
|
2316
2440
|
font-size: 11.5px;
|
|
2317
2441
|
font-weight: 600;
|
|
2318
2442
|
color: var(--desk-muted);
|
|
2443
|
+
/* A row, so an avatar and the name share a baseline rather than the mark pushing the name
|
|
2444
|
+
down by its own height. */
|
|
2445
|
+
display: flex;
|
|
2446
|
+
align-items: center;
|
|
2447
|
+
gap: var(--desk-space-1);
|
|
2319
2448
|
}
|
|
2320
2449
|
|
|
2450
|
+
/*
|
|
2451
|
+
* Who is speaking, beside their name. Sized here rather than by the caller so every application
|
|
2452
|
+
* that supplies one lands on the same line — a node is free to be anything, but it is not free to
|
|
2453
|
+
* be any size.
|
|
2454
|
+
*/
|
|
2455
|
+
.desk-message-avatar {
|
|
2456
|
+
display: inline-flex;
|
|
2457
|
+
flex: none;
|
|
2458
|
+
align-items: center;
|
|
2459
|
+
justify-content: center;
|
|
2460
|
+
inline-size: 18px;
|
|
2461
|
+
block-size: 18px;
|
|
2462
|
+
}
|
|
2463
|
+
|
|
2464
|
+
.desk-message-avatar > * { inline-size: 100%; block-size: 100%; }
|
|
2465
|
+
|
|
2321
2466
|
.desk-bubble {
|
|
2322
2467
|
padding: var(--desk-space-2) var(--desk-space-3);
|
|
2323
2468
|
border: 1px solid var(--desk-rule);
|
|
@@ -3008,3 +3153,262 @@
|
|
|
3008
3153
|
border: 0;
|
|
3009
3154
|
background: var(--desk-surface);
|
|
3010
3155
|
}
|
|
3156
|
+
|
|
3157
|
+
/* @liberation-data/desk — looks.css */
|
|
3158
|
+
/*
|
|
3159
|
+
* Looks: the platform chrome, on `data-look` at the root. The rest of desk.css is the Mac look, so
|
|
3160
|
+
* this part only says how GNOME and Windows differ from it.
|
|
3161
|
+
*
|
|
3162
|
+
* A look changes chrome, never brand: nothing here sets --desk-accent or --desk-ground. Selectors
|
|
3163
|
+
* carry the look AND the base rule's own specificity, so they win by coming later, not by !important.
|
|
3164
|
+
*/
|
|
3165
|
+
|
|
3166
|
+
/* ── GNOME (Adwaita) ── */
|
|
3167
|
+
|
|
3168
|
+
[data-look="gnome"] {
|
|
3169
|
+
--desk-font: Cantarell, "Adwaita Sans", system-ui, sans-serif;
|
|
3170
|
+
}
|
|
3171
|
+
|
|
3172
|
+
/*
|
|
3173
|
+
* Title and note stacked in the middle of the bar, centred on the bar and not on the space left over,
|
|
3174
|
+
* as a GNOME header bar does. The end of the bar keeps room for the controls and a little more.
|
|
3175
|
+
*/
|
|
3176
|
+
[data-look="gnome"] .desk-titlebar {
|
|
3177
|
+
position: relative;
|
|
3178
|
+
min-height: 46px;
|
|
3179
|
+
padding: 0 11px;
|
|
3180
|
+
justify-content: flex-end;
|
|
3181
|
+
}
|
|
3182
|
+
|
|
3183
|
+
[data-look="gnome"] .desk-titlebar-heading {
|
|
3184
|
+
position: absolute;
|
|
3185
|
+
left: 50%;
|
|
3186
|
+
transform: translateX(-50%);
|
|
3187
|
+
max-width: calc(100% - 2 * 120px);
|
|
3188
|
+
display: flex;
|
|
3189
|
+
flex-direction: column;
|
|
3190
|
+
align-items: center;
|
|
3191
|
+
text-align: center;
|
|
3192
|
+
pointer-events: none;
|
|
3193
|
+
}
|
|
3194
|
+
|
|
3195
|
+
[data-look="gnome"] .desk-titlebar-heading > * {
|
|
3196
|
+
max-width: 100%;
|
|
3197
|
+
}
|
|
3198
|
+
|
|
3199
|
+
[data-look="gnome"] .desk-title {
|
|
3200
|
+
font-size: 13.5px;
|
|
3201
|
+
font-weight: 700;
|
|
3202
|
+
}
|
|
3203
|
+
|
|
3204
|
+
[data-look="gnome"] .desk-window-note {
|
|
3205
|
+
margin: 0;
|
|
3206
|
+
font-size: 11.5px;
|
|
3207
|
+
}
|
|
3208
|
+
|
|
3209
|
+
[data-look="gnome"] .desk-window .desk-controls {
|
|
3210
|
+
gap: 12px;
|
|
3211
|
+
}
|
|
3212
|
+
|
|
3213
|
+
[data-look="gnome"] .desk-window .desk-control[data-control] {
|
|
3214
|
+
width: 24px;
|
|
3215
|
+
height: 24px;
|
|
3216
|
+
background: color-mix(in srgb, var(--desk-ink) 10%, transparent);
|
|
3217
|
+
color: var(--desk-ink);
|
|
3218
|
+
}
|
|
3219
|
+
|
|
3220
|
+
[data-look="gnome"] .desk-window .desk-controls .desk-control[data-control]:hover {
|
|
3221
|
+
background: color-mix(in srgb, var(--desk-ink) 16%, transparent);
|
|
3222
|
+
}
|
|
3223
|
+
|
|
3224
|
+
[data-look="gnome"] .desk-window .desk-controls .desk-control[data-control]:active {
|
|
3225
|
+
background: color-mix(in srgb, var(--desk-ink) 26%, transparent);
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3228
|
+
/* GNOME's marks are always there: symbolic icons, not colours. */
|
|
3229
|
+
[data-look="gnome"] .desk-window .desk-control-glyph {
|
|
3230
|
+
opacity: 1;
|
|
3231
|
+
color: currentColor;
|
|
3232
|
+
stroke-width: 1.3;
|
|
3233
|
+
}
|
|
3234
|
+
|
|
3235
|
+
/* The key window is told apart by its shadow and its title, not by an accent border. */
|
|
3236
|
+
[data-look="gnome"] .desk-window[data-focused] {
|
|
3237
|
+
border-color: var(--desk-rule);
|
|
3238
|
+
}
|
|
3239
|
+
|
|
3240
|
+
/* ── Windows 11 ── */
|
|
3241
|
+
|
|
3242
|
+
[data-look="windows"] {
|
|
3243
|
+
--desk-font: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
|
|
3244
|
+
--desk-radius: 8px;
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3247
|
+
/* The controls run the full height of the bar, flush to its end. */
|
|
3248
|
+
[data-look="windows"] .desk-titlebar {
|
|
3249
|
+
min-height: 32px;
|
|
3250
|
+
padding: 0 0 0 12px;
|
|
3251
|
+
align-items: stretch;
|
|
3252
|
+
background: var(--desk-surface);
|
|
3253
|
+
}
|
|
3254
|
+
|
|
3255
|
+
[data-look="windows"] .desk-titlebar > * {
|
|
3256
|
+
align-self: center;
|
|
3257
|
+
}
|
|
3258
|
+
|
|
3259
|
+
[data-look="windows"] .desk-title {
|
|
3260
|
+
flex: 1 1 auto;
|
|
3261
|
+
font-size: 12px;
|
|
3262
|
+
font-weight: 400;
|
|
3263
|
+
}
|
|
3264
|
+
|
|
3265
|
+
[data-look="windows"] .desk-titlebar > .desk-controls {
|
|
3266
|
+
align-self: stretch;
|
|
3267
|
+
margin-left: var(--desk-space-2);
|
|
3268
|
+
gap: 0;
|
|
3269
|
+
}
|
|
3270
|
+
|
|
3271
|
+
[data-look="windows"] .desk-window .desk-control[data-control] {
|
|
3272
|
+
width: 46px;
|
|
3273
|
+
height: auto;
|
|
3274
|
+
border-radius: 0;
|
|
3275
|
+
background: transparent;
|
|
3276
|
+
color: var(--desk-ink);
|
|
3277
|
+
}
|
|
3278
|
+
|
|
3279
|
+
[data-look="windows"] .desk-window .desk-controls .desk-control[data-control]:hover {
|
|
3280
|
+
background: color-mix(in srgb, var(--desk-ink) 8%, transparent);
|
|
3281
|
+
}
|
|
3282
|
+
|
|
3283
|
+
[data-look="windows"] .desk-window .desk-controls .desk-control[data-control="close"]:hover {
|
|
3284
|
+
background: #c42b1c;
|
|
3285
|
+
color: #ffffff;
|
|
3286
|
+
}
|
|
3287
|
+
|
|
3288
|
+
[data-look="windows"] .desk-window .desk-control-glyph {
|
|
3289
|
+
width: 10px;
|
|
3290
|
+
height: 10px;
|
|
3291
|
+
opacity: 1;
|
|
3292
|
+
color: currentColor;
|
|
3293
|
+
stroke-width: 1;
|
|
3294
|
+
stroke-linecap: butt;
|
|
3295
|
+
}
|
|
3296
|
+
|
|
3297
|
+
[data-look="windows"] .desk-window:not([data-focused]) .desk-control-glyph {
|
|
3298
|
+
opacity: .45;
|
|
3299
|
+
}
|
|
3300
|
+
|
|
3301
|
+
[data-look="windows"] .desk-control:focus-visible {
|
|
3302
|
+
outline-offset: -2px;
|
|
3303
|
+
}
|
|
3304
|
+
|
|
3305
|
+
/*
|
|
3306
|
+
* ── GNOME shell: the top bar and the dash are dark in either theme, and so is what opens from them ──
|
|
3307
|
+
* The tokens are redefined on the bar and the dock themselves, so their menus and stacks, which sit
|
|
3308
|
+
* inside them, come out dark too — as the shell's own menus do.
|
|
3309
|
+
*/
|
|
3310
|
+
[data-look="gnome"] .desk-menubar,
|
|
3311
|
+
[data-look="gnome"] .desk-dock {
|
|
3312
|
+
--desk-ink: #ffffff;
|
|
3313
|
+
--desk-muted: rgb(255 255 255 / 68%);
|
|
3314
|
+
--desk-surface: #2a2a2a;
|
|
3315
|
+
--desk-rule: rgb(255 255 255 / 10%);
|
|
3316
|
+
--desk-dock-icon: transparent;
|
|
3317
|
+
}
|
|
3318
|
+
|
|
3319
|
+
[data-look="gnome"] .desk-menubar {
|
|
3320
|
+
height: 32px;
|
|
3321
|
+
--desk-dock-glass: rgb(0 0 0 / 94%);
|
|
3322
|
+
border-bottom: 0;
|
|
3323
|
+
font-weight: 600;
|
|
3324
|
+
}
|
|
3325
|
+
|
|
3326
|
+
[data-look="gnome"] .desk-menubar-title {
|
|
3327
|
+
border-radius: 999px;
|
|
3328
|
+
}
|
|
3329
|
+
|
|
3330
|
+
[data-look="gnome"] .desk-menu {
|
|
3331
|
+
border-radius: 12px;
|
|
3332
|
+
padding: 6px;
|
|
3333
|
+
}
|
|
3334
|
+
|
|
3335
|
+
[data-look="gnome"] .desk-menu-item {
|
|
3336
|
+
border-radius: 6px;
|
|
3337
|
+
font-weight: 400;
|
|
3338
|
+
}
|
|
3339
|
+
|
|
3340
|
+
[data-look="gnome"] .desk-menu-item[data-active],
|
|
3341
|
+
[data-look="windows"] .desk-menu-item[data-active] {
|
|
3342
|
+
background: color-mix(in srgb, var(--desk-ink) 10%, transparent);
|
|
3343
|
+
color: var(--desk-ink);
|
|
3344
|
+
}
|
|
3345
|
+
|
|
3346
|
+
[data-look="gnome"] .desk-dock {
|
|
3347
|
+
--desk-dock-glass: rgb(24 24 24 / 86%);
|
|
3348
|
+
border-radius: 20px;
|
|
3349
|
+
}
|
|
3350
|
+
|
|
3351
|
+
[data-look="gnome"] .desk-dock .desk-dock-item {
|
|
3352
|
+
border: 0;
|
|
3353
|
+
border-radius: 12px;
|
|
3354
|
+
}
|
|
3355
|
+
|
|
3356
|
+
/* No magnification: GNOME's dash lights an item up rather than growing it. */
|
|
3357
|
+
[data-look="gnome"] .desk-dock .desk-dock-item:hover:not(:disabled),
|
|
3358
|
+
[data-look="windows"] .desk-dock .desk-dock-item:hover:not(:disabled) {
|
|
3359
|
+
transform: none;
|
|
3360
|
+
margin: 0;
|
|
3361
|
+
background: color-mix(in srgb, var(--desk-ink) 12%, transparent);
|
|
3362
|
+
}
|
|
3363
|
+
|
|
3364
|
+
/* ── Windows: a flat bar, taskbar tiles, and a pill that widens for the key window ── */
|
|
3365
|
+
|
|
3366
|
+
[data-look="windows"] .desk-menubar {
|
|
3367
|
+
background: var(--desk-surface);
|
|
3368
|
+
backdrop-filter: none;
|
|
3369
|
+
-webkit-backdrop-filter: none;
|
|
3370
|
+
}
|
|
3371
|
+
|
|
3372
|
+
[data-look="windows"] .desk-menubar-title,
|
|
3373
|
+
[data-look="windows"] .desk-menu-item {
|
|
3374
|
+
border-radius: 4px;
|
|
3375
|
+
}
|
|
3376
|
+
|
|
3377
|
+
[data-look="windows"] .desk-menu {
|
|
3378
|
+
border-radius: 8px;
|
|
3379
|
+
padding: 4px;
|
|
3380
|
+
}
|
|
3381
|
+
|
|
3382
|
+
[data-look="windows"] .desk-dock {
|
|
3383
|
+
border-radius: 8px;
|
|
3384
|
+
}
|
|
3385
|
+
|
|
3386
|
+
[data-look="windows"] .desk-dock .desk-dock-item {
|
|
3387
|
+
border: 0;
|
|
3388
|
+
border-radius: 4px;
|
|
3389
|
+
background: transparent;
|
|
3390
|
+
}
|
|
3391
|
+
|
|
3392
|
+
[data-look="windows"] .desk-dock .desk-dock-item[data-running]::after {
|
|
3393
|
+
width: 6px;
|
|
3394
|
+
height: 3px;
|
|
3395
|
+
margin-left: -3px;
|
|
3396
|
+
border-radius: 2px;
|
|
3397
|
+
bottom: -4px;
|
|
3398
|
+
}
|
|
3399
|
+
|
|
3400
|
+
[data-look="windows"] .desk-dock[data-side="bottom"] .desk-dock-item[data-focused]::after {
|
|
3401
|
+
width: 16px;
|
|
3402
|
+
margin-left: -8px;
|
|
3403
|
+
}
|
|
3404
|
+
|
|
3405
|
+
[data-look="windows"] .desk-dock:not([data-side="bottom"]) .desk-dock-item[data-running]::after {
|
|
3406
|
+
width: 3px;
|
|
3407
|
+
height: 6px;
|
|
3408
|
+
margin: -3px 0 0;
|
|
3409
|
+
}
|
|
3410
|
+
|
|
3411
|
+
[data-look="windows"] .desk-dock:not([data-side="bottom"]) .desk-dock-item[data-focused]::after {
|
|
3412
|
+
height: 16px;
|
|
3413
|
+
margin-top: -8px;
|
|
3414
|
+
}
|
package/dist/fx/fx.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type BuiltInSound, type Sound } from './sounds.js';
|
|
2
|
+
export interface FxOptions<Extra extends string> {
|
|
3
|
+
/** Sounds of the app's own, or replacements for the built-ins. */
|
|
4
|
+
readonly sounds?: Readonly<Record<Extra, Sound>>;
|
|
5
|
+
/** Where the mute is kept. Two apps on one origin that should not share a switch need two keys. */
|
|
6
|
+
readonly storageKey?: string;
|
|
7
|
+
/** A second request for the same sound inside this many milliseconds is the same event. */
|
|
8
|
+
readonly coalesceMs?: number;
|
|
9
|
+
/** Master gain over every sound. */
|
|
10
|
+
readonly volume?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface Fx<Name extends string> {
|
|
13
|
+
/** Plays now if it can; whether it did. Silent when muted, repeated, or before any press. */
|
|
14
|
+
play(name: Name, nowMs?: number): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Opens audio on the first press. A browser refuses sound on a page nobody has touched, and a
|
|
17
|
+
* sound arrives unasked, long after the last click: the press has to be taken while it happens.
|
|
18
|
+
* Returns a teardown.
|
|
19
|
+
*/
|
|
20
|
+
unlock(): () => void;
|
|
21
|
+
muted(): boolean;
|
|
22
|
+
setMuted(muted: boolean): void;
|
|
23
|
+
/** Told when the mute changes, here or in another tab. */
|
|
24
|
+
subscribe(listener: () => void): () => void;
|
|
25
|
+
/** Schedules a sound into any context, an offline one included, for measuring. */
|
|
26
|
+
render(ctx: BaseAudioContext, name: Name, out: AudioNode): void;
|
|
27
|
+
}
|
|
28
|
+
export declare function createFx<Extra extends string = never>(options?: FxOptions<Extra>): Fx<BuiltInSound | Extra>;
|
|
29
|
+
//# sourceMappingURL=fx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fx.d.ts","sourceRoot":"","sources":["../../src/fx/fx.ts"],"names":[],"mappings":"AAOA,OAAO,EAAkB,KAAK,YAAY,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAA;AAE3E,MAAM,WAAW,SAAS,CAAC,KAAK,SAAS,MAAM;IAC7C,kEAAkE;IAClE,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;IAChD,mGAAmG;IACnG,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,2FAA2F;IAC3F,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,oCAAoC;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,EAAE,CAAC,IAAI,SAAS,MAAM;IACrC,6FAA6F;IAC7F,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACzC;;;;OAIG;IACH,MAAM,IAAI,MAAM,IAAI,CAAA;IACpB,KAAK,IAAI,OAAO,CAAA;IAChB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAA;IAC9B,0DAA0D;IAC1D,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;IAC3C,kFAAkF;IAClF,MAAM,CAAC,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,GAAG,IAAI,CAAA;CAChE;AASD,wBAAgB,QAAQ,CAAC,KAAK,SAAS,MAAM,GAAG,KAAK,EACnD,OAAO,GAAE,SAAS,CAAC,KAAK,CAAM,GAC7B,EAAE,CAAC,YAAY,GAAG,KAAK,CAAC,CAkG1B"}
|
package/dist/fx/fx.js
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Sounds for an app on the desk: `attention`, `ready` and `failed`, and any an app adds.
|
|
3
|
+
*
|
|
4
|
+
* WHEN to make one is the app's decision and the hard part; see HIG.md, "Sound". This is the
|
|
5
|
+
* instrument: one audio context, opened on the first press, a repeat of the same sound inside a
|
|
6
|
+
* short window heard once, and a mute this browser remembers.
|
|
7
|
+
*/
|
|
8
|
+
import { SCORES, scored } from './sounds.js';
|
|
9
|
+
function audioContextClass() {
|
|
10
|
+
if (typeof window === 'undefined')
|
|
11
|
+
return null;
|
|
12
|
+
return window.AudioContext ?? window.webkitAudioContext ?? null;
|
|
13
|
+
}
|
|
14
|
+
export function createFx(options = {}) {
|
|
15
|
+
const { storageKey = 'desk-fx-muted', coalesceMs = 1500, volume = 0.8 } = options;
|
|
16
|
+
const builtIn = Object.fromEntries(Object.entries(SCORES).map(([name, score]) => [name, scored(score)]));
|
|
17
|
+
const sounds = { ...builtIn, ...options.sounds };
|
|
18
|
+
const lastPlayed = new Map();
|
|
19
|
+
const listeners = new Set();
|
|
20
|
+
let audio = null;
|
|
21
|
+
const context = () => {
|
|
22
|
+
if (audio)
|
|
23
|
+
return audio;
|
|
24
|
+
const Class = audioContextClass();
|
|
25
|
+
if (!Class)
|
|
26
|
+
return null;
|
|
27
|
+
try {
|
|
28
|
+
audio = new Class();
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
return audio;
|
|
34
|
+
};
|
|
35
|
+
const muted = () => {
|
|
36
|
+
try {
|
|
37
|
+
return localStorage.getItem(storageKey) === 'yes';
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const render = (ctx, name, out) => {
|
|
44
|
+
const master = ctx.createGain();
|
|
45
|
+
const at = ctx.currentTime + 0.01;
|
|
46
|
+
master.gain.setValueAtTime(volume, at);
|
|
47
|
+
master.connect(out);
|
|
48
|
+
sounds[name](ctx, master, at);
|
|
49
|
+
};
|
|
50
|
+
return {
|
|
51
|
+
play(name, nowMs = Date.now()) {
|
|
52
|
+
if (muted())
|
|
53
|
+
return false;
|
|
54
|
+
const previous = lastPlayed.get(name);
|
|
55
|
+
if (previous !== undefined && nowMs - previous < coalesceMs)
|
|
56
|
+
return false;
|
|
57
|
+
const ctx = context();
|
|
58
|
+
// Never resumed from here: outside a press the promise may never settle, and a sound that
|
|
59
|
+
// lands a click late belongs to the wrong moment.
|
|
60
|
+
if (!ctx || ctx.state !== 'running')
|
|
61
|
+
return false;
|
|
62
|
+
lastPlayed.set(name, nowMs);
|
|
63
|
+
try {
|
|
64
|
+
render(ctx, name, ctx.destination);
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
unlock() {
|
|
72
|
+
if (typeof window === 'undefined')
|
|
73
|
+
return () => undefined;
|
|
74
|
+
const stop = () => {
|
|
75
|
+
window.removeEventListener('pointerdown', open);
|
|
76
|
+
window.removeEventListener('keydown', open);
|
|
77
|
+
};
|
|
78
|
+
function open() {
|
|
79
|
+
stop();
|
|
80
|
+
const ctx = context();
|
|
81
|
+
// Inside the handler, where the browser is willing to listen.
|
|
82
|
+
if (ctx && ctx.state !== 'running')
|
|
83
|
+
void ctx.resume().catch(() => undefined);
|
|
84
|
+
}
|
|
85
|
+
window.addEventListener('pointerdown', open);
|
|
86
|
+
window.addEventListener('keydown', open);
|
|
87
|
+
return stop;
|
|
88
|
+
},
|
|
89
|
+
muted,
|
|
90
|
+
setMuted(next) {
|
|
91
|
+
try {
|
|
92
|
+
if (next)
|
|
93
|
+
localStorage.setItem(storageKey, 'yes');
|
|
94
|
+
else
|
|
95
|
+
localStorage.removeItem(storageKey);
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
// Blocked site data: sounds stay on, which is the default.
|
|
99
|
+
}
|
|
100
|
+
listeners.forEach((listener) => listener());
|
|
101
|
+
},
|
|
102
|
+
subscribe(listener) {
|
|
103
|
+
listeners.add(listener);
|
|
104
|
+
const fromAnotherTab = (event) => {
|
|
105
|
+
if (event.key === storageKey)
|
|
106
|
+
listener();
|
|
107
|
+
};
|
|
108
|
+
if (typeof window !== 'undefined')
|
|
109
|
+
window.addEventListener('storage', fromAnotherTab);
|
|
110
|
+
return () => {
|
|
111
|
+
listeners.delete(listener);
|
|
112
|
+
if (typeof window !== 'undefined')
|
|
113
|
+
window.removeEventListener('storage', fromAnotherTab);
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
render,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=fx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fx.js","sourceRoot":"","sources":["../../src/fx/fx.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { createFx } from './fx.js';
|
|
2
|
+
export type { Fx, FxOptions } from './fx.js';
|
|
3
|
+
export { BELL, GROWL, SCORES, scored } from './sounds.js';
|
|
4
|
+
export type { BuiltInSound, Note, Overtone, Score, Sound, Voice } from './sounds.js';
|
|
5
|
+
export { measureLoudness } from './measure.js';
|
|
6
|
+
export type { Loudness, MeasureOptions } from './measure.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fx/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,YAAY,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzD,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA"}
|
package/dist/fx/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fx/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAElC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Fx } from './fx.js';
|
|
2
|
+
export interface Loudness {
|
|
3
|
+
/** Momentary loudness, LUFS. */
|
|
4
|
+
readonly lufs: number;
|
|
5
|
+
/** Sample peak before weighting, dBFS: how close it comes to clipping. */
|
|
6
|
+
readonly peakDb: number;
|
|
7
|
+
}
|
|
8
|
+
export interface MeasureOptions {
|
|
9
|
+
/**
|
|
10
|
+
* `laptop` adds a 4th-order high-pass at 200 Hz, about where small speakers give up. Level for
|
|
11
|
+
* that one: it is what most people have.
|
|
12
|
+
*/
|
|
13
|
+
readonly speaker?: 'full' | 'laptop';
|
|
14
|
+
/** Seconds rendered; longer than the sound. */
|
|
15
|
+
readonly seconds?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function measureLoudness<Name extends string>(fx: Fx<Name>, name: Name, { speaker, seconds }?: MeasureOptions): Promise<Loudness>;
|
|
18
|
+
//# sourceMappingURL=measure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measure.d.ts","sourceRoot":"","sources":["../../src/fx/measure.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAEjC,MAAM,WAAW,QAAQ;IACvB,gCAAgC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IACpC,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAC1B;AAOD,wBAAsB,eAAe,CAAC,IAAI,SAAS,MAAM,EACvD,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EACZ,IAAI,EAAE,IAAI,EACV,EAAE,OAAgB,EAAE,OAAW,EAAE,GAAE,cAAmB,GACrD,OAAO,CAAC,QAAQ,CAAC,CAqBnB"}
|