@mercurjs/dashboard-sdk 2.3.6-canary.9 → 2.3.7-canary.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/index.d.cts CHANGED
@@ -1,70 +1,6 @@
1
- import { a as Permission } from './types-Cziny1v0.cjs';
2
- export { B as BuiltMercurConfig, M as MercurConfig, P as PERMISSION_RIGHT_RANK, b as PermissionKey, c as PermissionKeys, d as PermissionMap, e as PermissionRight, f as PermissionsContextValue, R as RouteConfig, g as RouteHandle, h as buildPermission, p as parsePermission, s as satisfiesPermission } from './types-Cziny1v0.cjs';
3
- import { ComponentType, ReactNode } from 'react';
4
-
5
- /**
6
- * Open registry interfaces. Each panel package ships a generated
7
- * `extension-targets.d.ts` that seeds the built-in ids into these interfaces
8
- * (declaration merging), and a developer augments them by hand to register a
9
- * zone their own page renders. The helper unions read off the interface keys.
10
- *
11
- * @example
12
- * declare module "@mercurjs/dashboard-sdk" {
13
- * interface WidgetZoneRegistry {
14
- * "erp.dashboard.before": true
15
- * }
16
- * }
17
- */
18
- interface WidgetZoneRegistry {
19
- }
20
- interface NavItemRegistry {
21
- }
22
- interface NavParentRegistry {
23
- }
24
- type WidgetZoneId = keyof WidgetZoneRegistry extends never ? string : keyof WidgetZoneRegistry;
25
- type NavItemId = keyof NavItemRegistry extends never ? string : keyof NavItemRegistry;
26
- type NavParentId = keyof NavParentRegistry extends never ? string : keyof NavParentRegistry;
27
- /**
28
- * A widget is a React component attached to a named zone on a page. The
29
- * placement (`before | after`) is encoded as the zone-id suffix, so there is no
30
- * separate rank field — multiple `before`/`after` widgets stack in registration
31
- * order.
32
- */
33
- interface WidgetConfig {
34
- zone: WidgetZoneId | WidgetZoneId[];
35
- /** Stable id; derived from the file path at build time when omitted. */
36
- id?: string;
37
- /**
38
- * Permission(s) the actor needs for the widget to render. With several, any
39
- * one is enough.
40
- */
41
- permission?: Permission | Permission[];
42
- /**
43
- * i18n key or literal naming the tab. Required for a `*.tabs.*` zone, where
44
- * the widget renders as a tab's panel; ignored elsewhere.
45
- */
46
- label?: string;
47
- }
48
- /** Override for a single built-in navigation item. */
49
- interface NavItemOverride {
50
- id: NavItemId;
51
- /** Order within the item's parent (or among top-level items). */
52
- rank?: number;
53
- /** Remove from the sidebar (route may still be reachable directly). */
54
- hidden?: boolean;
55
- /** i18n key or literal replacing the item's label. */
56
- label?: string;
57
- /** Icon component replacing the item's icon. */
58
- icon?: ComponentType;
59
- /**
60
- * Re-parent the item: a built-in parent id moves it under that parent's
61
- * children; `null` promotes a nested item to the top level.
62
- */
63
- nested?: NavParentId | null;
64
- }
65
- interface NavigationConfig {
66
- items: NavItemOverride[];
67
- }
1
+ import { h as NavigationConfig, W as WidgetConfig } from './types-BTgTMD_t.cjs';
2
+ export { B as BuiltMercurConfig, M as MercurConfig, N as NavGroupConfig, a as NavGroupId, b as NavGroupRegistry, c as NavItemId, d as NavItemOverride, e as NavItemRegistry, f as NavParentId, g as NavParentRegistry, P as PERMISSION_RIGHT_RANK, i as Permission, j as PermissionKey, k as PermissionKeys, l as PermissionMap, m as PermissionRight, n as PermissionsContextValue, R as RouteConfig, o as RouteHandle, p as WidgetZoneId, q as WidgetZoneRegistry, r as buildPermission, s as parsePermission, t as satisfiesPermission } from './types-BTgTMD_t.cjs';
3
+ import { ReactNode, ComponentType } from 'react';
68
4
 
