@visin/frontend-core 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AppLayout/AppLayout.d.ts +40 -0
- package/dist/components/AppLayout/AppLayout.d.ts.map +1 -0
- package/dist/components/AppLayout/AppLayout.js +108 -0
- package/dist/components/AppLayout/AppLayout.js.map +1 -0
- package/dist/components/AppLayout/index.d.ts +3 -0
- package/dist/components/AppLayout/index.d.ts.map +1 -0
- package/dist/components/AppLayout/index.js +2 -0
- package/dist/components/AppLayout/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface AppLayoutNavItem {
|
|
3
|
+
text: string;
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
path: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AppLayoutFooterLink {
|
|
8
|
+
text: string;
|
|
9
|
+
icon: ReactNode;
|
|
10
|
+
href: string;
|
|
11
|
+
}
|
|
12
|
+
export interface AppLayoutUser {
|
|
13
|
+
name?: string;
|
|
14
|
+
email?: string;
|
|
15
|
+
picture?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface AppLayoutProps {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
/** Shown in the mobile app bar and as the fallback desktop page title. */
|
|
20
|
+
appName: string;
|
|
21
|
+
/** Static description shown under the desktop page title. */
|
|
22
|
+
subtitle: string;
|
|
23
|
+
navItems: AppLayoutNavItem[];
|
|
24
|
+
user: AppLayoutUser | null;
|
|
25
|
+
onLogout: () => void;
|
|
26
|
+
/** Optional link pinned below the nav list, e.g. "Back to Vision". */
|
|
27
|
+
footerLink?: AppLayoutFooterLink;
|
|
28
|
+
/** Max width of the centered content column. Defaults to 800. */
|
|
29
|
+
maxContentWidth?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Shared sidebar/appbar shell used by the account and label fronts: fixed
|
|
33
|
+
* dark drawer with nav items, mobile temporary drawer, avatar menu with
|
|
34
|
+
* logout, and a centered content column with a page title derived from the
|
|
35
|
+
* active nav item. vision-front's collapsible-drawer layout has different
|
|
36
|
+
* enough behavior (login/logout dual state, no page-title header) that it
|
|
37
|
+
* stays a standalone component rather than forcing it through these props.
|
|
38
|
+
*/
|
|
39
|
+
export declare function AppLayout({ children, appName, subtitle, navItems, user, onLogout, footerLink, maxContentWidth }: AppLayoutProps): import("react").JSX.Element;
|
|
40
|
+
//# sourceMappingURL=AppLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppLayout.d.ts","sourceRoot":"","sources":["../../../src/components/AppLayout/AppLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAwB,MAAM,OAAO,CAAC;AA0BxD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,sEAAsE;IACtE,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,iEAAiE;IACjE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,eAAqB,EACtB,EAAE,cAAc,+BAiQhB"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Box, Drawer, List, Typography, Divider, ListItem, ListItemButton, ListItemIcon, ListItemText, Avatar, Menu, MenuItem, useTheme, CssBaseline, AppBar, Toolbar, IconButton } from '@mui/material';
|
|
4
|
+
import { alpha } from '@mui/material/styles';
|
|
5
|
+
import { Menu as MenuIcon, Logout, Person } from '@mui/icons-material';
|
|
6
|
+
import { Link, useLocation } from 'react-router-dom';
|
|
7
|
+
const DRAWER_WIDTH = 260;
|
|
8
|
+
/**
|
|
9
|
+
* Shared sidebar/appbar shell used by the account and label fronts: fixed
|
|
10
|
+
* dark drawer with nav items, mobile temporary drawer, avatar menu with
|
|
11
|
+
* logout, and a centered content column with a page title derived from the
|
|
12
|
+
* active nav item. vision-front's collapsible-drawer layout has different
|
|
13
|
+
* enough behavior (login/logout dual state, no page-title header) that it
|
|
14
|
+
* stays a standalone component rather than forcing it through these props.
|
|
15
|
+
*/
|
|
16
|
+
export function AppLayout({ children, appName, subtitle, navItems, user, onLogout, footerLink, maxContentWidth = 800 }) {
|
|
17
|
+
const location = useLocation();
|
|
18
|
+
const theme = useTheme();
|
|
19
|
+
const [anchorElUser, setAnchorElUser] = useState(null);
|
|
20
|
+
const [mobileOpen, setMobileOpen] = useState(false);
|
|
21
|
+
const handleDrawerToggle = () => setMobileOpen(!mobileOpen);
|
|
22
|
+
const handleOpenUserMenu = (event) => setAnchorElUser(event.currentTarget);
|
|
23
|
+
const handleCloseUserMenu = () => setAnchorElUser(null);
|
|
24
|
+
// An exact match always wins; a prefix match only counts if no other nav
|
|
25
|
+
// item is an exact match for the current path (avoids '/jobs' lighting up
|
|
26
|
+
// while on '/jobs/new').
|
|
27
|
+
const isActive = (path) => location.pathname === path ||
|
|
28
|
+
(location.pathname.startsWith(path + '/') &&
|
|
29
|
+
!navItems.some((item) => item.path !== path && item.path === location.pathname));
|
|
30
|
+
const activeItem = navItems.find((item) => isActive(item.path));
|
|
31
|
+
const drawer = (_jsxs(Box, { sx: { height: '100%', display: 'flex', flexDirection: 'column', bgcolor: '#111827', color: '#fff' }, children: [_jsxs(Box, { sx: { p: 3, display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Box, { component: "img", src: "/logo.svg", alt: "Visin Logo", sx: { width: 32, height: 32 } }), _jsx(Typography, { variant: "h6", sx: { fontWeight: 700, color: 'inherit', letterSpacing: '-0.5px' }, children: "Visin" })] }), _jsx(List, { sx: { px: 2, flexGrow: 1 }, children: navItems.map((item) => {
|
|
32
|
+
const active = isActive(item.path);
|
|
33
|
+
return (_jsx(ListItem, { disablePadding: true, sx: { mb: 0.5 }, children: _jsxs(ListItemButton, { component: Link, to: item.path, selected: active, onClick: () => setMobileOpen(false), sx: {
|
|
34
|
+
borderRadius: 2,
|
|
35
|
+
py: 1.2,
|
|
36
|
+
color: 'rgba(255,255,255,0.7)',
|
|
37
|
+
'&.Mui-selected': {
|
|
38
|
+
bgcolor: alpha(theme.palette.primary.main, 0.15),
|
|
39
|
+
color: theme.palette.primary.light,
|
|
40
|
+
'&:hover': {
|
|
41
|
+
bgcolor: alpha(theme.palette.primary.main, 0.25)
|
|
42
|
+
},
|
|
43
|
+
'& .MuiListItemIcon-root': {
|
|
44
|
+
color: theme.palette.primary.light
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
'&:hover': {
|
|
48
|
+
bgcolor: 'rgba(255,255,255,0.05)',
|
|
49
|
+
color: '#fff',
|
|
50
|
+
'& .MuiListItemIcon-root': {
|
|
51
|
+
color: '#fff'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}, children: [_jsx(ListItemIcon, { sx: { minWidth: 40, color: active ? 'inherit' : 'rgba(255,255,255,0.5)' }, children: item.icon }), _jsx(ListItemText, { primary: item.text, slotProps: {
|
|
55
|
+
primary: { sx: { fontWeight: active ? 600 : 500, fontSize: '0.925rem' } }
|
|
56
|
+
} })] }) }, item.text));
|
|
57
|
+
}) }), footerLink && (_jsxs(_Fragment, { children: [_jsx(Divider, { sx: { mx: 2, opacity: 0.1, bgcolor: 'rgba(255,255,255,0.1)' } }), _jsx(List, { sx: { px: 2, py: 2 }, children: _jsx(ListItem, { disablePadding: true, children: _jsxs(ListItemButton, { component: "a", href: footerLink.href, sx: {
|
|
58
|
+
borderRadius: 2,
|
|
59
|
+
py: 1.2,
|
|
60
|
+
color: 'rgba(255,255,255,0.5)',
|
|
61
|
+
'&:hover': {
|
|
62
|
+
bgcolor: 'rgba(255,255,255,0.05)',
|
|
63
|
+
color: '#fff',
|
|
64
|
+
'& .MuiListItemIcon-root': {
|
|
65
|
+
color: '#fff'
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}, children: [_jsx(ListItemIcon, { sx: { minWidth: 40, color: 'inherit' }, children: footerLink.icon }), _jsx(ListItemText, { primary: footerLink.text, slotProps: { primary: { sx: { fontWeight: 500, fontSize: '0.925rem' } } } })] }) }) })] }))] }));
|
|
69
|
+
return (_jsxs(Box, { sx: { display: 'flex', minHeight: '100vh', bgcolor: 'background.default' }, children: [_jsx(CssBaseline, {}), _jsx(AppBar, { position: "fixed", sx: {
|
|
70
|
+
display: { sm: 'none' },
|
|
71
|
+
bgcolor: '#111827',
|
|
72
|
+
color: '#fff',
|
|
73
|
+
boxShadow: 'none',
|
|
74
|
+
borderBottom: '1px solid rgba(255,255,255,0.1)'
|
|
75
|
+
}, children: _jsxs(Toolbar, { children: [_jsx(IconButton, { color: "inherit", "aria-label": "open drawer", edge: "start", onClick: handleDrawerToggle, sx: { mr: 2 }, children: _jsx(MenuIcon, {}) }), _jsx(Typography, { variant: "h6", noWrap: true, component: "div", sx: { fontWeight: 700, flexGrow: 1 }, children: appName }), _jsx(Avatar, { src: user?.picture, sx: { width: 32, height: 32, border: '1px solid rgba(255,255,255,0.1)' }, onClick: handleOpenUserMenu })] }) }), _jsxs(Box, { component: "nav", sx: { width: { sm: DRAWER_WIDTH }, flexShrink: { sm: 0 } }, children: [_jsx(Drawer, { variant: "temporary", open: mobileOpen, onClose: handleDrawerToggle, ModalProps: { keepMounted: true }, sx: {
|
|
76
|
+
display: { xs: 'block', sm: 'none' },
|
|
77
|
+
'& .MuiDrawer-paper': {
|
|
78
|
+
boxSizing: 'border-box',
|
|
79
|
+
width: DRAWER_WIDTH,
|
|
80
|
+
borderRight: 'none',
|
|
81
|
+
bgcolor: '#111827',
|
|
82
|
+
color: '#fff'
|
|
83
|
+
}
|
|
84
|
+
}, children: drawer }), _jsx(Drawer, { variant: "permanent", sx: {
|
|
85
|
+
display: { xs: 'none', sm: 'block' },
|
|
86
|
+
'& .MuiDrawer-paper': {
|
|
87
|
+
boxSizing: 'border-box',
|
|
88
|
+
width: DRAWER_WIDTH,
|
|
89
|
+
borderRight: '1px solid rgba(255,255,255,0.1)',
|
|
90
|
+
bgcolor: '#111827',
|
|
91
|
+
color: '#fff'
|
|
92
|
+
}
|
|
93
|
+
}, open: true, children: drawer })] }), _jsx(Box, { component: "main", sx: {
|
|
94
|
+
flexGrow: 1,
|
|
95
|
+
p: { xs: 2, sm: 4, md: 8 },
|
|
96
|
+
width: { sm: `calc(100% - ${DRAWER_WIDTH}px)` },
|
|
97
|
+
mt: { xs: 7, sm: 0 },
|
|
98
|
+
display: 'flex',
|
|
99
|
+
flexDirection: 'column',
|
|
100
|
+
alignItems: 'center'
|
|
101
|
+
}, children: _jsxs(Box, { sx: { width: '100%', maxWidth: maxContentWidth }, children: [_jsxs(Box, { sx: { display: { xs: 'none', sm: 'flex' }, justifyContent: 'space-between', alignItems: 'center', mb: 8 }, children: [_jsxs(Box, { children: [_jsx(Typography, { variant: "h4", sx: { fontWeight: 700, letterSpacing: '-1px', mb: 1 }, children: activeItem?.text || appName }), _jsx(Typography, { variant: "body1", sx: { color: 'text.secondary' }, children: subtitle })] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsxs(Box, { sx: { textAlign: 'right' }, children: [_jsx(Typography, { variant: "subtitle2", sx: { fontWeight: 600 }, children: user?.name || 'User' }), _jsx(Typography, { variant: "caption", sx: { color: 'text.secondary' }, children: user?.email })] }), _jsx(IconButton, { onClick: handleOpenUserMenu, sx: { p: 0.5, border: '1px solid', borderColor: 'divider' }, children: _jsx(Avatar, { src: user?.picture, sx: { width: 40, height: 40 }, children: _jsx(Person, {}) }) }), _jsxs(Menu, { anchorEl: anchorElUser, open: Boolean(anchorElUser), onClose: handleCloseUserMenu, transformOrigin: { horizontal: 'right', vertical: 'top' }, anchorOrigin: { horizontal: 'right', vertical: 'bottom' }, slotProps: {
|
|
102
|
+
paper: { sx: { mt: 1.5, minWidth: 200, borderRadius: 2, boxShadow: '0 10px 15px -3px rgb(0 0 0 / 0.1)' } }
|
|
103
|
+
}, children: [_jsxs(Box, { sx: { px: 2, py: 1.5 }, children: [_jsx(Typography, { variant: "subtitle2", noWrap: true, children: user?.name }), _jsx(Typography, { variant: "caption", noWrap: true, sx: { color: 'text.secondary' }, children: user?.email })] }), _jsx(Divider, {}), _jsxs(MenuItem, { onClick: () => {
|
|
104
|
+
handleCloseUserMenu();
|
|
105
|
+
onLogout();
|
|
106
|
+
}, sx: { py: 1.5 }, children: [_jsx(ListItemIcon, { children: _jsx(Logout, { fontSize: "small" }) }), "Logout"] })] })] })] }), children] }) })] }));
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=AppLayout.js.map
|
|
@@ -0,0 +1 @@
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E,QAAQ,EAAE,KAAK,EAAE,EACzD,YAAY,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EACzD,SAAS,EAAE;gDACT,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,mCAAmC,EAAE,EAAE;6CAC3G,aAED,MAAC,GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,aACzB,KAAC,UAAU,IAAC,OAAO,EAAC,WAAW,EAAC,MAAM,kBACnC,IAAI,EAAE,IAAI,GACA,EACb,KAAC,UAAU,IAAC,OAAO,EAAC,SAAS,EAAC,MAAM,QAAC,EAAE,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,YACjE,IAAI,EAAE,KAAK,GACD,IACT,EACN,KAAC,OAAO,KAAG,EACX,MAAC,QAAQ,IACP,OAAO,EAAE,GAAG,EAAE;wDACZ,mBAAmB,EAAE,CAAC;wDACtB,QAAQ,EAAE,CAAC;oDACb,CAAC,EACD,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,aAEf,KAAC,YAAY,cACX,KAAC,MAAM,IAAC,QAAQ,EAAC,OAAO,GAAG,GACd,cAEN,IACN,IACH,IACF,EAEL,QAAQ,IACL,GACF,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +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,EAAE,cAAc,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/AppLayout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export { Loader } from './components/Loader';
|
|
|
4
4
|
export type { LoaderProps } from './components/Loader';
|
|
5
5
|
export { ErrorPage } from './components/ErrorPage';
|
|
6
6
|
export type { ErrorPageProps } from './components/ErrorPage';
|
|
7
|
+
export { AppLayout } from './components/AppLayout';
|
|
8
|
+
export type { AppLayoutProps, AppLayoutNavItem, AppLayoutFooterLink, AppLayoutUser } from './components/AppLayout';
|
|
7
9
|
export { createAuthService } from './auth/authService';
|
|
8
10
|
export type { AuthService, AuthServiceOptions, AuthUser, AuthCheckResult } from './auth/authService';
|
|
9
11
|
export { createAuthContext } from './auth/AuthProvider';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAElF,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAElF,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEnH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,YAAY,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export { createApiClient, ApiError } from './apiClient';
|
|
3
3
|
export { Loader } from './components/Loader';
|
|
4
4
|
export { ErrorPage } from './components/ErrorPage';
|
|
5
|
+
export { AppLayout } from './components/AppLayout';
|
|
5
6
|
export { createAuthService } from './auth/authService';
|
|
6
7
|
export { createAuthContext } from './auth/AuthProvider';
|
|
7
8
|
export { createConfigProvider } from './config/createConfigProvider';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mFAAmF;AAEnF,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGxD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mFAAmF;AAEnF,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGxD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visin/frontend-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Shared frontend auth/API-client logic for Visin frontends",
|
|
5
5
|
"author": "Toomas Tahves",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "tsc",
|
|
20
20
|
"clean": "rm -rf dist",
|
|
21
|
+
"prepare": "npm run build",
|
|
21
22
|
"prepublishOnly": "npm run clean && npm run build",
|
|
22
23
|
"release": "standard-version && npm run build && npm publish --access public",
|
|
23
24
|
"release:beta": "standard-version --prerelease beta && npm run build && npm publish --access public --tag beta",
|
|
@@ -36,7 +37,8 @@
|
|
|
36
37
|
"peerDependencies": {
|
|
37
38
|
"@mui/icons-material": "^9.2.0",
|
|
38
39
|
"@mui/material": "^9.2.0",
|
|
39
|
-
"react": "^19.2.7"
|
|
40
|
+
"react": "^19.2.7",
|
|
41
|
+
"react-router-dom": "^7.18.1"
|
|
40
42
|
},
|
|
41
43
|
"devDependencies": {
|
|
42
44
|
"@eslint/js": "^10.0.1",
|
|
@@ -51,6 +53,7 @@
|
|
|
51
53
|
"jsdom": "^29.1.1",
|
|
52
54
|
"react": "^19.2.7",
|
|
53
55
|
"react-dom": "^19.2.7",
|
|
56
|
+
"react-router-dom": "^7.18.1",
|
|
54
57
|
"standard-version": "^9.5.0",
|
|
55
58
|
"typescript": "^6.0.3",
|
|
56
59
|
"typescript-eslint": "^8.62.1",
|