@xeonr/console-shell 0.5.1 → 0.5.3
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/Gate.d.ts +8 -1
- package/dist/Gate.d.ts.map +1 -1
- package/dist/Gate.js +3 -2
- package/dist/Gate.js.map +1 -1
- package/package.json +3 -3
package/dist/Gate.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { Requires } from "./nav.ts";
|
|
3
|
-
export declare function Gate({ requires, section, what, manageHref, children }: {
|
|
3
|
+
export declare function Gate({ requires, section, what, manageHref, role, teamRole, children }: {
|
|
4
4
|
requires: Requires;
|
|
5
|
+
/** the role in words, when `requires` is a product key: "a platform administrator" */
|
|
6
|
+
role?: string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* false when no team grants it (platform admin): the page names the role
|
|
9
|
+
* alone, without a team or a members link. Default: true, except org:admin.
|
|
10
|
+
*/
|
|
11
|
+
teamRole?: boolean | undefined;
|
|
5
12
|
/** the section to keep lit (its NavItem key) */
|
|
6
13
|
section?: string | undefined;
|
|
7
14
|
/** what the page is, for the message: "API tokens" */
|
package/dist/Gate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Gate.d.ts","sourceRoot":"","sources":["../src/Gate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAazC,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"Gate.d.ts","sourceRoot":"","sources":["../src/Gate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAazC,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE;IACtF,QAAQ,EAAE,QAAQ,CAAC;IACnB,sFAAsF;IACtF,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAiBA;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAClF,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,MAAM,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAUA"}
|
package/dist/Gate.js
CHANGED
|
@@ -16,7 +16,7 @@ function roleWords(requires) {
|
|
|
16
16
|
return "owner";
|
|
17
17
|
return requires;
|
|
18
18
|
}
|
|
19
|
-
export function Gate({ requires, section, what, manageHref, children }) {
|
|
19
|
+
export function Gate({ requires, section, what, manageHref, role, teamRole, children }) {
|
|
20
20
|
const c = useConsole();
|
|
21
21
|
const cfg = useShellConfig();
|
|
22
22
|
const team = c.pageTeam ?? c.activeTeam;
|
|
@@ -24,7 +24,8 @@ export function Gate({ requires, section, what, manageHref, children }) {
|
|
|
24
24
|
useActiveSection(ok ? undefined : section);
|
|
25
25
|
if (ok)
|
|
26
26
|
return _jsx(_Fragment, { children: children });
|
|
27
|
-
|
|
27
|
+
const byTeam = teamRole ?? requires !== "org:admin";
|
|
28
|
+
return (_jsx(Forbidden, { what: what, role: role ?? roleWords(requires), teamRole: byTeam, team: byTeam ? team?.name || team?.slug : undefined, manageHref: byTeam ? manageHref ?? (c.homeHref !== "/" ? `${c.homeHref}/members` : undefined) : undefined }));
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
30
31
|
* The common entity screen in one place: publishes its crumb (a name, never
|
package/dist/Gate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Gate.js","sourceRoot":"","sources":["../src/Gate.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAc,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAa,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,6EAA6E;AAC7E,+EAA+E;AAC/E,4EAA4E;AAC5E,uEAAuE;AAEvE,SAAS,SAAS,CAAC,QAAkB;IACnC,IAAI,QAAQ,KAAK,WAAW;QAAE,OAAO,+BAA+B,CAAC;IACrE,IAAI,QAAQ,KAAK,YAAY;QAAE,OAAO,OAAO,CAAC;IAC9C,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"Gate.js","sourceRoot":"","sources":["../src/G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AAI,EAAE,IAAI,IAAI,SAAS,CAAC,QAAQ,CAAC,EACjC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,EACnD,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,GACzG,CACH,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAO/E;IACC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC3B,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC1B,OAAO,CACL,8BACG,MAAM,EACN,IAAI,EACL,cAAK,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,YAAG,QAAQ,GAAO,IAC9C,CACJ,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xeonr/console-shell",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "The Xeonr Cloud Console chrome: product rail, team switcher, section sidebar, top bar, ⌘K and the All-products launcher, plus the console context hooks every product console mounts.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"react-dom": "^19.0.0",
|
|
24
24
|
"react-router-dom": "^7.0.0",
|
|
25
25
|
"styled-components": "^6.0.0",
|
|
26
|
-
"@xeonr/platform-ui": "^0.5.
|
|
26
|
+
"@xeonr/platform-ui": "^0.5.3"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^24.19.2",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"react-router-dom": "^7.8.0",
|
|
35
35
|
"styled-components": "^6.1.19",
|
|
36
36
|
"typescript": "^5.9.2",
|
|
37
|
-
"@xeonr/platform-ui": "0.5.
|
|
37
|
+
"@xeonr/platform-ui": "0.5.3"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@bufbuild/protobuf": "^2.10.2",
|