@shellui/core 0.7.0-alpha.8 → 0.7.0-beta.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/README.md +1 -1
- package/package.json +23 -6
- package/src/components/ui/drawer.tsx +47 -30
- package/src/components/ui/sheet.tsx +18 -12
- package/src/components/ui/shell-divider.spec.tsx +63 -0
- package/src/components/ui/shell-divider.tsx +20 -0
- package/src/components/ui/sidebar.tsx +26 -12
- package/src/components/ui/tooltip.tsx +4 -2
- package/src/features/admin/AdminView.tsx +9 -6
- package/src/features/auth/AuthProvider.tsx +10 -1
- package/src/features/auth/components/LoginButton.spec.tsx +203 -0
- package/src/features/auth/components/LoginButton.tsx +77 -28
- package/src/features/auth/components/LoginButtonIcons.tsx +4 -8
- package/src/features/auth/utils/index.ts +1 -0
- package/src/features/auth/utils/resolveSdkLoginRedirectPath.spec.ts +41 -0
- package/src/features/auth/utils/resolveSdkLoginRedirectPath.ts +31 -0
- package/src/features/chromeActions/ChromeActionsHost.tsx +5 -1
- package/src/features/chromeActions/computeActionInsets.ts +7 -4
- package/src/features/layouts/OverlayShell.tsx +58 -40
- package/src/features/layouts/appbar/AppBarItemIcon.spec.tsx +45 -0
- package/src/features/layouts/appbar/AppBarItemIcon.tsx +19 -0
- package/src/features/layouts/appbar/AppBarLayout.tsx +115 -110
- package/src/features/layouts/appbar/appBarOverflow.spec.ts +27 -0
- package/src/features/layouts/appbar/appBarOverflow.ts +42 -0
- package/src/features/layouts/chrome/CollapsedDesktopTitlebar.tsx +13 -24
- package/src/features/layouts/chrome/ContentDragOverlay.tsx +5 -6
- package/src/features/layouts/chrome/DesktopChrome.tsx +37 -0
- package/src/features/layouts/chrome/DesktopHistoryButtons.tsx +15 -4
- package/src/features/layouts/chrome/MacStrip.tsx +33 -0
- package/src/features/layouts/chrome/constants.ts +36 -8
- package/src/features/layouts/chrome/index.ts +8 -0
- package/src/features/layouts/chrome/stripDragMap.ts +35 -0
- package/src/features/layouts/chrome/stripNoDrag.spec.tsx +103 -0
- package/src/features/layouts/chrome/useScrollHideChrome.ts +3 -8
- package/src/features/layouts/chrome/viewport.ts +11 -4
- package/src/features/layouts/filterNavigationForAuthState.spec.ts +5 -3
- package/src/features/layouts/floating/FloatingBottomDock.tsx +263 -43
- package/src/features/layouts/floating/FloatingLayout.tsx +14 -8
- package/src/features/layouts/floating/FloatingSidebar.tsx +178 -81
- package/src/features/layouts/floating/computeFloatingInsets.ts +22 -4
- package/src/features/layouts/floating/moreSections.spec.ts +28 -0
- package/src/features/layouts/floating/moreSections.ts +31 -0
- package/src/features/layouts/floating/useFloatingChrome.ts +3 -1
- package/src/features/layouts/floating/useSoftKeyboard.spec.ts +39 -0
- package/src/features/layouts/floating/useSoftKeyboard.ts +82 -0
- package/src/features/layouts/fullscreen/FullscreenLayout.spec.tsx +68 -0
- package/src/features/layouts/fullscreen/FullscreenLayout.tsx +47 -10
- package/src/features/layouts/sidebar/NavigationContent.tsx +17 -9
- package/src/features/layouts/sidebar/SidebarIcons.tsx +70 -9
- package/src/features/layouts/sidebar/SidebarInner.spec.tsx +149 -0
- package/src/features/layouts/sidebar/SidebarInner.tsx +103 -43
- package/src/features/layouts/sidebar/SidebarLayout.tsx +24 -17
- package/src/features/layouts/utils.ts +4 -3
- package/src/features/layouts/windows/DesktopDots.tsx +76 -0
- package/src/features/layouts/windows/WindowsLayout.tsx +265 -160
- package/src/features/layouts/windows/deskDots.spec.ts +54 -0
- package/src/features/layouts/windows/deskDots.ts +314 -0
- package/src/features/overlays/ResponsiveModal.tsx +5 -3
- package/src/features/overlays/overlaySize.spec.ts +56 -16
- package/src/features/overlays/overlaySize.ts +114 -31
- package/src/features/overlays/phoneDrawerAnchoring.spec.ts +187 -0
- package/src/features/overlays/useOverlayReportedSize.ts +8 -3
- package/src/features/theme/applyTheme.ts +8 -0
- package/src/features/theme/navContrast.spec.ts +49 -0
- package/src/features/theme/navContrast.ts +108 -0
- package/src/i18n/translations/en/common.json +26 -0
- package/src/i18n/translations/fr/common.json +26 -0
- package/src/index.css +1156 -77
- package/src/service-worker/devCaches.spec.ts +32 -0
- package/src/service-worker/devCaches.ts +27 -0
- package/src/service-worker/sw-dev.ts +23 -23
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
Fragment,
|
|
2
3
|
useMemo,
|
|
3
4
|
useState,
|
|
4
5
|
useCallback,
|
|
@@ -28,21 +29,31 @@ import { useSettings } from '../../settings/hooks/useSettings';
|
|
|
28
29
|
import { ContentView } from '../../../components/ContentView';
|
|
29
30
|
import { cn } from '../../../lib/utils';
|
|
30
31
|
import { Z_INDEX } from '../../../lib/z-index';
|
|
32
|
+
import { ShellDivider } from '../../../components/ui/shell-divider';
|
|
31
33
|
import { LoginButton } from '../../auth/components/LoginButton';
|
|
32
34
|
import { useAuth } from '../../auth/hooks/useAuth';
|
|
33
|
-
import { ExternalLinkIcon, NavIcon } from '../sidebar/SidebarIcons';
|
|
35
|
+
import { ExternalLinkIcon, NavIcon, SettingsIcon } from '../sidebar/SidebarIcons';
|
|
36
|
+
import { AppBarTooltip, TooltipProvider } from '../../../components/ui/tooltip';
|
|
37
|
+
import urls from '../../../constants/urls';
|
|
34
38
|
import { getExternalFaviconUrl, isAppIcon } from '../sidebar/sidebarUtils';
|
|
35
39
|
import { AppBrandIcon } from '../branding/AppBrandIcon';
|
|
36
40
|
import { useIsMobile } from '../../../hooks/use-mobile';
|
|
37
41
|
import { readSafeAreaInsetBottom, readSafeAreaInsetTop } from '../chrome/viewport';
|
|
38
42
|
import {
|
|
39
43
|
DESKTOP_TITLEBAR_HEIGHT_PX,
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
SHELL_HEADER_HEIGHT_PX,
|
|
45
|
+
SHELL_HEADER_PAD_TOP_PX,
|
|
42
46
|
} from '../chrome/constants';
|
|
43
47
|
import { DesktopHistoryButtons } from '../chrome/DesktopHistoryButtons';
|
|
44
|
-
import {
|
|
48
|
+
import {
|
|
49
|
+
useIsTauriClient,
|
|
50
|
+
useIsTauriRuntime,
|
|
51
|
+
useMacOverlayChrome,
|
|
52
|
+
useMacTrafficLights,
|
|
53
|
+
} from '../chrome/runtime';
|
|
54
|
+
import { MAC_DRAG_REGION_PROPS, MacLightsSafeArea, MacStripSpacer } from '../chrome/MacStrip';
|
|
45
55
|
import { WindowTitleBarActions } from '../../chromeActions';
|
|
56
|
+
import { DesktopDots } from './DesktopDots';
|
|
46
57
|
|
|
47
58
|
interface WindowsLayoutProps {
|
|
48
59
|
title?: string;
|
|
@@ -219,11 +230,15 @@ function AppWindow({
|
|
|
219
230
|
/** Used to cascade normal size when leaving mobile. */
|
|
220
231
|
cascadeIndex: number;
|
|
221
232
|
}) {
|
|
233
|
+
const { t } = useTranslation();
|
|
222
234
|
const windowLabel = resolveNavLabel(navItem.label, currentLanguage);
|
|
223
235
|
const tauriRuntime = useIsTauriRuntime();
|
|
224
236
|
const isTauriEnv = useIsTauriClient();
|
|
225
237
|
const trafficLights = useMacTrafficLights();
|
|
226
|
-
const
|
|
238
|
+
const macOverlay = useMacOverlayChrome();
|
|
239
|
+
// macOS: 32px strip on top (also in native fullscreen); windows clamp below it.
|
|
240
|
+
const macStrip = trafficLights || macOverlay;
|
|
241
|
+
const topInset = macStrip ? DESKTOP_TITLEBAR_HEIGHT_PX : 0;
|
|
227
242
|
const topInsetRef = useRef(topInset);
|
|
228
243
|
topInsetRef.current = topInset;
|
|
229
244
|
const [frameUuid, setFrameUuid] = useState<string | null>(null);
|
|
@@ -263,7 +278,7 @@ function AppWindow({
|
|
|
263
278
|
)
|
|
264
279
|
: clampBounds(win.bounds, topInset),
|
|
265
280
|
);
|
|
266
|
-
const containerRef = useRef<
|
|
281
|
+
const containerRef = useRef<HTMLElement>(null);
|
|
267
282
|
const dragRef = useRef<{
|
|
268
283
|
startX: number;
|
|
269
284
|
startY: number;
|
|
@@ -391,6 +406,7 @@ function AppWindow({
|
|
|
391
406
|
if (el) {
|
|
392
407
|
el.style.transform = '';
|
|
393
408
|
el.style.willChange = '';
|
|
409
|
+
el.removeAttribute('data-interacting');
|
|
394
410
|
}
|
|
395
411
|
const finalBounds = clampBounds(
|
|
396
412
|
{
|
|
@@ -423,6 +439,7 @@ function AppWindow({
|
|
|
423
439
|
};
|
|
424
440
|
const el = containerRef.current;
|
|
425
441
|
if (el) {
|
|
442
|
+
el.setAttribute('data-interacting', 'true');
|
|
426
443
|
el.setPointerCapture(e.pointerId);
|
|
427
444
|
el.addEventListener('pointermove', onPointerMove, { passive: true });
|
|
428
445
|
el.addEventListener('pointerup', onPointerUp as (e: Event) => void);
|
|
@@ -490,6 +507,7 @@ function AppWindow({
|
|
|
490
507
|
el.removeEventListener('pointermove', onResizePointerMove as (e: Event) => void);
|
|
491
508
|
el.removeEventListener('pointerup', onResizePointerUp as (e: Event) => void);
|
|
492
509
|
el.releasePointerCapture(e.pointerId);
|
|
510
|
+
el.removeAttribute('data-interacting');
|
|
493
511
|
}
|
|
494
512
|
resizeRef.current = null;
|
|
495
513
|
},
|
|
@@ -510,6 +528,7 @@ function AppWindow({
|
|
|
510
528
|
};
|
|
511
529
|
const el = containerRef.current;
|
|
512
530
|
if (el) {
|
|
531
|
+
el.setAttribute('data-interacting', 'true');
|
|
513
532
|
el.setPointerCapture(e.pointerId);
|
|
514
533
|
el.addEventListener('pointermove', onResizePointerMove as (e: Event) => void, {
|
|
515
534
|
passive: true,
|
|
@@ -528,13 +547,16 @@ function AppWindow({
|
|
|
528
547
|
const z = isFocused ? maxZIndex : zIndex;
|
|
529
548
|
|
|
530
549
|
return (
|
|
531
|
-
<
|
|
550
|
+
<section
|
|
532
551
|
ref={containerRef}
|
|
552
|
+
aria-label={windowLabel}
|
|
553
|
+
data-shellui-window=""
|
|
554
|
+
data-focused={isFocused ? 'true' : 'false'}
|
|
555
|
+
data-maximized={lockedChrome ? 'true' : 'false'}
|
|
533
556
|
className={cn(
|
|
534
|
-
'absolute flex flex-col overflow-hidden
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
: 'rounded-lg border border-border shadow-lg',
|
|
557
|
+
'shellui-win absolute flex flex-col overflow-hidden',
|
|
558
|
+
isFocused && 'is-focused',
|
|
559
|
+
mobileFullscreen && 'is-flat',
|
|
538
560
|
)}
|
|
539
561
|
style={{
|
|
540
562
|
left: bounds.x,
|
|
@@ -549,20 +571,23 @@ function AppWindow({
|
|
|
549
571
|
{/* Title bar: pointer capture so drag continues when cursor is over iframe or outside window */}
|
|
550
572
|
<div
|
|
551
573
|
className={cn(
|
|
552
|
-
'flex items-center gap-2 pr-1
|
|
553
|
-
flushTitlebar ? 'box-border' : '
|
|
574
|
+
'shellui-win-titlebar flex items-center gap-2 pr-1 select-none shrink-0',
|
|
575
|
+
flushTitlebar ? 'box-border' : 'pl-2.5',
|
|
554
576
|
lockedChrome ? 'cursor-default' : 'cursor-move',
|
|
555
577
|
)}
|
|
556
578
|
style={
|
|
557
579
|
flushTitlebar
|
|
558
580
|
? {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
581
|
+
// Maximized under a native caption bar (Windows / Linux). macOS keeps its strip.
|
|
582
|
+
height: SHELL_HEADER_HEIGHT_PX,
|
|
583
|
+
paddingTop: SHELL_HEADER_PAD_TOP_PX,
|
|
584
|
+
paddingLeft: 8,
|
|
562
585
|
}
|
|
563
586
|
: undefined
|
|
564
587
|
}
|
|
565
|
-
{...(flushTitlebar
|
|
588
|
+
{...(flushTitlebar
|
|
589
|
+
? { 'data-shellui-drag-region': '', 'data-tauri-drag-region': '' }
|
|
590
|
+
: { 'data-shellui-no-drag': '' })}
|
|
566
591
|
onPointerDown={handleTitlePointerDown}
|
|
567
592
|
>
|
|
568
593
|
{win.icon && (
|
|
@@ -570,7 +595,7 @@ function AppWindow({
|
|
|
570
595
|
src={win.icon}
|
|
571
596
|
alt=""
|
|
572
597
|
className={cn(
|
|
573
|
-
'
|
|
598
|
+
'shellui-win-tile shrink-0 rounded-sm object-cover',
|
|
574
599
|
isAppIcon(win.icon) && 'opacity-90 dark:opacity-100 dark:invert',
|
|
575
600
|
)}
|
|
576
601
|
/>
|
|
@@ -587,13 +612,13 @@ function AppWindow({
|
|
|
587
612
|
e.stopPropagation();
|
|
588
613
|
handleMaximizeToggle();
|
|
589
614
|
}}
|
|
590
|
-
className="
|
|
591
|
-
aria-label={isMaximized ? '
|
|
615
|
+
className="shellui-win-control shellui-chrome-focus"
|
|
616
|
+
aria-label={isMaximized ? t('windows.restore') : t('windows.maximize')}
|
|
592
617
|
>
|
|
593
618
|
{isMaximized ? (
|
|
594
|
-
<RestoreIcon className="
|
|
619
|
+
<RestoreIcon className="size-3.5" />
|
|
595
620
|
) : (
|
|
596
|
-
<MaximizeIcon className="
|
|
621
|
+
<MaximizeIcon className="size-3.5" />
|
|
597
622
|
)}
|
|
598
623
|
</button>
|
|
599
624
|
)}
|
|
@@ -603,14 +628,14 @@ function AppWindow({
|
|
|
603
628
|
e.stopPropagation();
|
|
604
629
|
onClose();
|
|
605
630
|
}}
|
|
606
|
-
className="
|
|
607
|
-
aria-label=
|
|
631
|
+
className="shellui-win-control shellui-win-close shellui-chrome-focus"
|
|
632
|
+
aria-label={t('windows.close')}
|
|
608
633
|
>
|
|
609
|
-
<CloseIcon className="
|
|
634
|
+
<CloseIcon className="size-3.5" />
|
|
610
635
|
</button>
|
|
611
636
|
</div>
|
|
612
637
|
{/* Content */}
|
|
613
|
-
<div className="flex-1 min-h-0 relative bg-background">
|
|
638
|
+
<div className="shellui-win-body flex-1 min-h-0 relative bg-background">
|
|
614
639
|
{/* When not focused, overlay captures clicks to bring window to front */}
|
|
615
640
|
{!isFocused && (
|
|
616
641
|
<div
|
|
@@ -664,7 +689,7 @@ function AppWindow({
|
|
|
664
689
|
onPointerDown={(e) => handleResizePointerDown(e, edge)}
|
|
665
690
|
/>
|
|
666
691
|
))}
|
|
667
|
-
</
|
|
692
|
+
</section>
|
|
668
693
|
);
|
|
669
694
|
}
|
|
670
695
|
|
|
@@ -771,13 +796,17 @@ function getBrowserTimezone(): string {
|
|
|
771
796
|
|
|
772
797
|
export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: WindowsLayoutProps) {
|
|
773
798
|
const location = useLocation();
|
|
774
|
-
const { i18n } = useTranslation();
|
|
799
|
+
const { t, i18n } = useTranslation();
|
|
775
800
|
const { isAuthenticated, isLoading: isAuthLoading } = useAuth();
|
|
776
801
|
const { settings } = useSettings();
|
|
777
802
|
/** Fullscreen phone chrome — includes iPhone landscape (wide but short). */
|
|
778
803
|
const phoneMode = useWindowsPhoneMode();
|
|
779
804
|
const trafficLights = useMacTrafficLights();
|
|
780
|
-
const
|
|
805
|
+
const isTauriEnv = useIsTauriClient();
|
|
806
|
+
const macOverlay = useMacOverlayChrome();
|
|
807
|
+
// macOS: 32px strip on top (also in native fullscreen); windows clamp below it.
|
|
808
|
+
const macStrip = trafficLights || macOverlay;
|
|
809
|
+
const topInset = macStrip ? DESKTOP_TITLEBAR_HEIGHT_PX : 0;
|
|
781
810
|
const currentLanguage = i18n.language || 'en';
|
|
782
811
|
const hasCustomLoginNav = useMemo(() => hasLoginNavigationItem(navigation), [navigation]);
|
|
783
812
|
const authAwareNavigation = useMemo(
|
|
@@ -811,13 +840,24 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
|
|
|
811
840
|
const [startMenuOpen, setStartMenuOpen] = useState(false);
|
|
812
841
|
const [now, setNow] = useState(() => new Date());
|
|
813
842
|
const startPanelRef = useRef<HTMLDivElement>(null);
|
|
843
|
+
const startButtonRef = useRef<HTMLButtonElement>(null);
|
|
844
|
+
const startMenuRef = useRef<HTMLDivElement>(null);
|
|
845
|
+
const desktopRef = useRef<HTMLDivElement>(null);
|
|
814
846
|
const initialOpenFromUrlDoneRef = useRef(false);
|
|
815
847
|
const openPaths = useMemo(() => new Set(windows.map((w) => w.path)), [windows]);
|
|
816
848
|
|
|
817
|
-
//
|
|
849
|
+
// Taskbar clock shows hours and minutes: tick on each minute boundary, not every second.
|
|
818
850
|
useEffect(() => {
|
|
819
|
-
|
|
820
|
-
|
|
851
|
+
let timer: ReturnType<typeof setTimeout>;
|
|
852
|
+
const schedule = () => {
|
|
853
|
+
const current = new Date();
|
|
854
|
+
setNow(current);
|
|
855
|
+
const msToNextMinute =
|
|
856
|
+
60_000 - (current.getSeconds() * 1000 + current.getMilliseconds()) + 50;
|
|
857
|
+
timer = setTimeout(schedule, msToNextMinute);
|
|
858
|
+
};
|
|
859
|
+
schedule();
|
|
860
|
+
return () => clearTimeout(timer);
|
|
821
861
|
}, []);
|
|
822
862
|
|
|
823
863
|
/** Highest z-index: front window always gets this so it stays on top. */
|
|
@@ -898,12 +938,29 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
|
|
|
898
938
|
useEffect(() => {
|
|
899
939
|
if (!startMenuOpen) return;
|
|
900
940
|
const onDocClick = (e: MouseEvent) => {
|
|
941
|
+
// The footer account menu renders in a portal: clicks there stay in the start menu.
|
|
942
|
+
if (e.target instanceof Element && e.target.closest('[data-auth-menu-content]')) return;
|
|
901
943
|
if (startPanelRef.current && !startPanelRef.current.contains(e.target as Node)) {
|
|
902
944
|
setStartMenuOpen(false);
|
|
903
945
|
}
|
|
904
946
|
};
|
|
947
|
+
const onKeyDown = (e: KeyboardEvent) => {
|
|
948
|
+
if (e.key !== 'Escape') return;
|
|
949
|
+
// Escape closes the open account menu first.
|
|
950
|
+
if (document.querySelector('[data-auth-menu-content][data-state="open"]')) return;
|
|
951
|
+
e.preventDefault();
|
|
952
|
+
setStartMenuOpen(false);
|
|
953
|
+
startButtonRef.current?.focus();
|
|
954
|
+
};
|
|
905
955
|
document.addEventListener('mousedown', onDocClick);
|
|
906
|
-
|
|
956
|
+
document.addEventListener('keydown', onKeyDown);
|
|
957
|
+
// Move focus to the first row so keyboard users land inside the menu.
|
|
958
|
+
const first = startMenuRef.current?.querySelector<HTMLElement>('.shellui-start-row');
|
|
959
|
+
first?.focus({ preventScroll: true });
|
|
960
|
+
return () => {
|
|
961
|
+
document.removeEventListener('mousedown', onDocClick);
|
|
962
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
963
|
+
};
|
|
907
964
|
}, [startMenuOpen]);
|
|
908
965
|
|
|
909
966
|
const handleNavClick = useCallback(
|
|
@@ -938,37 +995,49 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
|
|
|
938
995
|
[openWindow, windows, focusWindow, phoneMode],
|
|
939
996
|
);
|
|
940
997
|
|
|
998
|
+
const frontWindowLabel = useMemo(() => {
|
|
999
|
+
const front = windows.find((w) => w.id === frontWindowId);
|
|
1000
|
+
if (!front) return null;
|
|
1001
|
+
const navItem = navigationItems.find((n) => n.path === front.path);
|
|
1002
|
+
return navItem ? resolveNavLabel(navItem.label, currentLanguage) : front.label;
|
|
1003
|
+
}, [windows, frontWindowId, navigationItems, currentLanguage]);
|
|
1004
|
+
|
|
941
1005
|
return (
|
|
942
1006
|
<>
|
|
943
1007
|
<div
|
|
1008
|
+
ref={desktopRef}
|
|
944
1009
|
data-shellui-windows-layout=""
|
|
945
1010
|
className="fixed inset-0 overflow-hidden bg-background"
|
|
946
1011
|
style={{ paddingBottom: TASKBAR_SLOT_CSS }}
|
|
947
1012
|
>
|
|
948
|
-
{/*
|
|
1013
|
+
{/* Desktop: two low primary washes at the bottom, under the dot field. */}
|
|
949
1014
|
<div
|
|
950
1015
|
aria-hidden
|
|
951
|
-
className="pointer-events-none absolute inset-0"
|
|
952
|
-
style={{
|
|
953
|
-
backgroundImage: [
|
|
954
|
-
'radial-gradient(ellipse 95% 70% at 18% 108%, color-mix(in oklch, var(--primary) 32%, transparent), transparent 58%)',
|
|
955
|
-
'radial-gradient(ellipse 70% 55% at 78% 118%, color-mix(in oklch, var(--primary) 22%, transparent), transparent 62%)',
|
|
956
|
-
'radial-gradient(ellipse 55% 40% at 52% 92%, color-mix(in oklch, var(--primary) 14%, transparent), transparent 70%)',
|
|
957
|
-
'radial-gradient(ellipse 40% 30% at 92% 78%, color-mix(in oklch, var(--primary) 10%, transparent), transparent 68%)',
|
|
958
|
-
'radial-gradient(ellipse 35% 28% at 8% 72%, color-mix(in oklch, var(--primary) 8%, transparent), transparent 65%)',
|
|
959
|
-
].join(', '),
|
|
960
|
-
}}
|
|
1016
|
+
className="shellui-desk-wash pointer-events-none absolute inset-0"
|
|
961
1017
|
/>
|
|
1018
|
+
<DesktopDots watchRoot={desktopRef} />
|
|
962
1019
|
|
|
963
|
-
{
|
|
1020
|
+
{macStrip ? (
|
|
1021
|
+
/* macOS strip: safe area 80, back, forward, drag spacer, focused title centred. */
|
|
964
1022
|
<div
|
|
965
1023
|
data-shellui-windows-titlebar=""
|
|
966
|
-
data-shellui-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
className="absolute inset-x-0 top-0 border-b border-border bg-sidebar-background"
|
|
1024
|
+
data-shellui-mac-strip=""
|
|
1025
|
+
{...MAC_DRAG_REGION_PROPS}
|
|
1026
|
+
className="shellui-windows-strip absolute inset-x-0 top-0 flex items-center select-none"
|
|
970
1027
|
style={{ height: DESKTOP_TITLEBAR_HEIGHT_PX, zIndex: Z_INDEX.WINDOWS_TITLEBAR }}
|
|
971
|
-
|
|
1028
|
+
>
|
|
1029
|
+
<MacLightsSafeArea />
|
|
1030
|
+
{isTauriEnv ? <DesktopHistoryButtons strip /> : null}
|
|
1031
|
+
<MacStripSpacer />
|
|
1032
|
+
{frontWindowLabel ? (
|
|
1033
|
+
<span
|
|
1034
|
+
aria-hidden
|
|
1035
|
+
className="shellui-windows-strip-title truncate"
|
|
1036
|
+
>
|
|
1037
|
+
{frontWindowLabel}
|
|
1038
|
+
</span>
|
|
1039
|
+
) : null}
|
|
1040
|
+
</div>
|
|
972
1041
|
) : null}
|
|
973
1042
|
|
|
974
1043
|
{/* Desktop area: windows */}
|
|
@@ -998,7 +1067,11 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
|
|
|
998
1067
|
|
|
999
1068
|
{/* Taskbar */}
|
|
1000
1069
|
<div
|
|
1001
|
-
|
|
1070
|
+
role="region"
|
|
1071
|
+
aria-label={t('windows.taskbar')}
|
|
1072
|
+
data-shellui-taskbar=""
|
|
1073
|
+
data-phone={phoneMode ? 'true' : undefined}
|
|
1074
|
+
className="shellui-taskbar fixed left-0 right-0 bottom-0 flex items-center gap-1 px-2"
|
|
1002
1075
|
style={{
|
|
1003
1076
|
height: TASKBAR_SLOT_CSS,
|
|
1004
1077
|
paddingBottom: 'var(--shellui-safe-area-bottom, 0px)',
|
|
@@ -1019,17 +1092,13 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
|
|
|
1019
1092
|
ref={startPanelRef}
|
|
1020
1093
|
>
|
|
1021
1094
|
<button
|
|
1095
|
+
ref={startButtonRef}
|
|
1022
1096
|
type="button"
|
|
1023
1097
|
onClick={() => setStartMenuOpen((o) => !o)}
|
|
1024
|
-
className={cn(
|
|
1025
|
-
'flex items-center gap-2 h-9 px-3 rounded cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
|
|
1026
|
-
startMenuOpen
|
|
1027
|
-
? 'bg-sidebar-accent text-sidebar-accent-foreground'
|
|
1028
|
-
: 'text-sidebar-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-foreground',
|
|
1029
|
-
)}
|
|
1098
|
+
className={cn('shellui-start shellui-chrome-focus', startMenuOpen && 'is-open')}
|
|
1030
1099
|
aria-expanded={startMenuOpen}
|
|
1031
|
-
aria-haspopup="
|
|
1032
|
-
aria-label=
|
|
1100
|
+
aria-haspopup="dialog"
|
|
1101
|
+
aria-label={title || t('windows.start')}
|
|
1033
1102
|
>
|
|
1034
1103
|
{appIcon ? (
|
|
1035
1104
|
<AppBrandIcon
|
|
@@ -1041,32 +1110,34 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
|
|
|
1041
1110
|
) : (
|
|
1042
1111
|
<StartIcon className="h-5 w-5" />
|
|
1043
1112
|
)}
|
|
1044
|
-
<span className="
|
|
1113
|
+
<span className="shellui-start-name hidden sm:inline">
|
|
1114
|
+
{title || t('windows.start')}
|
|
1115
|
+
</span>
|
|
1045
1116
|
</button>
|
|
1046
1117
|
{/* Start menu panel */}
|
|
1047
1118
|
{startMenuOpen && (
|
|
1048
1119
|
<div
|
|
1049
|
-
|
|
1120
|
+
ref={startMenuRef}
|
|
1121
|
+
className="shellui-start-menu absolute bottom-full left-0 mb-2 flex w-[22rem] max-h-[min(72vh,34rem)] flex-col overflow-hidden text-popover-foreground"
|
|
1050
1122
|
style={{ zIndex: Z_INDEX.MODAL_CONTENT }}
|
|
1051
|
-
role="
|
|
1052
|
-
aria-label={
|
|
1123
|
+
role="dialog"
|
|
1124
|
+
aria-label={t('windows.applications')}
|
|
1053
1125
|
>
|
|
1054
|
-
<div className="
|
|
1126
|
+
<div className="shellui-start-head shrink-0 px-4 py-3">
|
|
1055
1127
|
<p
|
|
1056
|
-
className="
|
|
1128
|
+
className="shellui-start-title"
|
|
1057
1129
|
style={{ fontFamily: 'var(--heading-font-family, inherit)' }}
|
|
1058
1130
|
>
|
|
1059
|
-
{title || '
|
|
1060
|
-
</p>
|
|
1061
|
-
<p className="mt-0.5 text-xs text-muted-foreground">
|
|
1062
|
-
Choose an app to open in a window
|
|
1131
|
+
{title || t('windows.applications')}
|
|
1063
1132
|
</p>
|
|
1133
|
+
<p className="shellui-start-hint text-muted-foreground">{t('windows.chooseApp')}</p>
|
|
1064
1134
|
</div>
|
|
1135
|
+
<ShellDivider />
|
|
1065
1136
|
|
|
1066
|
-
<div className="min-h-0 flex-1
|
|
1137
|
+
<div className="min-h-0 flex-1 overflow-y-auto px-2 py-3">
|
|
1067
1138
|
{menuSections.length === 0 ? (
|
|
1068
1139
|
<p className="px-2 py-6 text-center text-sm text-muted-foreground">
|
|
1069
|
-
|
|
1140
|
+
{t('windows.noApps')}
|
|
1070
1141
|
</p>
|
|
1071
1142
|
) : (
|
|
1072
1143
|
menuSections.map((section, sectionIndex) => {
|
|
@@ -1080,7 +1151,7 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
|
|
|
1080
1151
|
sectionIndex === menuSections.length - 1 &&
|
|
1081
1152
|
section.type === 'items' &&
|
|
1082
1153
|
section.items === endNavItems;
|
|
1083
|
-
|
|
1154
|
+
const sectionNode = (
|
|
1084
1155
|
<section
|
|
1085
1156
|
key={
|
|
1086
1157
|
section.type === 'group'
|
|
@@ -1091,14 +1162,11 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
|
|
|
1091
1162
|
}
|
|
1092
1163
|
className={cn(
|
|
1093
1164
|
'space-y-1.5',
|
|
1094
|
-
isEndSection
|
|
1165
|
+
isEndSection ? 'pt-3' : sectionIndex > 0 && 'mt-4',
|
|
1095
1166
|
)}
|
|
1096
1167
|
>
|
|
1097
1168
|
{categoryLabel ? (
|
|
1098
|
-
<h2
|
|
1099
|
-
className="px-2.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground"
|
|
1100
|
-
style={{ fontFamily: 'var(--heading-font-family, inherit)' }}
|
|
1101
|
-
>
|
|
1169
|
+
<h2 className="shellui-start-label px-2.5 text-xs font-semibold text-muted-foreground">
|
|
1102
1170
|
{categoryLabel}
|
|
1103
1171
|
</h2>
|
|
1104
1172
|
) : null}
|
|
@@ -1114,23 +1182,13 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
|
|
|
1114
1182
|
<button
|
|
1115
1183
|
key={item.path}
|
|
1116
1184
|
type="button"
|
|
1117
|
-
role="menuitem"
|
|
1118
1185
|
onClick={() => handleNavClick(item)}
|
|
1119
1186
|
className={cn(
|
|
1120
|
-
'
|
|
1121
|
-
'
|
|
1122
|
-
'hover:bg-accent hover:text-accent-foreground',
|
|
1123
|
-
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-popover',
|
|
1124
|
-
isOpen && 'bg-accent/50',
|
|
1187
|
+
'shellui-start-row shellui-chrome-focus group',
|
|
1188
|
+
isOpen && 'is-open',
|
|
1125
1189
|
)}
|
|
1126
1190
|
>
|
|
1127
|
-
<span
|
|
1128
|
-
className={cn(
|
|
1129
|
-
'flex size-9 shrink-0 items-center justify-center rounded-md',
|
|
1130
|
-
'bg-muted/70 text-foreground ring-1 ring-border/50',
|
|
1131
|
-
'group-hover:bg-background/80 group-hover:ring-border',
|
|
1132
|
-
)}
|
|
1133
|
-
>
|
|
1191
|
+
<span className="shellui-start-tile">
|
|
1134
1192
|
<NavIcon
|
|
1135
1193
|
src={icon}
|
|
1136
1194
|
className="size-4"
|
|
@@ -1142,12 +1200,15 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
|
|
|
1142
1200
|
</span>
|
|
1143
1201
|
{isOpen && !isOverlay && !isExternal ? (
|
|
1144
1202
|
<span className="mt-0.5 block text-[11px] text-muted-foreground">
|
|
1145
|
-
|
|
1203
|
+
{t('windows.open')}
|
|
1146
1204
|
</span>
|
|
1147
1205
|
) : null}
|
|
1148
1206
|
</span>
|
|
1149
1207
|
{isExternal ? (
|
|
1150
|
-
|
|
1208
|
+
<>
|
|
1209
|
+
<ExternalLinkIcon className="size-3.5 shrink-0 opacity-50 group-hover:opacity-80" />
|
|
1210
|
+
<span className="sr-only">{t('shellChrome.externalLink')}</span>
|
|
1211
|
+
</>
|
|
1151
1212
|
) : isOpen && !isOverlay ? (
|
|
1152
1213
|
<span
|
|
1153
1214
|
className="size-1.5 shrink-0 rounded-full bg-primary"
|
|
@@ -1160,16 +1221,52 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
|
|
|
1160
1221
|
</div>
|
|
1161
1222
|
</section>
|
|
1162
1223
|
);
|
|
1224
|
+
return isEndSection ? (
|
|
1225
|
+
<Fragment key="end-items">
|
|
1226
|
+
<ShellDivider className="-mx-2 mt-4" />
|
|
1227
|
+
{sectionNode}
|
|
1228
|
+
</Fragment>
|
|
1229
|
+
) : (
|
|
1230
|
+
sectionNode
|
|
1231
|
+
);
|
|
1163
1232
|
})
|
|
1164
1233
|
)}
|
|
1165
1234
|
</div>
|
|
1235
|
+
{/* Footer: account and settings (spec). */}
|
|
1236
|
+
<ShellDivider />
|
|
1237
|
+
<div
|
|
1238
|
+
data-shellui-start-footer=""
|
|
1239
|
+
className="shellui-start-foot flex shrink-0 items-center gap-1 px-2 py-1.5"
|
|
1240
|
+
>
|
|
1241
|
+
<div className="min-w-0 flex-1">
|
|
1242
|
+
<LoginButton
|
|
1243
|
+
variant="sidebar"
|
|
1244
|
+
hideWhenLoggedOut={hasCustomLoginNav}
|
|
1245
|
+
/>
|
|
1246
|
+
</div>
|
|
1247
|
+
<button
|
|
1248
|
+
type="button"
|
|
1249
|
+
className="shellui-start-settings shellui-chrome-focus"
|
|
1250
|
+
aria-label={t('settings')}
|
|
1251
|
+
title={t('settings')}
|
|
1252
|
+
onClick={() => {
|
|
1253
|
+
setStartMenuOpen(false);
|
|
1254
|
+
shellui.openModal(urls.settings);
|
|
1255
|
+
}}
|
|
1256
|
+
>
|
|
1257
|
+
<SettingsIcon className="size-4" />
|
|
1258
|
+
</button>
|
|
1259
|
+
</div>
|
|
1166
1260
|
</div>
|
|
1167
1261
|
)}
|
|
1168
1262
|
</div>
|
|
1169
1263
|
|
|
1170
1264
|
{/* Window list — desktop only; phone switches via the start menu */}
|
|
1171
1265
|
{!phoneMode && (
|
|
1172
|
-
<
|
|
1266
|
+
<ul
|
|
1267
|
+
aria-label={t('windows.openApps')}
|
|
1268
|
+
className="shellui-task-list flex-1 flex items-center gap-1 min-w-0 overflow-x-auto"
|
|
1269
|
+
>
|
|
1173
1270
|
{windows.map((win) => {
|
|
1174
1271
|
const navItem = navigationItems.find((n) => n.path === win.path);
|
|
1175
1272
|
const windowLabel = navItem
|
|
@@ -1177,77 +1274,86 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
|
|
|
1177
1274
|
: win.label;
|
|
1178
1275
|
const isFocused = win.id === frontWindowId;
|
|
1179
1276
|
return (
|
|
1180
|
-
<
|
|
1277
|
+
<li
|
|
1181
1278
|
key={win.id}
|
|
1182
|
-
|
|
1183
|
-
onClick={() => focusWindow(win.id)}
|
|
1184
|
-
onContextMenu={(e) => {
|
|
1185
|
-
e.preventDefault();
|
|
1186
|
-
closeWindow(win.id);
|
|
1187
|
-
}}
|
|
1188
|
-
className={cn(
|
|
1189
|
-
'flex items-center gap-2 h-8 px-2 rounded min-w-0 max-w-[140px] shrink-0 cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
|
|
1190
|
-
isFocused
|
|
1191
|
-
? 'bg-sidebar-accent text-sidebar-accent-foreground'
|
|
1192
|
-
: 'text-sidebar-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-foreground',
|
|
1193
|
-
)}
|
|
1194
|
-
title={windowLabel}
|
|
1279
|
+
className="shrink-0"
|
|
1195
1280
|
>
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1281
|
+
<button
|
|
1282
|
+
type="button"
|
|
1283
|
+
aria-current={isFocused ? 'true' : undefined}
|
|
1284
|
+
onClick={() => focusWindow(win.id)}
|
|
1285
|
+
onContextMenu={(e) => {
|
|
1286
|
+
e.preventDefault();
|
|
1287
|
+
closeWindow(win.id);
|
|
1288
|
+
}}
|
|
1289
|
+
className={cn('shellui-task shellui-chrome-focus', isFocused && 'is-focused')}
|
|
1290
|
+
title={windowLabel}
|
|
1291
|
+
>
|
|
1292
|
+
{win.icon ? (
|
|
1293
|
+
<img
|
|
1294
|
+
src={win.icon}
|
|
1295
|
+
alt=""
|
|
1296
|
+
className={cn(
|
|
1297
|
+
'h-4 w-4 shrink-0 rounded-sm object-cover',
|
|
1298
|
+
isAppIcon(win.icon) && 'opacity-90 dark:opacity-100 dark:invert',
|
|
1299
|
+
)}
|
|
1300
|
+
/>
|
|
1301
|
+
) : (
|
|
1302
|
+
<span className="h-4 w-4 shrink-0 rounded-sm bg-muted" />
|
|
1303
|
+
)}
|
|
1304
|
+
<span className="truncate">{windowLabel}</span>
|
|
1305
|
+
</button>
|
|
1306
|
+
</li>
|
|
1210
1307
|
);
|
|
1211
1308
|
})}
|
|
1212
|
-
</
|
|
1309
|
+
</ul>
|
|
1213
1310
|
)}
|
|
1214
1311
|
{phoneMode && <div className="flex-1 min-w-0" />}
|
|
1215
1312
|
|
|
1216
1313
|
{/* End navigation items (right side of taskbar) — desktop only; phone uses start menu */}
|
|
1217
1314
|
{!phoneMode && endNavItems.length > 0 && (
|
|
1218
|
-
<
|
|
1219
|
-
{
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1315
|
+
<TooltipProvider
|
|
1316
|
+
delayDuration={200}
|
|
1317
|
+
skipDelayDuration={0}
|
|
1318
|
+
>
|
|
1319
|
+
<div
|
|
1320
|
+
data-shellui-taskbar-end=""
|
|
1321
|
+
className="ml-1 flex shrink-0 items-center gap-0.5 border-l border-sidebar-border pl-2"
|
|
1322
|
+
>
|
|
1323
|
+
{endNavItems.map((item) => {
|
|
1324
|
+
const label =
|
|
1325
|
+
typeof item.label === 'string'
|
|
1326
|
+
? item.label
|
|
1327
|
+
: resolveNavLabel(item.label, currentLanguage);
|
|
1328
|
+
const icon =
|
|
1329
|
+
item.icon ??
|
|
1330
|
+
(item.openIn === 'external' ? getExternalFaviconUrl(item.url) : null);
|
|
1331
|
+
return (
|
|
1332
|
+
<AppBarTooltip
|
|
1333
|
+
key={item.path}
|
|
1334
|
+
label={label}
|
|
1335
|
+
side="top"
|
|
1336
|
+
>
|
|
1337
|
+
<button
|
|
1338
|
+
type="button"
|
|
1339
|
+
onClick={() => handleNavClick(item)}
|
|
1340
|
+
className="shellui-task shellui-task-icon shellui-chrome-focus"
|
|
1341
|
+
aria-label={
|
|
1342
|
+
item.openIn === 'external'
|
|
1343
|
+
? `${label} (${t('shellChrome.externalLink')})`
|
|
1344
|
+
: label
|
|
1345
|
+
}
|
|
1346
|
+
>
|
|
1347
|
+
<NavIcon
|
|
1348
|
+
src={icon}
|
|
1349
|
+
className="size-4"
|
|
1350
|
+
/>
|
|
1351
|
+
</button>
|
|
1352
|
+
</AppBarTooltip>
|
|
1353
|
+
);
|
|
1354
|
+
})}
|
|
1355
|
+
</div>
|
|
1356
|
+
</TooltipProvider>
|
|
1251
1357
|
)}
|
|
1252
1358
|
|
|
1253
1359
|
<div className="flex items-center shrink-0 border-l border-sidebar-border pl-2 ml-1">
|
|
@@ -1259,30 +1365,29 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
|
|
|
1259
1365
|
|
|
1260
1366
|
{/* Date and time (extreme bottom right, OS-style); uses region timezone from settings */}
|
|
1261
1367
|
<div
|
|
1262
|
-
className="flex flex-col items-end justify-center shrink-0 px-3 py-1
|
|
1368
|
+
className="shellui-clock flex flex-col items-end justify-center shrink-0 px-3 py-1 ml-1 min-w-0"
|
|
1263
1369
|
style={{ paddingRight: 'max(0.75rem, env(safe-area-inset-right))' }}
|
|
1264
1370
|
role="timer"
|
|
1265
1371
|
aria-live="off"
|
|
1266
1372
|
aria-label={new Intl.DateTimeFormat(currentLanguage, {
|
|
1267
1373
|
timeZone,
|
|
1268
1374
|
dateStyle: 'full',
|
|
1269
|
-
timeStyle: '
|
|
1375
|
+
timeStyle: 'short',
|
|
1270
1376
|
}).format(now)}
|
|
1271
1377
|
>
|
|
1272
1378
|
<time
|
|
1273
1379
|
dateTime={now.toISOString()}
|
|
1274
|
-
className="
|
|
1380
|
+
className="shellui-clock-time tabular-nums whitespace-nowrap"
|
|
1275
1381
|
>
|
|
1276
1382
|
{new Intl.DateTimeFormat(currentLanguage, {
|
|
1277
1383
|
timeZone,
|
|
1278
1384
|
hour: '2-digit',
|
|
1279
1385
|
minute: '2-digit',
|
|
1280
|
-
second: '2-digit',
|
|
1281
1386
|
}).format(now)}
|
|
1282
1387
|
</time>
|
|
1283
1388
|
<time
|
|
1284
1389
|
dateTime={now.toISOString()}
|
|
1285
|
-
className="
|
|
1390
|
+
className="shellui-clock-date whitespace-nowrap"
|
|
1286
1391
|
>
|
|
1287
1392
|
{new Intl.DateTimeFormat(currentLanguage, {
|
|
1288
1393
|
timeZone,
|