@svadmin/ui 0.83.2 → 0.84.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.
@@ -1,4 +1,12 @@
1
1
  <script module lang="ts">
2
+ import type { Component as SvelteComponent } from 'svelte';
3
+
4
+ export interface AdminPageRoute {
5
+ readonly path: string;
6
+ readonly component: SvelteComponent<{ route: string; params: Record<string, string | undefined> }>;
7
+ readonly title?: string;
8
+ }
9
+
2
10
  const loadPublicProfilePage = () => import('./profile/PublicProfilePage.svelte');
3
11
  const loadGetStartedPage = () => import('./account/GetStartedPage.svelte');
4
12
  const loadUserProfilePage = () => import('./account/UserProfilePage.svelte');
@@ -65,6 +73,7 @@
65
73
  import ResourceOverview from './ResourceOverview.svelte';
66
74
  import DataState from './content/DataState.svelte';
67
75
  import { parseContractRouteId } from '@svadmin/core/schema';
76
+ import { matchRoute } from '@svadmin/core/router';
68
77
  import { resolveAdminThemeConfig } from '../default-theme.js';
69
78
  import AutoForm from './LazyAutoForm.svelte';
70
79
  import ShowPage from './LazyShowPage.svelte';
@@ -149,6 +158,8 @@
149
158
  }>;
150
159
  /** Custom multi-level menu configuration */
151
160
  menu?: MenuItem[];
161
+ /** Product or application surface routes rendered before resource fallbacks. */
162
+ pageRoutes?: readonly AdminPageRoute[];
152
163
  /** External URL to the main application or workspace (renders a shortcut in the header) */
153
164
  siteUrl?: string;
154
165
  /** Routing strategy for Sidebar links ('hash' | 'path' | 'auto') */
@@ -194,6 +205,7 @@
194
205
  components: userComponents,
195
206
  resourcePages,
196
207
  menu,
208
+ pageRoutes,
197
209
  siteUrl,
198
210
  routeMode,
199
211
  queryClient: providedQueryClient,
@@ -344,6 +356,14 @@
344
356
  const route = $derived(routerState.route);
345
357
  const params = $derived(routerState.params);
346
358
  const path = $derived(routerState.path);
359
+ const customRouteMatch = $derived.by(() => {
360
+ if (!pageRoutes?.length) return undefined;
361
+ for (const candidate of pageRoutes) {
362
+ const match = matchRoute(path, [candidate.path]);
363
+ if (match) return { candidate, params: match.params };
364
+ }
365
+ return undefined;
366
+ });
347
367
  const resourceNames = $derived(new Set(resources.map((resource) => resource.name)));
348
368
  const isStandaloneTwoFactor = $derived(route === '/2fa' || route === '/authentication/branded/2fa');
