@visin/frontend-core 1.24.0 → 1.26.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 +46 -0
- package/dist/components/AppLayout/AccountMenu.d.ts +5 -4
- package/dist/components/AppLayout/AccountMenu.d.ts.map +1 -1
- package/dist/components/AppLayout/AccountMenu.js +7 -16
- package/dist/components/AppLayout/AccountMenu.js.map +1 -1
- package/dist/components/AppLayout/AppLayout.d.ts +7 -2
- package/dist/components/AppLayout/AppLayout.d.ts.map +1 -1
- package/dist/components/AppLayout/AppLayout.js +100 -20
- package/dist/components/AppLayout/AppLayout.js.map +1 -1
- package/dist/components/AppLayout/MoreSheet.d.ts +34 -0
- package/dist/components/AppLayout/MoreSheet.d.ts.map +1 -0
- package/dist/components/AppLayout/MoreSheet.js +82 -0
- package/dist/components/AppLayout/MoreSheet.js.map +1 -0
- package/dist/components/AppLayout/NavButton.d.ts +11 -4
- package/dist/components/AppLayout/NavButton.d.ts.map +1 -1
- package/dist/components/AppLayout/NavButton.js +7 -4
- package/dist/components/AppLayout/NavButton.js.map +1 -1
- package/dist/components/AppLayout/barBack.d.ts +23 -0
- package/dist/components/AppLayout/barBack.d.ts.map +1 -0
- package/dist/components/AppLayout/barBack.js +26 -0
- package/dist/components/AppLayout/barBack.js.map +1 -0
- package/dist/components/AppLayout/index.d.ts +2 -1
- package/dist/components/AppLayout/index.d.ts.map +1 -1
- package/dist/components/AppLayout/index.js +1 -0
- package/dist/components/AppLayout/index.js.map +1 -1
- package/dist/components/AppLayout/types.d.ts +31 -0
- package/dist/components/AppLayout/types.d.ts.map +1 -1
- package/dist/components/Page/PageHeader.d.ts +1 -1
- package/dist/components/Page/PageHeader.d.ts.map +1 -1
- package/dist/components/Page/PageHeader.js +23 -1
- package/dist/components/Page/PageHeader.js.map +1 -1
- package/dist/components/Page/index.d.ts +1 -1
- package/dist/components/Page/index.d.ts.map +1 -1
- package/dist/components/Page/index.js +1 -1
- package/dist/components/Page/index.js.map +1 -1
- package/dist/components/Page/layout.d.ts +13 -0
- package/dist/components/Page/layout.d.ts.map +1 -1
- package/dist/components/Page/layout.js +52 -0
- package/dist/components/Page/layout.js.map +1 -1
- package/dist/config/createConfigProvider.d.ts +2 -1
- package/dist/config/createConfigProvider.d.ts.map +1 -1
- package/dist/config/createConfigProvider.js +9 -2
- package/dist/config/createConfigProvider.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/navigation.d.ts.map +1 -1
- package/dist/navigation.js +5 -2
- package/dist/navigation.js.map +1 -1
- package/dist/observability/index.d.ts +55 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +280 -0
- package/dist/observability/index.js.map +1 -0
- package/package.json +12 -3
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Avatar, Box, Button, Divider, Drawer, ListItemIcon, ListItemText, ListSubheader, MenuItem, MenuList, ToggleButton, ToggleButtonGroup, Typography, useColorScheme } from '@mui/material';
|
|
3
|
+
import { Logout } from '@mui/icons-material';
|
|
4
|
+
import { glass } from '../../theme';
|
|
5
|
+
import { linkProps } from './navLinks';
|
|
6
|
+
import { userInitial } from './AccountMenu';
|
|
7
|
+
/**
|
|
8
|
+
* What a phone's tab bar has no room for: the places past its last tab, what the person can create, who they are,
|
|
9
|
+
* the appearance and the links out of the app. One sheet for everyone, signed in or not, so the bar above does not
|
|
10
|
+
* need a button for each of them.
|
|
11
|
+
*/
|
|
12
|
+
export function MoreSheet({ open, onClose, isAuthenticated, authPending = false, user, places, isPlaceActive, createItems, menuItems, accountHome, siteLinks, renderItem, onLogin, onSignup, onLogout }) {
|
|
13
|
+
const { mode, setMode } = useColorScheme();
|
|
14
|
+
const list = [];
|
|
15
|
+
const divider = (key) => {
|
|
16
|
+
if (list.length > 0)
|
|
17
|
+
list.push(_jsx(Divider, {}, key));
|
|
18
|
+
};
|
|
19
|
+
if (isAuthenticated) {
|
|
20
|
+
list.push(_jsxs(MenuItem, { ...(accountHome
|
|
21
|
+
? { ...linkProps(accountHome), onClick: onClose, title: 'Account settings' }
|
|
22
|
+
: { disabled: true }), sx: { gap: 1.5, py: 1.25, '&.Mui-disabled': { opacity: 1 } }, children: [_jsx(Avatar, { src: user?.picture, alt: "", sx: { width: 36, height: 36, bgcolor: 'secondary.main' }, children: userInitial(user) }), _jsxs(Box, { sx: { minWidth: 0 }, children: [_jsx(Typography, { noWrap: true, sx: { fontWeight: 700 }, children: user?.name || 'User' }), user?.email && (_jsx(Typography, { noWrap: true, variant: "body2", sx: { color: 'text.secondary' }, children: user.email }))] })] }, "who"));
|
|
23
|
+
}
|
|
24
|
+
if (places.length > 0) {
|
|
25
|
+
divider('places-divider');
|
|
26
|
+
list.push(_jsx(ListSubheader, { sx: { background: 'transparent', lineHeight: '32px' }, children: "More" }, "places-heading"));
|
|
27
|
+
for (const group of places) {
|
|
28
|
+
const target = group.items[0];
|
|
29
|
+
list.push(_jsxs(MenuItem, { ...linkProps(target), selected: isPlaceActive(group), onClick: onClose, children: [_jsx(ListItemIcon, { children: group.icon }), _jsx(ListItemText, { children: group.label })] }, `place-${group.label}`));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (isAuthenticated && createItems.length > 0) {
|
|
33
|
+
divider('create-divider');
|
|
34
|
+
list.push(_jsx(ListSubheader, { sx: { background: 'transparent', lineHeight: '32px' }, children: "New" }, "create-heading"));
|
|
35
|
+
for (const item of createItems)
|
|
36
|
+
list.push(renderItem(item, onClose));
|
|
37
|
+
}
|
|
38
|
+
if (isAuthenticated && menuItems.length > 0) {
|
|
39
|
+
divider('account-divider');
|
|
40
|
+
for (const item of menuItems)
|
|
41
|
+
list.push(renderItem(item, onClose));
|
|
42
|
+
}
|
|
43
|
+
if (siteLinks.length > 0) {
|
|
44
|
+
divider('links-divider');
|
|
45
|
+
for (const link of siteLinks) {
|
|
46
|
+
list.push(_jsxs(MenuItem, { component: "a", href: link.href, ...(link.newTab ? { target: '_blank', rel: 'noopener noreferrer' } : {}), onClick: onClose, children: [link.icon && _jsx(ListItemIcon, { children: link.icon }), _jsx(ListItemText, { inset: !link.icon, children: link.text })] }, `link-${link.href}`));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return (_jsxs(Drawer, { anchor: "bottom", open: open, onClose: onClose, slotProps: {
|
|
50
|
+
paper: {
|
|
51
|
+
sx: {
|
|
52
|
+
...glass,
|
|
53
|
+
borderBottom: 'none',
|
|
54
|
+
borderTopLeftRadius: 20,
|
|
55
|
+
borderTopRightRadius: 20,
|
|
56
|
+
maxHeight: '85dvh',
|
|
57
|
+
// The list scrolls; the appearance and signing in or out stay at the foot, where they are always in reach.
|
|
58
|
+
display: 'flex',
|
|
59
|
+
flexDirection: 'column',
|
|
60
|
+
pb: 'calc(8px + env(safe-area-inset-bottom))'
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}, children: [_jsx(Box, { "aria-hidden": true, sx: { width: 36, height: 4, borderRadius: 2, bgcolor: 'divider', mx: 'auto', mt: 1.25 } }), list.length > 0 && (_jsx(MenuList, { "aria-label": "More", autoFocusItem: open, sx: { flex: '1 1 auto', minHeight: 0, overflowY: 'auto' }, children: list })), _jsx(Divider, { sx: { flexShrink: 0 } }), _jsxs(Box, { sx: {
|
|
64
|
+
display: 'flex',
|
|
65
|
+
alignItems: 'center',
|
|
66
|
+
justifyContent: 'space-between',
|
|
67
|
+
gap: 2,
|
|
68
|
+
px: 2,
|
|
69
|
+
py: 1.5,
|
|
70
|
+
flexShrink: 0
|
|
71
|
+
}, children: [_jsx(Typography, { id: "more-appearance", sx: { fontWeight: 500 }, children: "Appearance" }), _jsxs(ToggleButtonGroup, { exclusive: true, size: "small", value: mode ?? 'system', onChange: (_event, next) => next && setMode(next), "aria-labelledby": "more-appearance", children: [_jsx(ToggleButton, { value: "light", children: "Light" }), _jsx(ToggleButton, { value: "dark", children: "Dark" }), _jsx(ToggleButton, { value: "system", children: "Auto" })] })] }), isAuthenticated && (_jsx(Box, { sx: { px: 1, flexShrink: 0 }, children: _jsx(Button, { fullWidth: true, color: "inherit", startIcon: _jsx(Logout, { fontSize: "small" }), onClick: () => {
|
|
72
|
+
onClose();
|
|
73
|
+
onLogout();
|
|
74
|
+
}, sx: { justifyContent: 'flex-start', px: 1.5, py: 1, fontWeight: 500 }, children: "Sign out" }) })), !isAuthenticated && !authPending && (_jsxs(Box, { sx: { display: 'flex', gap: 1, px: 2, pb: 1, pt: 0.5, flexShrink: 0 }, children: [_jsx(Button, { fullWidth: true, variant: onSignup ? 'outlined' : 'contained', onClick: () => {
|
|
75
|
+
onClose();
|
|
76
|
+
onLogin?.();
|
|
77
|
+
}, children: "Sign in" }), onSignup && (_jsx(Button, { fullWidth: true, variant: "contained", onClick: () => {
|
|
78
|
+
onClose();
|
|
79
|
+
onSignup();
|
|
80
|
+
}, children: "Sign up" }))] }))] }));
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=MoreSheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoreSheet.js","sourceRoot":"","sources":["../../../src/components/AppLayout/MoreSheet.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,MAAM,EACN,GAAG,EACH,MAAM,EACN,OAAO,EACP,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,cAAc,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA4B5C;;;;GAIG;AACH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Event, ReactNode } from 'react';
|
|
2
2
|
import { AppLayoutNavItem } from './types';
|
|
3
3
|
interface NavButtonProps {
|
|
4
4
|
label: string;
|
|
@@ -8,9 +8,16 @@ interface NavButtonProps {
|
|
|
8
8
|
/** The group being shown, announced as such. */
|
|
9
9
|
current: boolean;
|
|
10
10
|
mobile: boolean;
|
|
11
|
-
/** Where the entry leads. */
|
|
12
|
-
target
|
|
11
|
+
/** Where the entry leads. Left out, the entry is a button that opens something (the phone's More sheet). */
|
|
12
|
+
target?: AppLayoutNavItem;
|
|
13
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
14
|
+
/** For a button: whether what it opens is showing. */
|
|
15
|
+
expanded?: boolean;
|
|
16
|
+
/** A count on the icon; nothing at 0. */
|
|
17
|
+
badge?: number;
|
|
18
|
+
/** Read out in place of the label, when the badge carries more. */
|
|
19
|
+
ariaLabel?: string;
|
|
13
20
|
}
|
|
14
|
-
export declare function NavButton({ label, icon, active, current, mobile, target }: NavButtonProps): import("react").JSX.Element;
|
|
21
|
+
export declare function NavButton({ label, icon, active, current, mobile, target, onClick, expanded, badge, ariaLabel }: NavButtonProps): import("react").JSX.Element;
|
|
15
22
|
export {};
|
|
16
23
|
//# sourceMappingURL=NavButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavButton.d.ts","sourceRoot":"","sources":["../../../src/components/AppLayout/NavButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"NavButton.d.ts","sourceRoot":"","sources":["../../../src/components/AppLayout/NavButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3C,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,gDAAgD;IAChD,MAAM,EAAE,OAAO,CAAC;IAChB,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,4GAA4G;IAC5G,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACnD,sDAAsD;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAS,EAAE,SAAS,EAAE,EAAE,cAAc,+BAkGlI"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, ButtonBase, useTheme } from '@mui/material';
|
|
2
|
+
import { Badge, Box, ButtonBase, useTheme } from '@mui/material';
|
|
3
3
|
import { chrome, livePalette, surface } from '../../theme';
|
|
4
4
|
import { linkProps } from './navLinks';
|
|
5
|
-
export function NavButton({ label, icon, active, current, mobile, target }) {
|
|
5
|
+
export function NavButton({ label, icon, active, current, mobile, target, onClick, expanded, badge = 0, ariaLabel }) {
|
|
6
6
|
const theme = useTheme();
|
|
7
7
|
const palette = livePalette(theme);
|
|
8
8
|
// The rail and the phone's tab bar are the same frosted chrome, in either scheme.
|
|
@@ -41,7 +41,7 @@ export function NavButton({ label, icon, active, current, mobile, target }) {
|
|
|
41
41
|
'&:active .nav-pill': { transform: 'scale(0.94)' },
|
|
42
42
|
'&.Mui-focusVisible .nav-pill': { outline: `2px solid ${tone.focus}`, outlineOffset: 1 }
|
|
43
43
|
};
|
|
44
|
-
const body = (_jsxs(_Fragment, { children: [_jsx(Box, { className: "nav-pill", "aria-hidden": true, children: icon }), _jsx(Box, { component: "span", sx: {
|
|
44
|
+
const body = (_jsxs(_Fragment, { children: [_jsx(Box, { className: "nav-pill", "aria-hidden": true, children: badge > 0 ? (_jsx(Badge, { badgeContent: badge, color: "error", max: 99, children: icon })) : (icon) }), _jsx(Box, { component: "span", sx: {
|
|
45
45
|
maxWidth: '100%',
|
|
46
46
|
fontSize: mobile ? 11 : 11.5,
|
|
47
47
|
fontWeight: active ? 700 : 500,
|
|
@@ -50,6 +50,9 @@ export function NavButton({ label, icon, active, current, mobile, target }) {
|
|
|
50
50
|
overflow: 'hidden',
|
|
51
51
|
textOverflow: 'ellipsis'
|
|
52
52
|
}, children: label })] }));
|
|
53
|
-
|
|
53
|
+
if (!target) {
|
|
54
|
+
return (_jsx(ButtonBase, { onClick: onClick, "aria-label": ariaLabel, "aria-haspopup": "dialog", "aria-expanded": expanded, disableRipple: true, sx: sx, children: body }));
|
|
55
|
+
}
|
|
56
|
+
return (_jsx(ButtonBase, { ...linkProps(target), "aria-current": current ? 'true' : undefined, "aria-label": ariaLabel, disableRipple: true, sx: sx, children: body }));
|
|
54
57
|
}
|
|
55
58
|
//# sourceMappingURL=NavButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavButton.js","sourceRoot":"","sources":["../../../src/components/AppLayout/NavButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"NavButton.js","sourceRoot":"","sources":["../../../src/components/AppLayout/NavButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa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L,CACJ,CAAC;IAEF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,CACL,KAAC,UAAU,IACT,OAAO,EAAE,OAAO,gBACJ,SAAS,mBACP,QAAQ,mBACP,QAAQ,EACvB,aAAa,QACb,EAAE,EAAE,EAAE,YAEL,IAAI,GACM,CACd,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAC,UAAU,OACL,SAAS,CAAC,MAAM,CAAC,kBACP,OAAO,CAAC,CAAC,CAAE,MAAgB,CAAC,CAAC,CAAC,SAAS,gBACzC,SAAS,EACrB,aAAa,QACb,EAAE,EAAE,EAAE,YAEL,IAAI,GACM,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface Window {
|
|
3
|
+
/** Where the phone's app bar says "back" leads, while it shows one: for a page that would offer the same link. */
|
|
4
|
+
__visinBarBack?: BarBack;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
/** The app bar's way back: where it leads and what it is called. */
|
|
8
|
+
export interface BarBack {
|
|
9
|
+
path: string;
|
|
10
|
+
label: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Tells pages where the app bar's way back goes. The bar and a page's own back link (a breadcrumb) are drawn by
|
|
14
|
+
* different bundles when a front runs inside the shell, which share no React context, so this is a window value and an
|
|
15
|
+
* event, as the shell does for the rest of what a remote cannot reach.
|
|
16
|
+
*/
|
|
17
|
+
export declare function publishBarBack(back: BarBack | undefined): void;
|
|
18
|
+
/**
|
|
19
|
+
* Where the app bar's back link leads, and what it says, if it shows one. A page leaves its own link out when it
|
|
20
|
+
* goes to the same place or says the same thing.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useBarBack(): BarBack | undefined;
|
|
23
|
+
//# sourceMappingURL=barBack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"barBack.d.ts","sourceRoot":"","sources":["../../../src/components/AppLayout/barBack.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,kHAAkH;QAClH,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B;CACF;AAID,oEAAoE;AACpE,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAK9D;AAOD;;;GAGG;AACH,wBAAgB,UAAU,IAAI,OAAO,GAAG,SAAS,CAMhD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useSyncExternalStore } from 'react';
|
|
2
|
+
const EVENT = 'visin:bar-back';
|
|
3
|
+
/**
|
|
4
|
+
* Tells pages where the app bar's way back goes. The bar and a page's own back link (a breadcrumb) are drawn by
|
|
5
|
+
* different bundles when a front runs inside the shell, which share no React context, so this is a window value and an
|
|
6
|
+
* event, as the shell does for the rest of what a remote cannot reach.
|
|
7
|
+
*/
|
|
8
|
+
export function publishBarBack(back) {
|
|
9
|
+
const current = typeof window === 'undefined' ? undefined : window.__visinBarBack;
|
|
10
|
+
if (typeof window === 'undefined' || (current?.path === back?.path && current?.label === back?.label))
|
|
11
|
+
return;
|
|
12
|
+
window.__visinBarBack = back;
|
|
13
|
+
window.dispatchEvent(new Event(EVENT));
|
|
14
|
+
}
|
|
15
|
+
const subscribe = (listener) => {
|
|
16
|
+
window.addEventListener(EVENT, listener);
|
|
17
|
+
return () => window.removeEventListener(EVENT, listener);
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Where the app bar's back link leads, and what it says, if it shows one. A page leaves its own link out when it
|
|
21
|
+
* goes to the same place or says the same thing.
|
|
22
|
+
*/
|
|
23
|
+
export function useBarBack() {
|
|
24
|
+
return useSyncExternalStore(subscribe, () => window.__visinBarBack, () => undefined);
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=barBack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"barBack.js","sourceRoot":"","sources":["../../../src/components/AppLayout/barBack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAS7C,MAAM,KAAK,GAAG,gBAAgB,CAAC;AAQ/B;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,IAAyB;IACtD,MAAM,OAAO,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC;IAClF,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,OAAO,EAAE,IAAI,KAAK,IAAI,EAAE,IAAI,IAAI,OAAO,EAAE,KAAK,KAAK,IAAI,EAAE,KAAK,CAAC;QAAE,OAAO;IAC9G,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;IAC7B,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,QAAoB,EAAE,EAAE;IACzC,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACzC,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,oBAAoB,CACzB,SAAS,EACT,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,EAC3B,GAAG,EAAE,CAAC,SAAS,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { AppLayout } from './AppLayout';
|
|
2
|
-
export type { AppLayoutProps, AppLayoutNavGroup, AppLayoutNavItem, AppLayoutInternalNavItem, AppLayoutExternalNavItem, AppLayoutRecent, AppLayoutSiteLink, AppLayoutUser } from './AppLayout';
|
|
2
|
+
export type { AppLayoutProps, AppLayoutCenterTab, AppLayoutNavGroup, AppLayoutNavItem, AppLayoutInternalNavItem, AppLayoutExternalNavItem, AppLayoutRecent, AppLayoutSiteLink, AppLayoutUser } from './AppLayout';
|
|
3
|
+
export { useBarBack } from './barBack';
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AppLayout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACd,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AppLayout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/AppLayout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/AppLayout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAYxC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -47,6 +47,22 @@ export interface AppLayoutSiteLink {
|
|
|
47
47
|
/** Opens beside the app instead of replacing it, for a site that is not Visin's own. */
|
|
48
48
|
newTab?: boolean;
|
|
49
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* A tab of the phone's bar that is not one of the groups: an app's own place (the shell's Chat), drawn between them,
|
|
52
|
+
* under the thumb.
|
|
53
|
+
*/
|
|
54
|
+
export interface AppLayoutCenterTab {
|
|
55
|
+
label: string;
|
|
56
|
+
icon: ReactNode;
|
|
57
|
+
/** Where it leads, within the app. */
|
|
58
|
+
path: string;
|
|
59
|
+
/** Lit: the person is in it. Left out, lit while the path is the page or a prefix of it. */
|
|
60
|
+
active?: boolean;
|
|
61
|
+
/** A count on the icon (unread messages); nothing at 0. */
|
|
62
|
+
badge?: number;
|
|
63
|
+
/** Read out in place of the label, when the badge carries more ("Chat, 2 unread"). */
|
|
64
|
+
ariaLabel?: string;
|
|
65
|
+
}
|
|
50
66
|
export interface AppLayoutUser {
|
|
51
67
|
name?: string;
|
|
52
68
|
email?: string;
|
|
@@ -111,6 +127,21 @@ export interface AppLayoutProps {
|
|
|
111
127
|
siteLinks?: AppLayoutSiteLink[];
|
|
112
128
|
/** The app's own controls in the top bar (a chat toggle), before the colour-scheme switch. */
|
|
113
129
|
headerActions?: ReactNode;
|
|
130
|
+
/**
|
|
131
|
+
* The app's own place on a phone, in the middle of the tab bar where a thumb rests. The desktop does not draw it:
|
|
132
|
+
* an app that has one there offers it through `headerActions` and `sidePanel`.
|
|
133
|
+
*/
|
|
134
|
+
centerTab?: AppLayoutCenterTab;
|
|
135
|
+
/**
|
|
136
|
+
* On a phone, the page fills the space between the bars without the page's padding or a scroll of its own: a
|
|
137
|
+
* conversation list or a thread, which scroll inside themselves. Not drawn differently on a desktop.
|
|
138
|
+
*/
|
|
139
|
+
flush?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* On a phone, the page takes the whole screen: no app bar, no tab bar, sized to what is above the on-screen
|
|
142
|
+
* keyboard. A conversation, which has its own way back. Implies `flush`.
|
|
143
|
+
*/
|
|
144
|
+
immersive?: boolean;
|
|
114
145
|
/**
|
|
115
146
|
* A column docked on the right of a desktop screen, beside the top bar and the page and as tall as the window,
|
|
116
147
|
* so it stays in view while the page scrolls. It sizes itself. Not drawn in the compact layout, which has no room.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/AppLayout/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,8DAA8D;AAC9D,MAAM,WAAW,wBAAyB,SAAQ,WAAW;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,qEAAqE;AACrE,MAAM,WAAW,wBAAyB,SAAQ,WAAW;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,MAAM,gBAAgB,GAAG,wBAAwB,GAAG,wBAAwB,CAAC;AAEnF;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,yDAAyD;IACzD,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,oEAAoE;AACpE,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,8EAA8E;AAC9E,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI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IAAI,CAAC;IACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;IAC3B,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,sFAAsF;IACtF,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACjC,8GAA8G;IAC9G,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAChC,8FAA8F;IAC9F,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../../src/components/Page/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../../src/components/Page/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAelD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,2BAA2B;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,mGAAmG;IACnG,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAwB,EAAE,EAAE,eAAe,+BA4GhH"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from 'react';
|
|
2
3
|
import { Link as RouterLink } from 'react-router-dom';
|
|
3
4
|
import { Box, Button, Fab, Typography } from '@mui/material';
|
|
4
5
|
import { livePalette, mainAction } from '../../theme';
|
|
5
|
-
import { TAB_BAR_HEIGHT, useCompactLayout } from './layout';
|
|
6
|
+
import { FAB_CLEARANCE_VAR, TAB_BAR_HEIGHT, useCompactLayout } from './layout';
|
|
6
7
|
const visuallyHidden = {
|
|
7
8
|
position: 'absolute',
|
|
8
9
|
width: '1px',
|
|
@@ -19,6 +20,27 @@ const visuallyHidden = {
|
|
|
19
20
|
export function PageHeader({ title, subtitle, actions, primaryAction, hideTitleOnPhone = false }) {
|
|
20
21
|
const compact = useCompactLayout();
|
|
21
22
|
const showTitle = title !== undefined && !(compact && hideTitleOnPhone);
|
|
23
|
+
const floating = compact && primaryAction !== undefined;
|
|
24
|
+
// The page ends above the floating button rather than under it: the layout reads this to pad the bottom of the
|
|
25
|
+
// page. A variable on the root, since the layout and the page may be drawn by different bundles.
|
|
26
|
+
// Counted on the root too, so one header leaving does not take the room from another still showing its button.
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (!floating)
|
|
29
|
+
return;
|
|
30
|
+
const root = document.documentElement;
|
|
31
|
+
const count = () => Number(root.dataset.visinFabs ?? 0);
|
|
32
|
+
root.dataset.visinFabs = String(count() + 1);
|
|
33
|
+
root.style.setProperty(FAB_CLEARANCE_VAR, '64px');
|
|
34
|
+
return () => {
|
|
35
|
+
const left = count() - 1;
|
|
36
|
+
if (left > 0) {
|
|
37
|
+
root.dataset.visinFabs = String(left);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
delete root.dataset.visinFabs;
|
|
41
|
+
root.style.removeProperty(FAB_CLEARANCE_VAR);
|
|
42
|
+
};
|
|
43
|
+
}, [floating]);
|
|
22
44
|
const link = primaryAction?.to !== undefined ? { component: RouterLink, to: primaryAction.to } : {};
|
|
23
45
|
const primary = primaryAction &&
|
|
24
46
|
(compact ? (_jsxs(Fab, { variant: "extended", color: "primary", ...link, onClick: primaryAction.onClick, disabled: primaryAction.disabled, sx: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.js","sourceRoot":"","sources":["../../../src/components/Page/PageHeader.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"PageHeader.js","sourceRoot":"","sources":["../../../src/components/Page/PageHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE/E,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,eAAe;IACrB,UAAU,EAAE,QAAQ;CACZ,CAAC;AA6BX;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,GAAG,KAAK,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 @@ export { EmptyState } from './EmptyState';
|
|
|
10
10
|
export type { EmptyStateProps } from './EmptyState';
|
|
11
11
|
export { ResponsiveActions } from './ResponsiveActions';
|
|
12
12
|
export type { ResponsiveAction, ResponsiveActionsProps } from './ResponsiveActions';
|
|
13
|
-
export { TAB_BAR_HEIGHT, useCompactLayout } from './layout';
|
|
13
|
+
export { TAB_BAR_HEIGHT, useCompactLayout, useKeyboardAwareHeight } from './layout';
|
|
14
14
|
export { ConfirmDialog } from './ConfirmDialog';
|
|
15
15
|
export type { ConfirmDialogProps } from './ConfirmDialog';
|
|
16
16
|
export { ListSkeleton } from './ListSkeleton';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Page/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Page/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -4,7 +4,7 @@ export { ListRow, RowIcon } from './ListRow';
|
|
|
4
4
|
export { SectionHeading } from './SectionHeading';
|
|
5
5
|
export { EmptyState } from './EmptyState';
|
|
6
6
|
export { ResponsiveActions } from './ResponsiveActions';
|
|
7
|
-
export { TAB_BAR_HEIGHT, useCompactLayout } from './layout';
|
|
7
|
+
export { TAB_BAR_HEIGHT, useCompactLayout, useKeyboardAwareHeight } from './layout';
|
|
8
8
|
export { ConfirmDialog } from './ConfirmDialog';
|
|
9
9
|
export { ListSkeleton } from './ListSkeleton';
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Page/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Page/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** Set on the root while a page shows a floating action, to the space the layout leaves for it at the page's end. */
|
|
2
|
+
export declare const FAB_CLEARANCE_VAR = "--visin-fab-clearance";
|
|
1
3
|
/** Height the phone tab bar covers at the foot of the screen, above the safe-area inset. */
|
|
2
4
|
export declare const TAB_BAR_HEIGHT = 72;
|
|
3
5
|
/**
|
|
@@ -7,4 +9,15 @@ export declare const TAB_BAR_HEIGHT = 72;
|
|
|
7
9
|
* a frame of the desktop layout first.
|
|
8
10
|
*/
|
|
9
11
|
export declare function useCompactLayout(): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The height a screen that fills the window should take: all of it, or only the part above the on-screen keyboard
|
|
14
|
+
* while one is up.
|
|
15
|
+
*
|
|
16
|
+
* Android resizes the page for the keyboard where the viewport meta says `interactive-widget=resizes-content`, so
|
|
17
|
+
* `100dvh` already shrinks there. iOS lays the keyboard over the page instead and scrolls the whole page up to keep
|
|
18
|
+
* the focused field in sight, which pushes the bar and the newest messages off the top. Sizing the screen to the
|
|
19
|
+
* visual viewport leaves nothing to scroll: the composer sits on the keyboard and the conversation stays in view.
|
|
20
|
+
* Off (`enabled` false) it is plain `100dvh` and listens to nothing.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useKeyboardAwareHeight(enabled?: boolean): string;
|
|
10
23
|
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/components/Page/layout.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/components/Page/layout.ts"],"names":[],"mappings":"AAGA,qHAAqH;AACrH,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AAEzD,4FAA4F;AAC5F,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAG1C;AAKD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,UAAO,GAAG,MAAM,CAqC7D"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
1
2
|
import { useMediaQuery, useTheme } from '@mui/material';
|
|
3
|
+
/** Set on the root while a page shows a floating action, to the space the layout leaves for it at the page's end. */
|
|
4
|
+
export const FAB_CLEARANCE_VAR = '--visin-fab-clearance';
|
|
2
5
|
/** Height the phone tab bar covers at the foot of the screen, above the safe-area inset. */
|
|
3
6
|
export const TAB_BAR_HEIGHT = 72;
|
|
4
7
|
/**
|
|
@@ -11,4 +14,53 @@ export function useCompactLayout() {
|
|
|
11
14
|
const theme = useTheme();
|
|
12
15
|
return useMediaQuery(theme.breakpoints.down('md'), { noSsr: true });
|
|
13
16
|
}
|
|
17
|
+
/** Less than this is browser chrome settling, not a keyboard. */
|
|
18
|
+
const KEYBOARD_MIN_PX = 80;
|
|
19
|
+
/**
|
|
20
|
+
* The height a screen that fills the window should take: all of it, or only the part above the on-screen keyboard
|
|
21
|
+
* while one is up.
|
|
22
|
+
*
|
|
23
|
+
* Android resizes the page for the keyboard where the viewport meta says `interactive-widget=resizes-content`, so
|
|
24
|
+
* `100dvh` already shrinks there. iOS lays the keyboard over the page instead and scrolls the whole page up to keep
|
|
25
|
+
* the focused field in sight, which pushes the bar and the newest messages off the top. Sizing the screen to the
|
|
26
|
+
* visual viewport leaves nothing to scroll: the composer sits on the keyboard and the conversation stays in view.
|
|
27
|
+
* Off (`enabled` false) it is plain `100dvh` and listens to nothing.
|
|
28
|
+
*/
|
|
29
|
+
export function useKeyboardAwareHeight(enabled = true) {
|
|
30
|
+
const [height, setHeight] = useState('100dvh');
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
const viewport = typeof window === 'undefined' ? undefined : window.visualViewport;
|
|
33
|
+
if (!enabled || !viewport) {
|
|
34
|
+
setHeight('100dvh');
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
let frame = 0;
|
|
38
|
+
const update = () => {
|
|
39
|
+
cancelAnimationFrame(frame);
|
|
40
|
+
frame = requestAnimationFrame(() => {
|
|
41
|
+
// A pinch zoom shrinks the visual viewport too; following it would fight the zoom.
|
|
42
|
+
if (viewport.scale > 1.01)
|
|
43
|
+
return;
|
|
44
|
+
if (window.innerHeight - viewport.height > KEYBOARD_MIN_PX) {
|
|
45
|
+
setHeight(`${Math.round(viewport.height)}px`);
|
|
46
|
+
// Undo the scroll iOS already made to reveal the field.
|
|
47
|
+
if (window.scrollY !== 0)
|
|
48
|
+
window.scrollTo(0, 0);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
setHeight('100dvh');
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
viewport.addEventListener('resize', update);
|
|
56
|
+
viewport.addEventListener('scroll', update);
|
|
57
|
+
update();
|
|
58
|
+
return () => {
|
|
59
|
+
cancelAnimationFrame(frame);
|
|
60
|
+
viewport.removeEventListener('resize', update);
|
|
61
|
+
viewport.removeEventListener('scroll', update);
|
|
62
|
+
};
|
|
63
|
+
}, [enabled]);
|
|
64
|
+
return height;
|
|
65
|
+
}
|
|
14
66
|
//# sourceMappingURL=layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/components/Page/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAExD,4FAA4F;AAC5F,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,OAAO,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AACtE,CAAC"}
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/components/Page/layout.ts"],"names":[],"m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G,eAAe,EAAE,CAAC;oBAC3D,SAAS,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;oBAC9C,wDAAwD;oBACxD,IAAI,MAAM,CAAC,OAAO,KAAK,CAAC;wBAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAClD,CAAC;qBAAM,CAAC;oBACN,SAAS,CAAC,QAAQ,CAAC,CAAC;gBACtB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC5C,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC5C,MAAM,EAAE,CAAC;QACT,OAAO,GAAG,EAAE;YACV,oBAAoB,CAAC,KAAK,CAAC,CAAC;YAC5B,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC/C,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACjD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -20,8 +20,9 @@ export interface CreateConfigProviderOptions<T> {
|
|
|
20
20
|
configUrl?: string;
|
|
21
21
|
}
|
|
22
22
|
export declare function createConfigProvider<T>(options: CreateConfigProviderOptions<T>): {
|
|
23
|
-
ConfigProvider: ({ children }: {
|
|
23
|
+
ConfigProvider: ({ children, fallback }: {
|
|
24
24
|
children: ReactNode;
|
|
25
|
+
fallback?: ReactNode;
|
|
25
26
|
}) => React.JSX.Element;
|
|
26
27
|
ConfigContext: React.Context<T>;
|
|
27
28
|
useConfig: () => T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createConfigProvider.d.ts","sourceRoot":"","sources":["../../src/config/createConfigProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAkD,SAAS,EAAE,MAAM,OAAO,CAAC;AAIzF,MAAM,WAAW,2BAA2B,CAAC,CAAC;IAC5C,0KAA0K;IAC1K,eAAe,EAAE,MAAM,CAAC,CAAC;IACzB,kIAAkI;IAClI,KAAK,EAAE,OAAO,CAAC;IACf,+KAA+K;IAC/K,YAAY,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACzC,2HAA2H;IAC3H,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,SAAS,CAAC;IACpD,uEAAuE;IACvE,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,EAAE,2BAA2B,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"createConfigProvider.d.ts","sourceRoot":"","sources":["../../src/config/createConfigProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAkD,SAAS,EAAE,MAAM,OAAO,CAAC;AAIzF,MAAM,WAAW,2BAA2B,CAAC,CAAC;IAC5C,0KAA0K;IAC1K,eAAe,EAAE,MAAM,CAAC,CAAC;IACzB,kIAAkI;IAClI,KAAK,EAAE,OAAO,CAAC;IACf,+KAA+K;IAC/K,YAAY,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACzC,2HAA2H;IAC3H,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,SAAS,CAAC;IACpD,uEAAuE;IACvE,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,EAAE,2BAA2B,CAAC,CAAC,CAAC;6CAmCX;QAAE,QAAQ,EAAE,SAAS,CAAC;QAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;KAAE;;qBARzF,CAAC;2BAbK,CAAC;EAkF9B"}
|
|
@@ -21,7 +21,11 @@ export function createConfigProvider(options) {
|
|
|
21
21
|
function useConfig() {
|
|
22
22
|
return useContext(ConfigContext);
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
/**
|
|
25
|
+
* `fallback` replaces the loading fallback for this one provider: a part that renders nothing of its own (chat's
|
|
26
|
+
* background part) passes `null` rather than drawing a screen-tall loader beside the page.
|
|
27
|
+
*/
|
|
28
|
+
function ConfigProvider({ children, fallback = loadingFallback }) {
|
|
25
29
|
// Starts from an already-loaded config: shell-front mounts a remote's
|
|
26
30
|
// provider every time the user navigates into that app, and re-fetching
|
|
27
31
|
// (with a loader in between) on each visit is the reload this avoids.
|
|
@@ -29,6 +33,9 @@ export function createConfigProvider(options) {
|
|
|
29
33
|
const [error, setError] = useState(null);
|
|
30
34
|
useEffect(() => {
|
|
31
35
|
if (globalConfig) {
|
|
36
|
+
// Another provider of this app (a second part mounted in the same render) loaded it after this one's first
|
|
37
|
+
// render: take it, or this one waits on its loader for good.
|
|
38
|
+
setConfig((current) => current ?? globalConfig);
|
|
32
39
|
return;
|
|
33
40
|
}
|
|
34
41
|
// In development, use environment variables directly
|
|
@@ -65,7 +72,7 @@ export function createConfigProvider(options) {
|
|
|
65
72
|
return _jsx(ErrorPage, {});
|
|
66
73
|
}
|
|
67
74
|
if (!config) {
|
|
68
|
-
return _jsx(_Fragment, { children:
|
|
75
|
+
return _jsx(_Fragment, { children: fallback });
|
|
69
76
|
}
|
|
70
77
|
return (_jsx(ConfigContext.Provider, { value: config, children: renderChildren(children) }));
|
|
71
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createConfigProvider.js","sourceRoot":"","sources":["../../src/config/createConfigProvider.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAa,MAAM,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