@svadmin/ui 0.28.0 → 0.29.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svadmin/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "Pre-built admin UI components — AdminApp, AutoTable, AutoForm, Sidebar, Layout",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"./components/*": "./src/components/*"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@svadmin/core": "^0.
|
|
23
|
+
"@svadmin/core": "^0.20.0",
|
|
24
24
|
"@tanstack/svelte-query": "^6.0.0",
|
|
25
25
|
"highlight.js": "^11.11.1",
|
|
26
26
|
"isomorphic-dompurify": "^3.7.1",
|
|
@@ -45,6 +45,8 @@
|
|
|
45
45
|
components?: Partial<ComponentRegistry>;
|
|
46
46
|
/** Custom multi-level menu configuration */
|
|
47
47
|
menu?: MenuItem[];
|
|
48
|
+
/** External URL to the main application or workspace (renders a shortcut in the header) */
|
|
49
|
+
siteUrl?: string;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
let {
|
|
@@ -60,6 +62,7 @@
|
|
|
60
62
|
loginPage,
|
|
61
63
|
components: userComponents,
|
|
62
64
|
menu,
|
|
65
|
+
siteUrl,
|
|
63
66
|
}: Props = $props();
|
|
64
67
|
|
|
65
68
|
// Default component registry
|
|
@@ -148,7 +151,7 @@
|
|
|
148
151
|
{:else if route === '/login' || route === '/register' || route === '/forgot-password' || route === '/update-password'}
|
|
149
152
|
<ConfigErrorScreen title="{title} — {t('common.configRequired')}" />
|
|
150
153
|
{:else if isAuthenticated || !authProvider}
|
|
151
|
-
<Layout {title} {menu}>
|
|
154
|
+
<Layout {title} {menu} {siteUrl}>
|
|
152
155
|
{#key route + (params.resource ?? '') + (params.id ?? '')}
|
|
153
156
|
<div class="svadmin-page-enter">
|
|
154
157
|
{#if currentPath().startsWith('/settings')}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { Moon, Sun, Search } from '@lucide/svelte';
|
|
2
|
+
import { Moon, Sun, Search, MonitorUp } from '@lucide/svelte';
|
|
3
3
|
import { Button } from './ui/button';
|
|
4
4
|
import TooltipButton from './TooltipButton.svelte';
|
|
5
5
|
import { getResolvedTheme, toggleTheme } from '@svadmin/core';
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
children,
|
|
16
16
|
/** Slot for additional actions on the right side of the header */
|
|
17
17
|
rightActions,
|
|
18
|
+
siteUrl,
|
|
18
19
|
} = $props<{
|
|
19
20
|
showThemeToggle?: boolean;
|
|
20
21
|
showBreadcrumbs?: boolean;
|
|
@@ -22,6 +23,7 @@
|
|
|
22
23
|
onSearchClick?: () => void;
|
|
23
24
|
children?: import('svelte').Snippet;
|
|
24
25
|
rightActions?: import('svelte').Snippet;
|
|
26
|
+
siteUrl?: string;
|
|
25
27
|
}>();
|
|
26
28
|
|
|
27
29
|
// Retrieve optional component overrides from registry
|
|
@@ -50,6 +52,12 @@
|
|
|
50
52
|
{@render rightActions()}
|
|
51
53
|
{/if}
|
|
52
54
|
|
|
55
|
+
{#if siteUrl}
|
|
56
|
+
<TooltipButton tooltip={t('common.goToSite') || 'Site'} href={siteUrl} target="_blank" rel="noopener noreferrer" class="rounded-full flex items-center justify-center">
|
|
57
|
+
<MonitorUp class="h-4 w-4 text-muted-foreground transition-colors hover:text-foreground" />
|
|
58
|
+
</TooltipButton>
|
|
59
|
+
{/if}
|
|
60
|
+
|
|
53
61
|
{#if CustomNotificationPanel}
|
|
54
62
|
<CustomNotificationPanel />
|
|
55
63
|
{/if}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
let shortcutsOpen = $state(false);
|
|
23
23
|
let mobileMenuOpen = $state(false);
|
|
24
24
|
|
|
25
|
-
let { children, title = 'Admin', menu }: { children: Snippet; title?: string; menu?: MenuItem[] } = $props();
|
|
25
|
+
let { children, title = 'Admin', menu, siteUrl }: { children: Snippet; title?: string; menu?: MenuItem[]; siteUrl?: string } = $props();
|
|
26
26
|
|
|
27
27
|
let hasAuth = true;
|
|
28
28
|
let auth: ReturnType<typeof getAuthProvider> | null = null;
|
|
@@ -138,6 +138,7 @@
|
|
|
138
138
|
>
|
|
139
139
|
<!-- Header with mobile hamburger -->
|
|
140
140
|
<Header
|
|
141
|
+
{siteUrl}
|
|
141
142
|
showSearch={true}
|
|
142
143
|
onSearchClick={() => { commandOpen = true; }}
|
|
143
144
|
>
|