349
369
  const standaloneErrorStatus = $derived.by((): '404' | '500' | undefined => {
@@ -628,6 +648,9 @@
628
648
  <LazyPage loader={loadTeamCrewTablePage} props={{}} />
629
649
  {:else if renderedRoute.startsWith('/settings')}
630
650
  <SettingsPage {...notificationPreferencesProvider ? { preferencesProvider: notificationPreferencesProvider } : {}} />
651
+ {:else if customRouteMatch}
652
+ {@const CustomPage = customRouteMatch.candidate.component}
653
+ <CustomPage route={customRouteMatch.candidate.path} params={customRouteMatch.params} />
631
654
  {:else if renderedRoute === '/' || renderedRoute === '' || renderedRoute === '/inventory-dashboard'}
632
655
  {#if dashboard}
633
656
  {@render dashboard()}
@@ -1,3 +1,12 @@
1
+ import { SvelteComponent } from "svelte";
2
+ export interface AdminPageRoute {
3
+ readonly path: string;
4
+ readonly component: SvelteComponent<{
5
+ route: string;
6
+ params: Record<string, string | undefined>;
7
+ }>;
8
+ readonly title?: string;
9
+ }
1
10
  import '../app.css';
2
11
  import { type Component, type Snippet } from 'svelte';
3
12
  import type { AccessControlProvider, AgentProvider, AuditLogProvider, AuthProvider, ChatProvider, CredentialProvider, DataProviderInput, IdentityGovernanceProvider, I18nProvider, LiveProvider, MenuItem, NotificationProvider, OrganizationProvider, ResourceDefinition, RouterProvider, SessionProvider, TaskProvider, TenantAdapter, TenantContext, ThemeConfig, ThemeMode } from '@svadmin/core';
@@ -81,6 +90,8 @@ interface Props {
81
90
  }>;
82
91
  /** Custom multi-level menu configuration */
83
92
  menu?: MenuItem[];
93
+ /** Product or application surface routes rendered before resource fallbacks. */
94
+ pageRoutes?: readonly AdminPageRoute[];
84
95
  /** External URL to the main application or workspace (renders a shortcut in the header) */
85
96
  siteUrl?: string;
86
97
  /** Routing strategy for Sidebar links ('hash' | 'path' | 'auto') */
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export type { SurfaceTone, SurfaceDensity } from "./design-contract.js";
3
3
  export { designSystemComponents, type DesignComponentContract, type DesignComponentId, type DesignComponentState, } from "./design-system-components.js";
4
4
  export { metricSurfaceClasses, tableSurfaceClasses } from "./design-system.js";
5
5
  export { default as AdminApp } from './components/AdminApp.svelte';
6
+ export type { AdminPageRoute } from './components/AdminApp.svelte';
6
7
  export { default as AutoTable } from './components/AutoTable.svelte';
7
8
  export { default as SegmentedControl } from './components/SegmentedControl.svelte';
8
9
  export type { SegmentedControlOption } from './components/SegmentedControl.svelte';
package/dist/recipes.d.ts CHANGED
@@ -345,8 +345,8 @@ declare const productSectionRecipeStyles: import("tailwind-variants").TVReturnTy
345
345
  title?: import("tailwind-variants").ClassValue;
346
346
  description?: import("tailwind-variants").ClassValue;
347
347
  root?: import("tailwind-variants").ClassValue;
348
- heading?: import("tailwind-variants").ClassValue;
349
348
  actions?: import("tailwind-variants").ClassValue;
349
+ heading?: import("tailwind-variants").ClassValue;
350
350
  };
351
351
  };
352
352
  } | {
@@ -355,8 +355,8 @@ declare const productSectionRecipeStyles: import("tailwind-variants").TVReturnTy
355
355
  title?: import("tailwind-variants").ClassValue;
356
356
  description?: import("tailwind-variants").ClassValue;
357
357
  root?: import("tailwind-variants").ClassValue;
358
- heading?: import("tailwind-variants").ClassValue;
359
358
  actions?: import("tailwind-variants").ClassValue;
359
+ heading?: import("tailwind-variants").ClassValue;
360
360
  };
361
361
  };
362
362
  } | {}, {
@@ -371,8 +371,8 @@ declare const productSectionRecipeStyles: import("tailwind-variants").TVReturnTy
371
371
  title?: import("tailwind-variants").ClassValue;
372
372
  description?: import("tailwind-variants").ClassValue;
373
373
  root?: import("tailwind-variants").ClassValue;
374
- heading?: import("tailwind-variants").ClassValue;
375
374
  actions?: import("tailwind-variants").ClassValue;
375
+ heading?: import("tailwind-variants").ClassValue;
376
376
  };
377
377
  };
378
378
  } | {}, {
@@ -473,8 +473,8 @@ declare const productSettingsRecipeStyles: import("tailwind-variants").TVReturnT
473
473
  title?: import("tailwind-variants").ClassValue;
474
474
  description?: import("tailwind-variants").ClassValue;
475
475
  root?: import("tailwind-variants").ClassValue;
476
- heading?: import("tailwind-variants").ClassValue;
477
476
  actions?: import("tailwind-variants").ClassValue;
477
+ heading?: import("tailwind-variants").ClassValue;
478
478
  };
479
479
  };
480
480
  } | {
@@ -485,8 +485,8 @@ declare const productSettingsRecipeStyles: import("tailwind-variants").TVReturnT
485
485
  title?: import("tailwind-variants").ClassValue;
486
486
  description?: import("tailwind-variants").ClassValue;
487
487
  root?: import("tailwind-variants").ClassValue;
488
- heading?: import("tailwind-variants").ClassValue;
489
488
  actions?: import("tailwind-variants").ClassValue;
489
+ heading?: import("tailwind-variants").ClassValue;
490
490
  };
491
491
  };
492
492
  } | {}, {
@@ -505,8 +505,8 @@ declare const productSettingsRecipeStyles: import("tailwind-variants").TVReturnT
505
505
  title?: import("tailwind-variants").ClassValue;
506
506
  description?: import("tailwind-variants").ClassValue;
507
507
  root?: import("tailwind-variants").ClassValue;
508
- heading?: import("tailwind-variants").ClassValue;
509
508
  actions?: import("tailwind-variants").ClassValue;
509
+ heading?: import("tailwind-variants").ClassValue;
510
510
  };
