spine-framework-cortex 0.2.10 → 0.2.11

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.
@@ -10,6 +10,7 @@
10
10
  import * as React from "react"
11
11
  import { useNavigate, useLocation } from "react-router-dom"
12
12
  import { useAuth } from "@core/contexts/AuthContext"
13
+ import { useAppPath } from "@core/hooks/useAppPath"
13
14
  import {
14
15
  LayoutDashboard,
15
16
  Building2,
@@ -38,29 +39,30 @@ import {
38
39
  SidebarRail,
39
40
  } from "@core/components/ui/sidebar"
40
41
 
41
- const crmItems = [
42
- { title: "Dashboard", url: "/cortex/dashboard", icon: LayoutDashboard },
43
- { title: "Accounts", url: "/cortex/crm/accounts", icon: Building2 },
44
- { title: "Contacts", url: "/cortex/crm/contacts", icon: Users },
45
- { title: "Deals", url: "/cortex/crm/deals", icon: Handshake },
46
- { title: "Health", url: "/cortex/crm/health", icon: Heart },
47
- { title: "Activity", url: "/cortex/crm/activity", icon: Activity },
48
- ]
49
-
50
- const opsItems = [
51
- { title: "Operations Dashboard", url: "/cortex/operations", icon: BarChart3 },
52
- { title: "Audit Funnel", url: "/cortex/operations/audit-funnel", icon: Search },
53
- { title: "Install Funnel", url: "/cortex/operations/install-funnel", icon: Download },
54
- { title: "Support", url: "/cortex/support", icon: Headphones },
55
- { title: "Community", url: "/cortex/community", icon: Users },
56
- { title: "Knowledge Base", url: "/cortex/kb", icon: BookOpen },
57
- { title: "Courses", url: "/cortex/courses", icon: GraduationCap },
58
- ]
59
-
60
42
  export function CortexSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
61
43
  const navigate = useNavigate()
62
44
  const location = useLocation()
63
45
  const { user } = useAuth()
46
+ const appPath = useAppPath()
47
+
48
+ const crmItems = [
49
+ { title: "Dashboard", url: appPath('/dashboard'), icon: LayoutDashboard },
50
+ { title: "Accounts", url: appPath('/crm/accounts'), icon: Building2 },
51
+ { title: "Contacts", url: appPath('/crm/contacts'), icon: Users },
52
+ { title: "Deals", url: appPath('/crm/deals'), icon: Handshake },
53
+ { title: "Health", url: appPath('/crm/health'), icon: Heart },
54
+ { title: "Activity", url: appPath('/crm/activity'), icon: Activity },
55
+ ]
56
+
57
+ const opsItems = [
58
+ { title: "Operations Dashboard", url: appPath('/operations'), icon: BarChart3 },
59
+ { title: "Audit Funnel", url: appPath('/operations/audit-funnel'), icon: Search },
60
+ { title: "Install Funnel", url: appPath('/operations/install-funnel'), icon: Download },
61
+ { title: "Support", url: appPath('/support'), icon: Headphones },
62
+ { title: "Community", url: appPath('/community'), icon: Users },
63
+ { title: "Knowledge Base", url: appPath('/kb'), icon: BookOpen },
64
+ { title: "Courses", url: appPath('/courses'), icon: GraduationCap },
65
+ ]
64
66
 
65
67
  const isActive = (url: string) => location.pathname.startsWith(url)
66
68
 
@@ -69,7 +71,7 @@ export function CortexSidebar({ ...props }: React.ComponentProps<typeof Sidebar>
69
71
  <SidebarHeader>
70
72
  <SidebarMenu>
71
73
  <SidebarMenuItem>
72
- <SidebarMenuButton size="lg" onClick={() => navigate("/cortex/dashboard")}>
74
+ <SidebarMenuButton size="lg" onClick={() => navigate(appPath('/dashboard'))}>
73
75
  <div className="flex aspect-square size-8 items-center justify-center rounded-lg bg-primary text-primary-foreground">
74
76
  <span className="text-sm font-bold">Cx</span>
75
77
  </div>
package/index.tsx CHANGED
@@ -4,6 +4,7 @@ import { LoadingSpinner } from '@core/components/ui/LoadingSpinner'
4
4
  import { AppShell } from '@core/components/layout/AppShell'
5
5
  import { CortexSidebar } from './components/CortexSidebar'
6
6
  import { TooltipProvider } from '@core/components/ui/tooltip'
7
+ import { useAppPath } from '@core/hooks/useAppPath'
7
8
 
8
9
  const CortexDashboard = lazy(() => import('./pages/CortexDashboard'))
9
10
 
@@ -44,8 +45,9 @@ const Fallback = <div className="min-h-[400px] flex items-center justify-center"
44
45
 
45
46
  function CortexLayout() {
46
47
  const location = useLocation()
48
+ const appPath = useAppPath()
47
49
  const segments = location.pathname.split('/').filter(Boolean)
48
- const breadcrumbs: { title: string; url?: string }[] = [{ title: 'Cortex', url: '/cortex/dashboard' }]
50
+ const breadcrumbs: { title: string; url?: string }[] = [{ title: 'Cortex', url: appPath('/dashboard') }]
49
51
  if (segments[1] && segments[1] !== 'dashboard') {
50
52
  breadcrumbs.push({ title: segments[1].charAt(0).toUpperCase() + segments[1].slice(1) })
51
53
  }
package/manifest.json CHANGED
@@ -2,83 +2,84 @@
2
2
  "name": "Cortex",
3
3
  "slug": "cortex",
4
4
  "description": "Unified workspace for CRM, Support, Community, and Knowledge Base",
5
- "version": "0.2.10",
5
+ "version": "0.2.11",
6
6
  "app_type": "full",
7
+ "route_prefix": "/cortex",
7
8
  "required_roles": ["support"],
8
9
  "routes": [
9
- "/cortex",
10
- "/cortex/dashboard",
11
- "/cortex/crm",
12
- "/cortex/crm/accounts",
13
- "/cortex/crm/accounts/:id",
14
- "/cortex/crm/contacts",
15
- "/cortex/crm/deals",
16
- "/cortex/crm/deals/:id",
17
- "/cortex/crm/health",
18
- "/cortex/crm/activity",
19
- "/cortex/support",
20
- "/cortex/support/:id",
21
- "/cortex/community",
22
- "/cortex/kb",
23
- "/cortex/kb/editor",
24
- "/cortex/kb/ingestion",
25
- "/cortex/courses",
26
- "/cortex/intelligence",
27
- "/cortex/team"
10
+ "/",
11
+ "/dashboard",
12
+ "/crm",
13
+ "/crm/accounts",
14
+ "/crm/accounts/:id",
15
+ "/crm/contacts",
16
+ "/crm/deals",
17
+ "/crm/deals/:id",
18
+ "/crm/health",
19
+ "/crm/activity",
20
+ "/support",
21
+ "/support/:id",
22
+ "/community",
23
+ "/kb",
24
+ "/kb/editor",
25
+ "/kb/ingestion",
26
+ "/courses",
27
+ "/intelligence",
28
+ "/team"
28
29
  ],
29
30
  "nav_items": [
30
31
  {
31
32
  "title": "Dashboard",
32
- "path": "/cortex/dashboard",
33
+ "path": "/dashboard",
33
34
  "icon": "LayoutDashboard",
34
35
  "order": 1
35
36
  },
36
37
  {
37
38
  "title": "CRM",
38
- "path": "/cortex/crm",
39
+ "path": "/crm",
39
40
  "icon": "Users",
40
41
  "order": 2,
41
42
  "children": [
42
- { "title": "Accounts", "path": "/cortex/crm/accounts" },
43
- { "title": "Contacts", "path": "/cortex/crm/contacts" },
44
- { "title": "Deals", "path": "/cortex/crm/deals" },
45
- { "title": "Health", "path": "/cortex/crm/health" },
46
- { "title": "Activity", "path": "/cortex/crm/activity" }
43
+ { "title": "Accounts", "path": "/crm/accounts" },
44
+ { "title": "Contacts", "path": "/crm/contacts" },
45
+ { "title": "Deals", "path": "/crm/deals" },
46
+ { "title": "Health", "path": "/crm/health" },
47
+ { "title": "Activity", "path": "/crm/activity" }
47
48
  ]
48
49
  },
49
50
  {
50
51
  "title": "Support",
51
- "path": "/cortex/support",
52
+ "path": "/support",
52
53
  "icon": "Headphones",
53
54
  "order": 3
54
55
  },
55
56
  {
56
57
  "title": "Community",
57
- "path": "/cortex/community",
58
+ "path": "/community",
58
59
  "icon": "Users",
59
60
  "order": 4
60
61
  },
61
62
  {
62
63
  "title": "Knowledge Base",
63
- "path": "/cortex/kb",
64
+ "path": "/kb",
64
65
  "icon": "BookOpen",
65
66
  "order": 5
66
67
  },
67
68
  {
68
69
  "title": "Courses",
69
- "path": "/cortex/courses",
70
+ "path": "/courses",
70
71
  "icon": "GraduationCap",
71
72
  "order": 6
72
73
  },
73
74
  {
74
75
  "title": "Intelligence",
75
- "path": "/cortex/intelligence",
76
+ "path": "/intelligence",
76
77
  "icon": "Brain",
77
78
  "order": 7
78
79
  },
79
80
  {
80
81
  "title": "Team",
81
- "path": "/cortex/team",
82
+ "path": "/team",
82
83
  "icon": "UserPlus",
83
84
  "order": 8
84
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spine-framework-cortex",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "private": false,
5
5
  "description": "Cortex — AI-powered support, CRM, and knowledge base app for Spine Framework",
6
6
  "keywords": ["spine-framework", "crm", "support", "knowledge-base", "community"],