@svadmin/core 0.36.2 → 0.37.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/core",
3
- "version": "0.36.2",
3
+ "version": "0.37.0",
4
4
  "author": "zuohuadong",
5
5
  "repository": {
6
6
  "type": "git",
@@ -326,6 +326,7 @@ const baseLocales: Record<string, Record<string, string>> = {
326
326
  'profile.winRate': '胜率',
327
327
  'profile.rank': '段位',
328
328
  // Public profile
329
+ 'publicProfile.title': '公开资料',
329
330
  'publicProfile.projects': '项目',
330
331
  'publicProfile.projects2Col': '两栏项目',
331
332
  'publicProfile.projects3Col': '三栏项目',
@@ -954,6 +955,7 @@ const baseLocales: Record<string, Record<string, string>> = {
954
955
  'profile.winRate': 'Win Rate',
955
956
  'profile.rank': 'Rank',
956
957
  // Public profile
958
+ 'publicProfile.title': 'Public profile',
957
959
  'publicProfile.projects': 'Projects',
958
960
  'publicProfile.projects2Col': 'Projects - 2 Columns',
959
961
  'publicProfile.projects3Col': 'Projects - 3 Columns',
package/src/index.ts CHANGED
@@ -145,7 +145,7 @@ export {
145
145
  export { useParsed, resetGlobalPath, syncGlobalPath } from './useParsed.svelte';
146
146
  export * from './useStepsForm.svelte';
147
147
  export { createHashRouterProvider, createHistoryRouterProvider } from './router-provider';
148
- export type { RouterProvider } from './router-provider';
148
+ export type { RouterNavigationResult, RouterProvider } from './router-provider';
149
149
  export { inferFieldType, inferResource } from './inferencer';
150
150
  export type { InferResult } from './inferencer';
151
151
  export { createWebSocketLiveProvider } from './live-websocket';
@@ -1,5 +1,7 @@
1
1
  // Router Provider — abstracts routing strategy (hash, history, SvelteKit, etc.)
2
2
 
3
+ export type RouterNavigationResult = false | ReturnType<() => void>;
4
+
3
5
  export interface RouterProvider {
4
6
  /** Navigate to a path */
5
7
  go: (options: {
@@ -7,7 +9,7 @@ export interface RouterProvider {
7
9
  query?: Record<string, string>;
8
10
  hash?: string;
9
11
  type?: 'push' | 'replace';
10
- }) => void;
12
+ }) => RouterNavigationResult | Promise<RouterNavigationResult>;
11
13
  /** Navigate back */
12
14
  back: () => void;
13
15
  /** Parse current URL into structured route info */
package/src/router.ts CHANGED
@@ -82,7 +82,8 @@ export async function navigateWithProvider(
82
82
  if (!allowed) return;
83
83
  }
84
84
  if (provider) {
85
- provider.go({ to: path, type: options?.replaceState ? 'replace' : 'push' });
85
+ const navigated = await provider.go({ to: path, type: options?.replaceState ? 'replace' : 'push' });
86
+ if (navigated === false) return;
86
87
  } else if (typeof window !== 'undefined') {
87
88
  window.location.hash = '#' + path.replace(/^#/, '');
88
89
  }