@marianmeres/collection-types 1.22.0 → 1.23.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/dist/navigation.d.ts +74 -0
- package/package.json +1 -1
package/dist/navigation.d.ts
CHANGED
|
@@ -90,3 +90,77 @@ export interface NavItemDef {
|
|
|
90
90
|
group?: MaybeLocalized<string>;
|
|
91
91
|
groupIcon?: string;
|
|
92
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Area identifiers for the admin SPA.
|
|
95
|
+
* Each area represents a distinct section of the application with its own
|
|
96
|
+
* routing pattern and navigation structure.
|
|
97
|
+
*/
|
|
98
|
+
export type AreaId = "cms" | "custom" | "customer" | "extra";
|
|
99
|
+
/**
|
|
100
|
+
* Base nav item structure shared across all areas.
|
|
101
|
+
* Designed to support hierarchical navigation (groups, pages, tabs).
|
|
102
|
+
*/
|
|
103
|
+
export interface AreaNavItem {
|
|
104
|
+
/** Unique identifier for this nav item within its parent */
|
|
105
|
+
id: string;
|
|
106
|
+
/** Display label */
|
|
107
|
+
label: MaybeLocalized<string>;
|
|
108
|
+
/** Navigation href (relative to area prefix) */
|
|
109
|
+
href?: string;
|
|
110
|
+
/** Icon identifier */
|
|
111
|
+
icon?: string;
|
|
112
|
+
/** Display order (lower = first) */
|
|
113
|
+
order?: number;
|
|
114
|
+
/** Required permissions to see this item */
|
|
115
|
+
permissions?: string[];
|
|
116
|
+
/** Children for hierarchical nav (groups → pages → tabs) */
|
|
117
|
+
children?: AreaNavItem[];
|
|
118
|
+
/**
|
|
119
|
+
* Area-specific metadata.
|
|
120
|
+
* CMS: { domain, entity, type, types: CollectionTypeEntry[] }
|
|
121
|
+
* Custom: { description, component, tabs }
|
|
122
|
+
* Customer: { section }
|
|
123
|
+
* Extra: {}
|
|
124
|
+
*/
|
|
125
|
+
meta?: Record<string, unknown>;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Area-specific navigation configuration.
|
|
129
|
+
*/
|
|
130
|
+
export interface AreaNavConfig {
|
|
131
|
+
/** Whether this area is enabled for the project */
|
|
132
|
+
enabled: boolean;
|
|
133
|
+
/** Section header configuration in sidebar */
|
|
134
|
+
section?: {
|
|
135
|
+
label?: MaybeLocalized<string>;
|
|
136
|
+
icon?: string;
|
|
137
|
+
/** Display order relative to other area sections */
|
|
138
|
+
order?: number;
|
|
139
|
+
/** Whether to show a divider above this section */
|
|
140
|
+
divider?: boolean;
|
|
141
|
+
};
|
|
142
|
+
/** Navigation items for this area */
|
|
143
|
+
items: AreaNavItem[];
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Unified navigation response from server.
|
|
147
|
+
* Single endpoint serves all area navigation for a project.
|
|
148
|
+
*
|
|
149
|
+
* URL pattern: GET /api/{projectId}/nav
|
|
150
|
+
*/
|
|
151
|
+
export interface UnifiedNavResponse {
|
|
152
|
+
/** Schema version for future migrations */
|
|
153
|
+
version: number;
|
|
154
|
+
/**
|
|
155
|
+
* Default landing configuration when accessing project root.
|
|
156
|
+
* If not specified, falls back to first enabled area.
|
|
157
|
+
*/
|
|
158
|
+
landing?: {
|
|
159
|
+
/** Target area */
|
|
160
|
+
area: AreaId;
|
|
161
|
+
/** Optional specific route within area (e.g., "dashboard/main" for custom) */
|
|
162
|
+
route?: string;
|
|
163
|
+
};
|
|
164
|
+
/** Per-area navigation configuration */
|
|
165
|
+
areas: Partial<Record<AreaId, AreaNavConfig>>;
|
|
166
|
+
}
|