@svadmin/core 0.10.0 → 0.11.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.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Core SDK — hooks, types, context, i18n, permissions, router",
5
5
  "type": "module",
6
6
  "sideEffects": false,
package/src/index.ts CHANGED
@@ -59,7 +59,7 @@ export type {
59
59
  DeleteParams, DeleteResult,
60
60
  DeleteManyParams, DeleteManyResult,
61
61
  Pagination, Sort, Filter, Identity,
62
- ResourceDefinition, FieldDefinition,
62
+ ResourceDefinition, FieldDefinition, MenuItem,
63
63
  AuthActionResult, CheckResult,
64
64
  ResourceTypeMap, KnownResources, InferData,
65
65
  BaseRecord,
package/src/types.ts CHANGED
@@ -260,6 +260,30 @@ export interface ResourceDefinition {
260
260
  meta?: Record<string, unknown> & { dataProviderName?: string; parent?: string };
261
261
  }
262
262
 
263
+ // ─── MenuItem (Multi-Level Menu) ──────────────────────────────
264
+
265
+ export interface MenuItem {
266
+ /** Unique identifier, also used as i18n fallback key: t(`menu.${name}`) */
267
+ name: string;
268
+ /** Display label. Falls back to `t('menu.${name}')` if omitted */
269
+ label?: string;
270
+ /** Icon name string (maps to lucide icon set) or Svelte component */
271
+ icon?: string;
272
+ /** Navigation path — omit for parent-only menu nodes */
273
+ href?: string;
274
+ /** Open in new tab (useful for external links) */
275
+ target?: '_blank' | '_self';
276
+ /** Permission check metadata */
277
+ meta?: {
278
+ resource?: string;
279
+ action?: string;
280
+ /** Hide this item from the menu entirely */
281
+ hidden?: boolean;
282
+ };
283
+ /** Sub-menu items — supports infinite nesting */
284
+ children?: MenuItem[];
285
+ }
286
+
263
287
  export interface FieldDefinition {
264
288
  key: string;
265
289
  label: string;