@campfire-interactive/shell-header 0.8.5 → 0.8.7

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.ts CHANGED
@@ -16,6 +16,15 @@ interface AppDefinition {
16
16
  * admin-style apps (e.g. User Management → ['admin', 'owner']).
17
17
  */
18
18
  requiresRole?: string[];
19
+ /**
20
+ * Optional path to append to the app's origin when building tile links
21
+ * (and the localhost fallback). Omit for apps whose root URL is the
22
+ * desired landing page; set for apps where the user should land on a
23
+ * specific surface (e.g. identity → `/admin/users` so the User
24
+ * Management tile lands on the users page rather than the launcher).
25
+ * Must start with `/`.
26
+ */
27
+ path?: string;
19
28
  }
20
29
  interface ShellUser {
21
30
  name: string;
@@ -210,10 +219,11 @@ declare function LocaleSwitcher({ currentLocale, supportedLocales, onLocaleChang
210
219
 
211
220
  declare const appCatalog: AppDefinition[];
212
221
  /**
213
- * Derive the app URL from the current hostname.
214
- * - localhost localhost:<localPort>
215
- * - *.dev.campfiresuite.com → <id>.dev.campfiresuite.com
216
- * - *.campfiresuite.com → <id>.campfiresuite.com
222
+ * Derive the app URL from the current hostname, optionally appending the
223
+ * catalog entry's preferred landing path.
224
+ * - localhostlocalhost:<localPort>[<path>]
225
+ * - *.dev.campfiresuite.com → <id>.dev.campfiresuite.com[<path>]
226
+ * - *.campfiresuite.com → <id>.campfiresuite.com[<path>]
217
227
  */
218
228
  declare function getAppUrl(app: AppDefinition): string;
219
229
 
package/dist/index.js CHANGED
@@ -34,19 +34,20 @@ var appCatalog = [
34
34
  { id: "pim", name: "Price Index", icon: "BarChart3", letter: "P", color: "#f97316", localPort: 3300 },
35
35
  { id: "cpq", name: "CPQ", icon: "Calculator", letter: "C", color: "#4f46e5", localPort: 3400 },
36
36
  { id: "omsf", name: "OMSF", icon: "FileText", letter: "O", color: "#0ea5e9", localPort: 3500 },
37
- { id: "identity", name: "User Management", icon: "Shield", letter: "U", color: "#8b5cf6", localPort: 3600, requiresRole: ["admin", "owner"] },
37
+ { id: "identity", name: "User Management", icon: "Shield", letter: "U", color: "#8b5cf6", localPort: 3600, requiresRole: ["admin", "owner"], path: "/admin/users" },
38
38
  { id: "bom", name: "BOM", icon: "Network", letter: "B", color: "#0d9488", localPort: 3700 }
39
39
  ];
40
40
  function getAppUrl(app) {
41
41
  const host = typeof window !== "undefined" ? window.location.hostname : "";
42
42
  const protocol = typeof window !== "undefined" ? window.location.protocol : "https:";
43
+ const path = app.path ?? "";
43
44
  if (host === "localhost" || host === "127.0.0.1") {
44
- return app.localPort ? `http://localhost:${app.localPort}` : "#";
45
+ return app.localPort ? `http://localhost:${app.localPort}${path}` : "#";
45
46
  }
46
47
  if (host.includes(".dev.")) {
47
- return `${protocol}//${app.id}.dev.campfiresuite.com`;
48
+ return `${protocol}//${app.id}.dev.campfiresuite.com${path}`;
48
49
  }
49
- return `${protocol}//${app.id}.campfiresuite.com`;
50
+ return `${protocol}//${app.id}.campfiresuite.com${path}`;
50
51
  }
51
52
 
52
53
  // src/AppSwitcher.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campfire-interactive/shell-header",
3
- "version": "0.8.5",
3
+ "version": "0.8.7",
4
4
  "description": "Shared shell header with app switcher for Campfire Suite",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",