@pramen/cms-editor 0.0.32 → 0.0.33
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
package/src/app-context.tsx
CHANGED
|
@@ -10,7 +10,12 @@ import { Api, clearConfig, isTokenExpired, loadConfig, saveConfig, type Config }
|
|
|
10
10
|
declare global {
|
|
11
11
|
interface Window {
|
|
12
12
|
/** Runtime config set by the host's /config.js (see @pramen/cms-editor build). */
|
|
13
|
-
PRAMEN_CMS_EDITOR?: {
|
|
13
|
+
PRAMEN_CMS_EDITOR?: {
|
|
14
|
+
signInUrl?: string;
|
|
15
|
+
/** Extra top-nav links to companion tools the host serves (e.g. a curation page).
|
|
16
|
+
* Rendered as plain external `<a>` links after the built-in tabs. */
|
|
17
|
+
extraNav?: { label: string; href: string }[];
|
|
18
|
+
};
|
|
14
19
|
}
|
|
15
20
|
}
|
|
16
21
|
|
package/src/routes/_layout.tsx
CHANGED
|
@@ -21,6 +21,9 @@ export default function RootLayout() {
|
|
|
21
21
|
const tabCls = (key: string) =>
|
|
22
22
|
active === key ? "bg-surface-muted text-fg" : "text-fg-muted";
|
|
23
23
|
|
|
24
|
+
// Host-configured links to companion tools (e.g. a curation page), from /config.js.
|
|
25
|
+
const extraNav = typeof window !== "undefined" ? window.PRAMEN_CMS_EDITOR?.extraNav ?? [] : [];
|
|
26
|
+
|
|
24
27
|
return (
|
|
25
28
|
<>
|
|
26
29
|
<div className="sticky top-0 z-10 flex items-center gap-4 bg-surface px-7 py-4">
|
|
@@ -35,6 +38,15 @@ export default function RootLayout() {
|
|
|
35
38
|
<Button variant="ghost" size="sm" className={tabCls("users")} onPress={() => navigate("users")}>Users</Button>
|
|
36
39
|
) : null}
|
|
37
40
|
<Button variant="ghost" size="sm" className={tabCls("settings")} onPress={() => navigate("settings")}>Settings</Button>
|
|
41
|
+
{extraNav.map((l) => (
|
|
42
|
+
<a
|
|
43
|
+
key={l.href}
|
|
44
|
+
href={l.href}
|
|
45
|
+
className="rounded-md px-2.5 py-1.5 text-sm text-fg-muted transition-colors hover:bg-surface-muted hover:text-fg"
|
|
46
|
+
>
|
|
47
|
+
{l.label}
|
|
48
|
+
</a>
|
|
49
|
+
))}
|
|
38
50
|
</nav>
|
|
39
51
|
<span className="ml-3 text-fg-subtle">{cfg.tenant}</span>
|
|
40
52
|
<Button variant="ghost" size="sm" onPress={reconfigure}>sign out</Button>
|