511
511
  };
512
512
  } | {}, {
@@ -832,11 +832,11 @@ export declare const contentHeaderRecipe: (props?: Parameters<typeof contentHead
832
832
  description: string;
833
833
  root: string;
834
834
  row: string;
835
+ actions: string;
835
836
  heading: string;
836
837
  breadcrumbs: string;
837
838
  currentCrumb: string;
838
839
  eyebrow: string;
839
- actions: string;
840
840
  };
841
841
  export declare const metricBlockRecipe: (props?: Parameters<typeof metricBlockRecipeStyles>[0]) => {
842
842
  detail: string;
@@ -853,8 +853,8 @@ export declare const productSectionRecipe: (props?: Parameters<typeof productSec
853
853
  title: string;
854
854
  description: string;
855
855
  root: string;
856
- heading: string;
857
856
  actions: string;
857
+ heading: string;
858
858
  };
859
859
  export declare const productToolbarRecipe: (props?: Parameters<typeof productToolbarRecipeStyles>[0]) => {
860
860
  root: string;
@@ -874,8 +874,8 @@ export declare const productSettingsRecipe: (props?: Parameters<typeof productSe
874
874
  title: string;
875
875
  description: string;
876
876
  root: string;
877
- heading: string;
878
877
  actions: string;
878
+ heading: string;
879
879
  };
880
880
  export declare const productSettingsRowRecipe: (props?: Parameters<typeof productSettingsRowRecipeStyles>[0]) => {
881
881
  label: string;
@@ -919,11 +919,11 @@ export declare const allRecipes: {
919
919
  description: string;
920
920
  root: string;
921
921
  row: string;
922
+ actions: string;
922
923
  heading: string;
923
924
  breadcrumbs: string;
924
925
  currentCrumb: string;
925
926
  eyebrow: string;
926
- actions: string;
927
927
  };
928
928
  metricBlockRecipe: (props?: Parameters<typeof metricBlockRecipeStyles>[0]) => {
929
929
  detail: string;
@@ -940,8 +940,8 @@ export declare const allRecipes: {
940
940
  title: string;
941
941
  description: string;
942
942
  root: string;
943
- heading: string;
944
943
  actions: string;
944
+ heading: string;
945
945
  };
946
946
  productToolbarRecipe: (props?: Parameters<typeof productToolbarRecipeStyles>[0]) => {
947
947
  root: string;
@@ -961,8 +961,8 @@ export declare const allRecipes: {
961
961
  title: string;
962
962
  description: string;
963
963
  root: string;
964
- heading: string;
965
964
  actions: string;
965
+ heading: string;
966
966
  };
967
967
  productSettingsRowRecipe: (props?: Parameters<typeof productSettingsRowRecipeStyles>[0]) => {
968
968
  label: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svadmin/ui",
3
- "version": "0.83.2",
3
+ "version": "0.84.0",
4
4
  "description": "Pre-built admin UI components — AdminApp, AutoTable, AutoForm, Sidebar, Layout",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -88,7 +88,7 @@
88
88
  "@codemirror/lang-json": "^6.0.0",
89
89
  "@codemirror/lang-markdown": "^6.0.0",
90
90
  "@codemirror/lang-sql": "^6.0.0",
91
- "@svadmin/core": "^0.60.0",
91
+ "@svadmin/core": "^0.61.0",
92
92
  "@tanstack/svelte-query": "^6.1.48",
93
93
  "codemirror": "^6.0.0",
94
94
  "isomorphic-dompurify": "^3.23.0",
@@ -139,7 +139,7 @@
139
139
  }
140
140
  },
141
141
  "dependencies": {
142
- "@svadmin/devtools": "^0.3.0",
142
+ "@svadmin/devtools": "^0.3.1",
143
143
  "@svadmin/devtools-contract": "^0.3.0",
144
144
  "@vibeunion/devtools-devframe": "^0.1.0",
145
145
  "typebox": "^1.3.34",
@@ -177,7 +177,7 @@
177
177
  "@codemirror/lang-markdown": "^6.5.2",
178
178
  "@codemirror/lang-sql": "^6.10.0",
179
179
  "@happy-dom/global-registrator": "^20.11.12",
180
- "@svadmin/ai-elements": "^0.11.1",
180
+ "@svadmin/ai-elements": "^0.11.2",
181
181
  "@sveltejs/vite-plugin-svelte": "^7.3.0",
182
182
  "@tailwindcss/cli": "4.3.3",
183
183
  "@testing-library/dom": "^10.4.1",