@svadmin/core 0.17.0 → 0.17.1
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 +24 -24
- package/src/README.md +18 -0
- package/src/toast.svelte.ts +3 -3
package/package.json
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svadmin/core",
|
|
3
|
-
"version": "0.17.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
3
|
+
"version": "0.17.1",
|
|
4
|
+
"author": "zuohuadong",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/zuohuadong/svadmin.git",
|
|
8
|
+
"directory": "packages/core"
|
|
9
|
+
},
|
|
10
10
|
"main": "src/index.ts",
|
|
11
|
-
"
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"@types/bun": "^1.3.11"
|
|
13
|
+
},
|
|
14
|
+
"peerDependencies": {
|
|
15
|
+
"svelte": "^5.0.0",
|
|
16
|
+
"@tanstack/svelte-query": "^6.0.0"
|
|
17
|
+
},
|
|
12
18
|
"exports": {
|
|
13
19
|
".": {
|
|
14
20
|
"types": "./src/index.ts",
|
|
@@ -43,25 +49,19 @@
|
|
|
43
49
|
"default": "./src/theme.svelte.ts"
|
|
44
50
|
}
|
|
45
51
|
},
|
|
46
|
-
"peerDependencies": {
|
|
47
|
-
"svelte": "^5.0.0",
|
|
48
|
-
"@tanstack/svelte-query": "^6.0.0"
|
|
49
|
-
},
|
|
50
|
-
"license": "MIT",
|
|
51
|
-
"author": "zuohuadong",
|
|
52
|
-
"repository": {
|
|
53
|
-
"type": "git",
|
|
54
|
-
"url": "https://github.com/zuohuadong/svadmin.git",
|
|
55
|
-
"directory": "packages/core"
|
|
56
|
-
},
|
|
57
|
-
"homepage": "https://github.com/zuohuadong/svadmin#readme",
|
|
58
52
|
"bugs": {
|
|
59
53
|
"url": "https://github.com/zuohuadong/svadmin/issues"
|
|
60
54
|
},
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
"description": "Core SDK — hooks, types, context, i18n, permissions, router",
|
|
56
|
+
"files": [
|
|
57
|
+
"src/**/*"
|
|
58
|
+
],
|
|
59
|
+
"homepage": "https://github.com/zuohuadong/svadmin#readme",
|
|
60
|
+
"license": "MIT",
|
|
61
|
+
"sideEffects": false,
|
|
62
|
+
"type": "module",
|
|
63
|
+
"types": "src/index.ts",
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"svelte
|
|
65
|
+
"sonner-svelte": "^0.3.3"
|
|
66
66
|
}
|
|
67
67
|
}
|
package/src/README.md
ADDED
package/src/toast.svelte.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// Toast notification system — wraps svelte
|
|
1
|
+
// Toast notification system — wraps sonner-svelte for consistent API
|
|
2
2
|
// Maintains backward-compatible `toast.success()` / `toast.error()` etc.
|
|
3
3
|
|
|
4
|
-
import { toast as sonner } from 'svelte
|
|
4
|
+
import { toast as sonner } from 'sonner-svelte';
|
|
5
5
|
|
|
6
6
|
export type ToastType = 'success' | 'error' | 'info' | 'warning' | 'undoable';
|
|
7
7
|
|
|
@@ -23,7 +23,7 @@ export function getToasts(): Toast[] {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export function addToast(type: ToastType, message: string, duration = 3000, options?: { onUndo?: () => void, onTimeout?: () => void }): void {
|
|
26
|
-
// Use svelte
|
|
26
|
+
// Use sonner-svelte for regular toasts
|
|
27
27
|
if (type !== 'undoable') {
|
|
28
28
|
switch (type) {
|
|
29
29
|
case 'success': sonner.success(message, { duration }); break;
|