69
5
  /**
70
6
  * Minimal structural stand-in for a Zod schema, so the SDK stays free of a zod
@@ -159,10 +95,35 @@ type CustomColumn = {
159
95
  value?: unknown;
160
96
  }>;
161
97
  };
98
+ type CustomListFilterOption = {
99
+ label: string;
100
+ value: unknown;
101
+ };
102
+ /**
103
+ * ADD (unknown key), REPLACE (built-in key + a full filter definition), or
104
+ * REMOVE (built-in key + `remove: true`) a list filter. Mirrors
105
+ * `CustomDisplayField`: the `key` is the query param the filter writes.
106
+ */
107
+ type CustomListFilter = ({
108
+ key: string;
109
+ label: string;
110
+ remove?: never;
111
+ } & ({
112
+ type: "select";
113
+ options: CustomListFilterOption[];
114
+ multiple?: boolean;
115
+ searchable?: boolean;
116
+ } | {
117
+ type: "date" | "string" | "number";
118
+ options?: never;
119
+ })) | {
120
+ key: string;
121
+ remove: true;
122
+ };
162
123
  type CustomListExtension = {
163
124
  columns?: CustomColumn[];
164
125
  bulkActions?: SectionAction[];
165
- filters?: unknown[];
126
+ filters?: CustomListFilter[];
166
127
  viewDefaults?: {
167
128
  columnVisibility?: Record<string, boolean>;
168
129
  columnOrder?: string[];
@@ -200,7 +161,7 @@ interface CustomFieldsConfig<TModel extends CustomFieldModel = CustomFieldModel>
200
161
  }
201
162
 
202
163
  declare function defineWidgetConfig(config: WidgetConfig): WidgetConfig;
203
- declare function defineNavigationConfig(config: NavigationConfig): NavigationConfig;
164
+ declare function defineNavigationConfig<TGroup extends string = never>(config: NavigationConfig<TGroup>): NavigationConfig<TGroup>;
204
165
  declare function defineCustomFieldsConfig<TModel extends CustomFieldModel>(config: CustomFieldsConfig<TModel>): CustomFieldsConfig<TModel>;
205
166
 
206
- export { type ActivityEntry, type CustomColumn, type CustomDisplayEntry, type CustomDisplayField, type CustomFieldAction, type CustomFieldActionRegistry, type CustomFieldModel, type CustomFieldsConfig, type CustomFieldsRegistry, type CustomFormEntry, type CustomFormField, type CustomFormTab, type CustomFormZone, type CustomListExtension, type FieldValidation, type NavItemId, type NavItemOverride, type NavItemRegistry, type NavParentId, type NavParentRegistry, type NavigationConfig, Permission, type SectionAction, type WidgetConfig, type WidgetZoneId, type WidgetZoneRegistry, defineCustomFieldsConfig, defineNavigationConfig, defineWidgetConfig };
167
+ export { type ActivityEntry, type CustomColumn, type CustomDisplayEntry, type CustomDisplayField, type CustomFieldAction, type CustomFieldActionRegistry, type CustomFieldModel, type CustomFieldsConfig, type CustomFieldsRegistry, type CustomFormEntry, type CustomFormField, type CustomFormTab, type CustomFormZone, type CustomListExtension, type CustomListFilter, type CustomListFilterOption, type FieldValidation, NavigationConfig, type SectionAction, WidgetConfig, defineCustomFieldsConfig, defineNavigationConfig, defineWidgetConfig };
package/dist/index.d.ts CHANGED
@@ -1,70 +1,6 @@
1
- import { a as Permission } from './types-Cziny1v0.js';
2
- export { B as BuiltMercurConfig, M as MercurConfig, P as PERMISSION_RIGHT_RANK, b as PermissionKey, c as PermissionKeys, d as PermissionMap, e as PermissionRight, f as PermissionsContextValue, R as RouteConfig, g as RouteHandle, h as buildPermission, p as parsePermission, s as satisfiesPermission } from './types-Cziny1v0.js';
3
- import { ComponentType, ReactNode } from 'react';
4
-
5
- /**
6
- * Open registry interfaces. Each panel package ships a generated
7
- * `extension-targets.d.ts` that seeds the built-in ids into these interfaces
8
- * (declaration merging), and a developer augments them by hand to register a
9
- * zone their own page renders. The helper unions read off the interface keys.
10
- *
11
- * @example
12
- * declare module "@mercurjs/dashboard-sdk" {
13
- * interface WidgetZoneRegistry {
14
- * "erp.dashboard.before": true
15
- * }
16
- * }
17
- */
18
- interface WidgetZoneRegistry {
19
- }
20
- interface NavItemRegistry {
21
- }
22
- interface NavParentRegistry {
23
- }
24
- type WidgetZoneId = keyof WidgetZoneRegistry extends never ? string : keyof WidgetZoneRegistry;
25
- type NavItemId = keyof NavItemRegistry extends never ? string : keyof NavItemRegistry;
26
- type NavParentId = keyof NavParentRegistry extends never ? string : keyof NavParentRegistry;
27
- /**
28
- * A widget is a React component attached to a named zone on a page. The
29
- * placement (`before | after`) is encoded as the zone-id suffix, so there is no
30
- * separate rank field — multiple `before`/`after` widgets stack in registration
31
- * order.
32
- */
33
- interface WidgetConfig {
34
- zone: WidgetZoneId | WidgetZoneId[];
35
- /** Stable id; derived from the file path at build time when omitted. */
36
- id?: string;
37
- /**
38
- * Permission(s) the actor needs for the widget to render. With several, any
39
- * one is enough.
40
- */
41
- permission?: Permission | Permission[];
42
- /**
43
- * i18n key or literal naming the tab. Required for a `*.tabs.*` zone, where
44
- * the widget renders as a tab's panel; ignored elsewhere.
45
- */
46
- label?: string;
47
- }
48
- /** Override for a single built-in navigation item. */
49
- interface NavItemOverride {
50
- id: NavItemId;
51
- /** Order within the item's parent (or among top-level items). */
52
- rank?: number;
53
- /** Remove from the sidebar (route may still be reachable directly). */
54
- hidden?: boolean;
55
- /** i18n key or literal replacing the item's label. */
56
- label?: string;
57
- /** Icon component replacing the item's icon. */
58
- icon?: ComponentType;
59
- /**
60
- * Re-parent the item: a built-in parent id moves it under that parent's
61
- * children; `null` promotes a nested item to the top level.
62
- */
63
- nested?: NavParentId | null;
64
- }
65
- interface NavigationConfig {
66
- items: NavItemOverride[];
67
- }
1
+ import { h as NavigationConfig, W as WidgetConfig } from './types-BTgTMD_t.js';
2
+ export { B as BuiltMercurConfig, M as MercurConfig, N as NavGroupConfig, a as NavGroupId, b as NavGroupRegistry, c as NavItemId, d as NavItemOverride, e as NavItemRegistry, f as NavParentId, g as NavParentRegistry, P as PERMISSION_RIGHT_RANK, i as Permission, j as PermissionKey, k as PermissionKeys, l as PermissionMap, m as PermissionRight, n as PermissionsContextValue, R as RouteConfig, o as RouteHandle, p as WidgetZoneId, q as WidgetZoneRegistry, r as buildPermission, s as parsePermission, t as satisfiesPermission } from './types-BTgTMD_t.js';
3
+ import { ReactNode, ComponentType } from 'react';
68
4
 
69
5
  /**
70
6
  * Minimal structural stand-in for a Zod schema, so the SDK stays free of a zod
@@ -159,10 +95,35 @@ type CustomColumn = {
159
95
  value?: unknown;
160
96
  }>;
161
97
  };
98
+ type CustomListFilterOption = {
99
+ label: string;
100
+ value: unknown;
101
+ };
102
+ /**
103
+ * ADD (unknown key), REPLACE (built-in key + a full filter definition), or
104
+ * REMOVE (built-in key + `remove: true`) a list filter. Mirrors
105
+ * `CustomDisplayField`: the `key` is the query param the filter writes.
106
+ */
107
+ type CustomListFilter = ({
108
+ key: string;
109
+ label: string;
110
+ remove?: never;
111
+ } & ({
112
+ type: "select";
113
+ options: CustomListFilterOption[];
114
+ multiple?: boolean;
115
+ searchable?: boolean;
116
+ } | {
117
+ type: "date" | "string" | "number";
118
+ options?: never;
119
+ })) | {
120
+ key: string;
121
+ remove: true;
122
+ };
162
123
  type CustomListExtension = {
163
124
  columns?: CustomColumn[];
164
125
  bulkActions?: SectionAction[];
165
- filters?: unknown[];
126
+ filters?: CustomListFilter[];
166
127
  viewDefaults?: {
167
128
  columnVisibility?: Record<string, boolean>;
168
129
  columnOrder?: string[];
@@ -200,7 +161,7 @@ interface CustomFieldsConfig<TModel extends CustomFieldModel = CustomFieldModel>
200
161
  }
201
162
 
202
163
  declare function defineWidgetConfig(config: WidgetConfig): WidgetConfig;
203
- declare function defineNavigationConfig(config: NavigationConfig): NavigationConfig;
164
+ declare function defineNavigationConfig<TGroup extends string = never>(config: NavigationConfig<TGroup>): NavigationConfig<TGroup>;
204
165
  declare function defineCustomFieldsConfig<TModel extends CustomFieldModel>(config: CustomFieldsConfig<TModel>): CustomFieldsConfig<TModel>;
205
166
 
206
- export { type ActivityEntry, type CustomColumn, type CustomDisplayEntry, type CustomDisplayField, type CustomFieldAction, type CustomFieldActionRegistry, type CustomFieldModel, type CustomFieldsConfig, type CustomFieldsRegistry, type CustomFormEntry, type CustomFormField, type CustomFormTab, type CustomFormZone, type CustomListExtension, type FieldValidation, type NavItemId, type NavItemOverride, type NavItemRegistry, type NavParentId, type NavParentRegistry, type NavigationConfig, Permission, type SectionAction, type WidgetConfig, type WidgetZoneId, type WidgetZoneRegistry, defineCustomFieldsConfig, defineNavigationConfig, defineWidgetConfig };
167
+ export { type ActivityEntry, type CustomColumn, type CustomDisplayEntry, type CustomDisplayField, type CustomFieldAction, type CustomFieldActionRegistry, type CustomFieldModel, type CustomFieldsConfig, type CustomFieldsRegistry, type CustomFormEntry, type CustomFormField, type CustomFormTab, type CustomFormZone, type CustomListExtension, type CustomListFilter, type CustomListFilterOption, type FieldValidation, NavigationConfig, type SectionAction, WidgetConfig, defineCustomFieldsConfig, defineNavigationConfig, defineWidgetConfig };
@@ -95,6 +95,93 @@ declare function parsePermission(permission: string): {
95
95
  declare function buildPermission(key: PermissionKey, right: PermissionRight): Permission;
96
96
  declare function satisfiesPermission(permissions: PermissionMap, key: string, right: PermissionRight): boolean;
97
97
 
98
+ /**
99
+ * Open registry interfaces. Each panel package ships a generated
100
+ * `extension-targets.d.ts` that seeds the built-in ids into these interfaces
101
+ * (declaration merging), and a developer augments them by hand to register a
102
+ * zone their own page renders. The helper unions read off the interface keys.
103
+ *
104
+ * @example
105
+ * declare module "@mercurjs/dashboard-sdk" {
106
+ * interface WidgetZoneRegistry {
107
+ * "erp.dashboard.before": true
108
+ * }
109
+ * }
110
+ */
111
+ interface WidgetZoneRegistry {
112
+ }
113
+ interface NavItemRegistry {
114
+ }
115
+ interface NavParentRegistry {
116
+ }
117
+ interface NavGroupRegistry {
118
+ }
119
+ type WidgetZoneId = keyof WidgetZoneRegistry extends never ? string : keyof WidgetZoneRegistry;
120
+ type NavItemId = keyof NavItemRegistry extends never ? string : keyof NavItemRegistry;
121
+ type NavParentId = keyof NavParentRegistry extends never ? string : keyof NavParentRegistry;
122
+ type NavGroupId = keyof NavGroupRegistry extends never ? string : keyof NavGroupRegistry;
123
+ /**
124
+ * A widget is a React component attached to a named zone on a page. The
125
+ * placement (`before | after`) is encoded as the zone-id suffix, so there is no
126
+ * separate rank field — multiple `before`/`after` widgets stack in registration
127
+ * order.
128
+ */
129
+ interface WidgetConfig {
130
+ zone: WidgetZoneId | WidgetZoneId[];
131
+ /** Stable id; derived from the file path at build time when omitted. */
132
+ id?: string;
133
+ /**
134
+ * Permission(s) the actor needs for the widget to render. With several, any
135
+ * one is enough.
136
+ */
137
+ permission?: Permission | Permission[];
138
+ /**
139
+ * i18n key or literal naming the tab. Required for a `*.tabs.*` zone, where
140
+ * the widget renders as a tab's panel; ignored elsewhere.
141
+ */
142
+ label?: string;
143
+ }
144
+ /** Override for a single built-in navigation item. */
145
+ interface NavItemOverride<TGroup extends string = never> {
146
+ id: NavItemId;
147
+ /** Order within the item's parent (or among top-level items). */
148
+ rank?: number;
149
+ /** Remove from the sidebar (route may still be reachable directly). */
150
+ hidden?: boolean;
151
+ /** i18n key or literal replacing the item's label. */
152
+ label?: string;
153
+ /** Icon component replacing the item's icon. */
154
+ icon?: ComponentType;
155
+ /**
156
+ * Re-parent the item: a built-in parent id moves it under that parent's
157
+ * children; `null` promotes a nested item to the top level.
158
+ */
159
+ nested?: NavParentId | null;
160
+ /**
161
+ * List the item under a group heading: a built-in settings group id or one
162
+ * declared in `groups`. Main sidebar items only join declared groups.
163
+ */
164
+ group?: NavGroupId | TGroup;
165
+ }
166
+ /**
167
+ * Declares a sidebar group, or overrides a built-in settings group by id. A
168
+ * group renders in whichever sidebar its items live in.
169
+ */
170
+ interface NavGroupConfig<TId extends string = string> {
171
+ id: NavGroupId | TId;
172
+ /** i18n key (with `translationNs`) or literal. Falls back to the id. */
173
+ label?: string;
174
+ translationNs?: string;
175
+ /** Order among groups, lower first. Built-in settings groups rank 0, 1, 2… */
176
+ rank?: number;
177
+ /** Remove the group and its items from the sidebar. */
178
+ hidden?: boolean;
179
+ }
180
+ interface NavigationConfig<TGroup extends string = never> {
181
+ groups?: NavGroupConfig<TGroup>[];
182
+ items?: NavItemOverride<NoInfer<TGroup>>[];
183
+ }
184
+
98
185
  /**
99
186
  * Configuration for the Mercur dashboard plugin.
100
187
  *
@@ -162,6 +249,12 @@ type RouteConfig = {
162
249
  icon?: ComponentType;
163
250
  rank?: number;
164
251
  nested?: string;
252
+ /**
253
+ * Sidebar group to list the route under: one declared in `_navigation.ts`
254
+ * or, for a `/settings/*` route, a built-in settings group. Must be a
255
+ * string literal.
256
+ */
257
+ group?: NavGroupId | (string & {});
165
258
  translationNs?: string;
166
259
  public?: boolean;
167
260
  /**
@@ -186,4 +279,4 @@ type RouteHandle = {
186
279
  breadcrumb?: (match: never) => ReactNode;
187
280
  };
188
281
 
189
- export { type BuiltMercurConfig as B, type MercurConfig as M, PERMISSION_RIGHT_RANK as P, type RouteConfig as R, type Permission as a, type PermissionKey as b, type PermissionKeys as c, type PermissionMap as d, type PermissionRight as e, type PermissionsContextValue as f, type RouteHandle as g, buildPermission as h, parsePermission as p, satisfiesPermission as s };
282
+ export { type BuiltMercurConfig as B, type MercurConfig as M, type NavGroupConfig as N, PERMISSION_RIGHT_RANK as P, type RouteConfig as R, type WidgetConfig as W, type NavGroupId as a, type NavGroupRegistry as b, type NavItemId as c, type NavItemOverride as d, type NavItemRegistry as e, type NavParentId as f, type NavParentRegistry as g, type NavigationConfig as h, type Permission as i, type PermissionKey as j, type PermissionKeys as k, type PermissionMap as l, type PermissionRight as m, type PermissionsContextValue as n, type RouteHandle as o, type WidgetZoneId as p, type WidgetZoneRegistry as q, buildPermission as r, parsePermission as s, satisfiesPermission as t };
@@ -95,6 +95,93 @@ declare function parsePermission(permission: string): {
95
95
  declare function buildPermission(key: PermissionKey, right: PermissionRight): Permission;
96
96
  declare function satisfiesPermission(permissions: PermissionMap, key: string, right: PermissionRight): boolean;
97
97
 
98
+ /**
99
+ * Open registry interfaces. Each panel package ships a generated
100
+ * `extension-targets.d.ts` that seeds the built-in ids into these interfaces
101
+ * (declaration merging), and a developer augments them by hand to register a
102
+ * zone their own page renders. The helper unions read off the interface keys.
103
+ *
104
+ * @example
105
+ * declare module "@mercurjs/dashboard-sdk" {
106
+ * interface WidgetZoneRegistry {
107
+ * "erp.dashboard.before": true
108
+ * }
109
+ * }
110
+ */
111
+ interface WidgetZoneRegistry {
112
+ }
113
+ interface NavItemRegistry {
114
+ }
115
+ interface NavParentRegistry {
116
+ }
117
+ interface NavGroupRegistry {
118
+ }
119
+ type WidgetZoneId = keyof WidgetZoneRegistry extends never ? string : keyof WidgetZoneRegistry;
120
+ type NavItemId = keyof NavItemRegistry extends never ? string : keyof NavItemRegistry;
121
+ type NavParentId = keyof NavParentRegistry extends never ? string : keyof NavParentRegistry;
122
+ type NavGroupId = keyof NavGroupRegistry extends never ? string : keyof NavGroupRegistry;
123
+ /**
124
+ * A widget is a React component attached to a named zone on a page. The
125
+ * placement (`before | after`) is encoded as the zone-id suffix, so there is no
126
+ * separate rank field — multiple `before`/`after` widgets stack in registration
127
+ * order.
128
+ */
129
+ interface WidgetConfig {
130
+ zone: WidgetZoneId | WidgetZoneId[];
131
+ /** Stable id; derived from the file path at build time when omitted. */
132
+ id?: string;
133
+ /**
134
+ * Permission(s) the actor needs for the widget to render. With several, any
135
+ * one is enough.
136
+ */
137
+ permission?: Permission | Permission[];
138
+ /**
139
+ * i18n key or literal naming the tab. Required for a `*.tabs.*` zone, where
140
+ * the widget renders as a tab's panel; ignored elsewhere.
141
+ */
142
+ label?: string;
143
+ }
144
+ /** Override for a single built-in navigation item. */
145
+ interface NavItemOverride<TGroup extends string = never> {
146
+ id: NavItemId;
147
+ /** Order within the item's parent (or among top-level items). */
148
+ rank?: number;
149
+ /** Remove from the sidebar (route may still be reachable directly). */
150
+ hidden?: boolean;
151
+ /** i18n key or literal replacing the item's label. */
152
+ label?: string;
153
+ /** Icon component replacing the item's icon. */
154
+ icon?: ComponentType;
155
+ /**
156
+ * Re-parent the item: a built-in parent id moves it under that parent's
157
+ * children; `null` promotes a nested item to the top level.
158
+ */
159
+ nested?: NavParentId | null;
160
+ /**
161
+ * List the item under a group heading: a built-in settings group id or one
162
+ * declared in `groups`. Main sidebar items only join declared groups.
163
+ */
164
+ group?: NavGroupId | TGroup;
165
+ }
166
+ /**
167
+ * Declares a sidebar group, or overrides a built-in settings group by id. A
168
+ * group renders in whichever sidebar its items live in.
169
+ */
170
+ interface NavGroupConfig<TId extends string = string> {
171
+ id: NavGroupId | TId;
172
+ /** i18n key (with `translationNs`) or literal. Falls back to the id. */
173
+ label?: string;
174
+ translationNs?: string;
175
+ /** Order among groups, lower first. Built-in settings groups rank 0, 1, 2… */
176
+ rank?: number;
177
+ /** Remove the group and its items from the sidebar. */
178
+ hidden?: boolean;
179
+ }
180
+ interface NavigationConfig<TGroup extends string = never> {
181
+ groups?: NavGroupConfig<TGroup>[];
182
+ items?: NavItemOverride<NoInfer<TGroup>>[];
183
+ }
184
+
98
185
  /**
99
186
  * Configuration for the Mercur dashboard plugin.
100
187
  *
@@ -162,6 +249,12 @@ type RouteConfig = {
162
249
  icon?: ComponentType;
163
250
  rank?: number;
164
251
  nested?: string;
252
+ /**
253
+ * Sidebar group to list the route under: one declared in `_navigation.ts`
254
+ * or, for a `/settings/*` route, a built-in settings group. Must be a
255
+ * string literal.
256
+ */
257
+ group?: NavGroupId | (string & {});
165
258
  translationNs?: string;
166
259
  public?: boolean;
167
260
  /**
@@ -186,4 +279,4 @@ type RouteHandle = {
186
279
  breadcrumb?: (match: never) => ReactNode;
187
280
  };
188
281
 
189
- export { type BuiltMercurConfig as B, type MercurConfig as M, PERMISSION_RIGHT_RANK as P, type RouteConfig as R, type Permission as a, type PermissionKey as b, type PermissionKeys as c, type PermissionMap as d, type PermissionRight as e, type PermissionsContextValue as f, type RouteHandle as g, buildPermission as h, parsePermission as p, satisfiesPermission as s };
282
+ export { type BuiltMercurConfig as B, type MercurConfig as M, type NavGroupConfig as N, PERMISSION_RIGHT_RANK as P, type RouteConfig as R, type WidgetConfig as W, type NavGroupId as a, type NavGroupRegistry as b, type NavItemId as c, type NavItemOverride as d, type NavItemRegistry as e, type NavParentId as f, type NavParentRegistry as g, type NavigationConfig as h, type Permission as i, type PermissionKey as j, type PermissionKeys as k, type PermissionMap as l, type PermissionRight as m, type PermissionsContextValue as n, type RouteHandle as o, type WidgetZoneId as p, type WidgetZoneRegistry as q, buildPermission as r, parsePermission as s, satisfiesPermission as t };
package/dist/vite.cjs CHANGED
@@ -464,6 +464,13 @@ function processConfigProperties(properties) {
464
464
  if (nested && (0, import_types.isObjectProperty)(nested) && (0, import_types.isStringLiteral)(nested.value)) {
465
465
  nestedValue = nested.value.value;
466
466
  }
467
+ const group = properties.find(
468
+ (prop) => (0, import_types.isObjectProperty)(prop) && (0, import_types.isIdentifier)(prop.key, { name: "group" })
469
+ );
470
+ let groupValue;
471
+ if (group && (0, import_types.isObjectProperty)(group) && (0, import_types.isStringLiteral)(group.value)) {
472
+ groupValue = group.value.value;
473
+ }
467
474
  const translationNs = properties.find(
468
475
  (prop) => (0, import_types.isObjectProperty)(prop) && (0, import_types.isIdentifier)(prop.key, { name: "translationNs" })
469
476
  );
@@ -490,6 +497,7 @@ function processConfigProperties(properties) {
490
497
  icon: hasIcon,
491
498
  rank: rankValue,
492
499
  nested: nestedValue,
500
+ group: groupValue,
493
501
  translationNs: translationNsValue,
494
502
  // Referenced by identifier at runtime rather than extracted here, so
495
503
  // the array may be computed instead of a string-literal list.
@@ -539,6 +547,7 @@ function generateMenuItem(config, file, routesDir, index) {
539
547
  path: getRoute2(file, routesDir),
540
548
  rank: config.rank,
541
549
  nested: config.nested,
550
+ group: config.group,
542
551
  translationNs: config.translationNs ? `${configName}.translationNs` : void 0,
543
552
  permissions: config.permissions ? `${configName}.permissions` : void 0,
544
553
  requireAll: config.requireAll
@@ -551,6 +560,7 @@ function formatMenuItem(menuItem) {
551
560
  ` path: "${menuItem.path}"`,
552
561
  ` rank: ${menuItem.rank !== void 0 ? menuItem.rank : "undefined"}`,
553
562
  ` nested: ${menuItem.nested ? `"${menuItem.nested}"` : "undefined"}`,
563
+ ` group: ${menuItem.group ? JSON.stringify(menuItem.group) : "undefined"}`,
554
564
  ` translationNs: ${menuItem.translationNs || "undefined"}`,
555
565
  ` permissions: ${menuItem.permissions || "undefined"}`,
556
566
  ` requireAll: ${menuItem.requireAll !== void 0 ? menuItem.requireAll : "undefined"}`
package/dist/vite.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as Vite from 'vite';
2
- import { M as MercurConfig } from './types-Cziny1v0.cjs';
2
+ import { M as MercurConfig } from './types-BTgTMD_t.cjs';
3
3
  import 'react';
4
4
 
5
5
  declare function mercurDashboardPlugin(pluginConfig: MercurConfig): Vite.Plugin;
package/dist/vite.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as Vite from 'vite';
2
- import { M as MercurConfig } from './types-Cziny1v0.js';
2
+ import { M as MercurConfig } from './types-BTgTMD_t.js';
3
3
  import 'react';
4
4
 
5
5
  declare function mercurDashboardPlugin(pluginConfig: MercurConfig): Vite.Plugin;
package/dist/vite.js CHANGED
@@ -444,6 +444,13 @@ function processConfigProperties(properties) {
444
444
  if (nested && isObjectProperty(nested) && isStringLiteral(nested.value)) {
445
445
  nestedValue = nested.value.value;
446
446
  }
447
+ const group = properties.find(
448
+ (prop) => isObjectProperty(prop) && isIdentifier(prop.key, { name: "group" })
449
+ );
450
+ let groupValue;
451
+ if (group && isObjectProperty(group) && isStringLiteral(group.value)) {
452
+ groupValue = group.value.value;
453
+ }
447
454
  const translationNs = properties.find(
448
455
  (prop) => isObjectProperty(prop) && isIdentifier(prop.key, { name: "translationNs" })
449
456
  );
@@ -470,6 +477,7 @@ function processConfigProperties(properties) {
470
477
  icon: hasIcon,
471
478
  rank: rankValue,
472
479
  nested: nestedValue,
480
+ group: groupValue,
473
481
  translationNs: translationNsValue,
474
482
  // Referenced by identifier at runtime rather than extracted here, so
475
483
  // the array may be computed instead of a string-literal list.
@@ -519,6 +527,7 @@ function generateMenuItem(config, file, routesDir, index) {
519
527
  path: getRoute2(file, routesDir),
520
528
  rank: config.rank,
521
529
  nested: config.nested,
530
+ group: config.group,
522
531
  translationNs: config.translationNs ? `${configName}.translationNs` : void 0,
523
532
  permissions: config.permissions ? `${configName}.permissions` : void 0,
524
533
  requireAll: config.requireAll
@@ -531,6 +540,7 @@ function formatMenuItem(menuItem) {
531
540
  ` path: "${menuItem.path}"`,
532
541
  ` rank: ${menuItem.rank !== void 0 ? menuItem.rank : "undefined"}`,
533
542
  ` nested: ${menuItem.nested ? `"${menuItem.nested}"` : "undefined"}`,
543
+ ` group: ${menuItem.group ? JSON.stringify(menuItem.group) : "undefined"}`,
534
544
  ` translationNs: ${menuItem.translationNs || "undefined"}`,
535
545
  ` permissions: ${menuItem.permissions || "undefined"}`,
536
546
  ` requireAll: ${menuItem.requireAll !== void 0 ? menuItem.requireAll : "undefined"}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercurjs/dashboard-sdk",
3
- "version": "2.3.6-canary.9",
3
+ "version": "2.3.7-canary.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mercurjs/mercur",