@brendanbank/atrium-host-types 0.24.0 → 0.25.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/README.md +2 -2
- package/dist/index.d.ts +46 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,8 +32,8 @@ your `.npmrc`, delete it — npmjs.org is the default registry.
|
|
|
32
32
|
|
|
33
33
|
## Versioning
|
|
34
34
|
|
|
35
|
-
The package version tracks atrium's image version. Pin `^0.
|
|
36
|
-
"compatible with atrium 0.
|
|
35
|
+
The package version tracks atrium's image version. Pin `^0.25` for
|
|
36
|
+
"compatible with atrium 0.25.x"; bump together with the atrium image
|
|
37
37
|
to pick up new registry slots. New slots land as **optional** members
|
|
38
38
|
on `AtriumRegistry` first so a host that hasn't bumped yet still
|
|
39
39
|
type-checks.
|
package/dist/index.d.ts
CHANGED
|
@@ -186,6 +186,46 @@ export interface AdminTab {
|
|
|
186
186
|
* Available since atrium 0.16. */
|
|
187
187
|
order?: number;
|
|
188
188
|
}
|
|
189
|
+
/** Nav-only leaf inside a host-registered `SettingsGroup`. Carries no
|
|
190
|
+
* render — group children are sidebar pointers; the actual route is
|
|
191
|
+
* registered separately via `registerRoute`. `perm` gates the
|
|
192
|
+
* individual entry on top of any group-level `perm`. Available since
|
|
193
|
+
* atrium 0.25. */
|
|
194
|
+
export interface SettingsGroupChild {
|
|
195
|
+
key: string;
|
|
196
|
+
label: string;
|
|
197
|
+
/** Route path the sidebar entry navigates to. Must match a route the
|
|
198
|
+
* host has registered (or atrium ships); atrium does not synthesise
|
|
199
|
+
* a path for group children the way `registerAdminTab` does. */
|
|
200
|
+
to: string;
|
|
201
|
+
/** Permission code; the child is hidden for users who don't hold it. */
|
|
202
|
+
perm?: string;
|
|
203
|
+
order?: number;
|
|
204
|
+
}
|
|
205
|
+
/** Host-registered collapsible nav group. Renders inside the Admin or
|
|
206
|
+
* Settings sidebar parent (per `section`) as a nested expandable
|
|
207
|
+
* NavLink whose entries are the items in `children`. Empty groups —
|
|
208
|
+
* every child gated out, or `children` empty — hide entirely.
|
|
209
|
+
*
|
|
210
|
+
* Group children are nav-only; their content lives at the host-
|
|
211
|
+
* registered routes their `to` paths point at. Available since atrium
|
|
212
|
+
* 0.25. */
|
|
213
|
+
export interface SettingsGroup {
|
|
214
|
+
key: string;
|
|
215
|
+
label: string;
|
|
216
|
+
icon?: ReactElement;
|
|
217
|
+
/** Sidebar bucket. Default `'admin'`. `'settings'` puts the group
|
|
218
|
+
* inside the Settings parent above. */
|
|
219
|
+
section?: AdminSection;
|
|
220
|
+
/** Permission code that gates the entire group. When the user
|
|
221
|
+
* doesn't hold it, the group + every child are hidden in one shot
|
|
222
|
+
* — saves listing the same perm on every child. */
|
|
223
|
+
perm?: string;
|
|
224
|
+
/** Sort key within the chosen bucket. Same semantics as
|
|
225
|
+
* `AdminTab.order`. */
|
|
226
|
+
order?: number;
|
|
227
|
+
children: SettingsGroupChild[];
|
|
228
|
+
}
|
|
189
229
|
/** Insertion slot inside `ProfilePage`'s vertical card stack. Default
|
|
190
230
|
* `'after-roles'` — the natural place for extra preferences. */
|
|
191
231
|
export type ProfileSlot = 'after-profile' | 'after-password' | 'after-2fa' | 'after-roles' | 'after-sessions' | 'before-delete';
|
|
@@ -254,6 +294,12 @@ export interface AtriumRegistry {
|
|
|
254
294
|
* built-in already declares is preserved. Available since atrium
|
|
255
295
|
* 0.17. */
|
|
256
296
|
setBuiltinAdminTabSection?: (key: string, section: AdminSection, order?: number) => void;
|
|
297
|
+
/** Register a collapsible nav group inside the Admin or Settings
|
|
298
|
+
* sidebar parent. The group's children are nav-only pointers; the
|
|
299
|
+
* host registers the actual routes via `registerRoute`. Hides
|
|
300
|
+
* entirely when every child is perm-gated out. Available since
|
|
301
|
+
* atrium 0.25. */
|
|
302
|
+
registerSettingsGroup?: (group: SettingsGroup) => void;
|
|
257
303
|
registerProfileItem: (item: ProfileItem) => void;
|
|
258
304
|
registerNotificationKind: (renderer: NotificationKindRenderer) => void;
|
|
259
305
|
registerLocale: (overlay: LocaleOverlay) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brendanbank/atrium-host-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.1",
|
|
4
4
|
"description": "TypeScript declarations for the atrium host-extension contract: AtriumRegistry, UserContext, AdminUserRow, AtriumNotification, AtriumEvent. Source-of-truth shapes a host bundle types against, kept in sync with atrium's published image major.minor.",
|
|
5
5
|
"license": "BSD-2-Clause",
|
|
6
6
|
"type": "module",
|