@taruvi/navkit 0.0.26 → 0.0.27
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/.kiro/settings/lsp.json +198 -0
- package/package.json +2 -2
- package/src/App.tsx +7 -7
- package/src/NavkitContext.tsx +2 -2
- package/src/components/AppLauncher/AppLauncher.tsx +2 -8
- package/src/components/Profile/Profile.styles.ts +3 -3
- package/src/components/Profile/ProfileMenu.tsx +2 -5
- package/src/types.ts +3 -4
- package/tsconfig.app.json +5 -4
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
{
|
|
2
|
+
"languages": {
|
|
3
|
+
"cpp": {
|
|
4
|
+
"name": "clangd",
|
|
5
|
+
"command": "clangd",
|
|
6
|
+
"args": [
|
|
7
|
+
"--background-index"
|
|
8
|
+
],
|
|
9
|
+
"file_extensions": [
|
|
10
|
+
"cpp",
|
|
11
|
+
"cc",
|
|
12
|
+
"cxx",
|
|
13
|
+
"c",
|
|
14
|
+
"h",
|
|
15
|
+
"hpp",
|
|
16
|
+
"hxx"
|
|
17
|
+
],
|
|
18
|
+
"project_patterns": [
|
|
19
|
+
"CMakeLists.txt",
|
|
20
|
+
"compile_commands.json",
|
|
21
|
+
"Makefile"
|
|
22
|
+
],
|
|
23
|
+
"exclude_patterns": [
|
|
24
|
+
"**/build/**",
|
|
25
|
+
"**/cmake-build-**/**"
|
|
26
|
+
],
|
|
27
|
+
"multi_workspace": false,
|
|
28
|
+
"initialization_options": {},
|
|
29
|
+
"request_timeout_secs": 60
|
|
30
|
+
},
|
|
31
|
+
"ruby": {
|
|
32
|
+
"name": "solargraph",
|
|
33
|
+
"command": "solargraph",
|
|
34
|
+
"args": [
|
|
35
|
+
"stdio"
|
|
36
|
+
],
|
|
37
|
+
"file_extensions": [
|
|
38
|
+
"rb"
|
|
39
|
+
],
|
|
40
|
+
"project_patterns": [
|
|
41
|
+
"Gemfile",
|
|
42
|
+
"Rakefile"
|
|
43
|
+
],
|
|
44
|
+
"exclude_patterns": [
|
|
45
|
+
"**/vendor/**",
|
|
46
|
+
"**/tmp/**"
|
|
47
|
+
],
|
|
48
|
+
"multi_workspace": false,
|
|
49
|
+
"initialization_options": {},
|
|
50
|
+
"request_timeout_secs": 60
|
|
51
|
+
},
|
|
52
|
+
"typescript": {
|
|
53
|
+
"name": "typescript-language-server",
|
|
54
|
+
"command": "typescript-language-server",
|
|
55
|
+
"args": [
|
|
56
|
+
"--stdio"
|
|
57
|
+
],
|
|
58
|
+
"file_extensions": [
|
|
59
|
+
"ts",
|
|
60
|
+
"js",
|
|
61
|
+
"tsx",
|
|
62
|
+
"jsx"
|
|
63
|
+
],
|
|
64
|
+
"project_patterns": [
|
|
65
|
+
"package.json",
|
|
66
|
+
"tsconfig.json"
|
|
67
|
+
],
|
|
68
|
+
"exclude_patterns": [
|
|
69
|
+
"**/node_modules/**",
|
|
70
|
+
"**/dist/**"
|
|
71
|
+
],
|
|
72
|
+
"multi_workspace": false,
|
|
73
|
+
"initialization_options": {
|
|
74
|
+
"preferences": {
|
|
75
|
+
"disableSuggestions": false
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"request_timeout_secs": 60
|
|
79
|
+
},
|
|
80
|
+
"python": {
|
|
81
|
+
"name": "pyright",
|
|
82
|
+
"command": "pyright-langserver",
|
|
83
|
+
"args": [
|
|
84
|
+
"--stdio"
|
|
85
|
+
],
|
|
86
|
+
"file_extensions": [
|
|
87
|
+
"py"
|
|
88
|
+
],
|
|
89
|
+
"project_patterns": [
|
|
90
|
+
"pyproject.toml",
|
|
91
|
+
"setup.py",
|
|
92
|
+
"requirements.txt",
|
|
93
|
+
"pyrightconfig.json"
|
|
94
|
+
],
|
|
95
|
+
"exclude_patterns": [
|
|
96
|
+
"**/__pycache__/**",
|
|
97
|
+
"**/venv/**",
|
|
98
|
+
"**/.venv/**",
|
|
99
|
+
"**/.pytest_cache/**"
|
|
100
|
+
],
|
|
101
|
+
"multi_workspace": false,
|
|
102
|
+
"initialization_options": {},
|
|
103
|
+
"request_timeout_secs": 60
|
|
104
|
+
},
|
|
105
|
+
"rust": {
|
|
106
|
+
"name": "rust-analyzer",
|
|
107
|
+
"command": "rust-analyzer",
|
|
108
|
+
"args": [],
|
|
109
|
+
"file_extensions": [
|
|
110
|
+
"rs"
|
|
111
|
+
],
|
|
112
|
+
"project_patterns": [
|
|
113
|
+
"Cargo.toml"
|
|
114
|
+
],
|
|
115
|
+
"exclude_patterns": [
|
|
116
|
+
"**/target/**"
|
|
117
|
+
],
|
|
118
|
+
"multi_workspace": false,
|
|
119
|
+
"initialization_options": {
|
|
120
|
+
"cargo": {
|
|
121
|
+
"buildScripts": {
|
|
122
|
+
"enable": true
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"diagnostics": {
|
|
126
|
+
"enable": true,
|
|
127
|
+
"enableExperimental": true
|
|
128
|
+
},
|
|
129
|
+
"workspace": {
|
|
130
|
+
"symbol": {
|
|
131
|
+
"search": {
|
|
132
|
+
"scope": "workspace"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"request_timeout_secs": 60
|
|
138
|
+
},
|
|
139
|
+
"go": {
|
|
140
|
+
"name": "gopls",
|
|
141
|
+
"command": "gopls",
|
|
142
|
+
"args": [],
|
|
143
|
+
"file_extensions": [
|
|
144
|
+
"go"
|
|
145
|
+
],
|
|
146
|
+
"project_patterns": [
|
|
147
|
+
"go.mod",
|
|
148
|
+
"go.sum"
|
|
149
|
+
],
|
|
150
|
+
"exclude_patterns": [
|
|
151
|
+
"**/vendor/**"
|
|
152
|
+
],
|
|
153
|
+
"multi_workspace": false,
|
|
154
|
+
"initialization_options": {
|
|
155
|
+
"usePlaceholders": true,
|
|
156
|
+
"completeUnimported": true
|
|
157
|
+
},
|
|
158
|
+
"request_timeout_secs": 60
|
|
159
|
+
},
|
|
160
|
+
"java": {
|
|
161
|
+
"name": "jdtls",
|
|
162
|
+
"command": "jdtls",
|
|
163
|
+
"args": [],
|
|
164
|
+
"file_extensions": [
|
|
165
|
+
"java"
|
|
166
|
+
],
|
|
167
|
+
"project_patterns": [
|
|
168
|
+
"pom.xml",
|
|
169
|
+
"build.gradle",
|
|
170
|
+
"build.gradle.kts",
|
|
171
|
+
".project"
|
|
172
|
+
],
|
|
173
|
+
"exclude_patterns": [
|
|
174
|
+
"**/target/**",
|
|
175
|
+
"**/build/**",
|
|
176
|
+
"**/.gradle/**"
|
|
177
|
+
],
|
|
178
|
+
"multi_workspace": false,
|
|
179
|
+
"initialization_options": {
|
|
180
|
+
"settings": {
|
|
181
|
+
"java": {
|
|
182
|
+
"compile": {
|
|
183
|
+
"nullAnalysis": {
|
|
184
|
+
"mode": "automatic"
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"configuration": {
|
|
188
|
+
"annotationProcessing": {
|
|
189
|
+
"enabled": true
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"request_timeout_secs": 60
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taruvi/navkit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.27",
|
|
4
4
|
"main": "src/App.tsx",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -46,6 +46,6 @@
|
|
|
46
46
|
"vite": "^7.1.7"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@taruvi/sdk": "^1.
|
|
49
|
+
"@taruvi/sdk": "^1.3.4-beta.0"
|
|
50
50
|
}
|
|
51
51
|
}
|
package/src/App.tsx
CHANGED
|
@@ -37,30 +37,31 @@ const NavkitContent = () => {
|
|
|
37
37
|
{appSettings?.icon ? <Box component="img" src={appSettings?.icon} sx={styles.logo} /> : <></>}
|
|
38
38
|
{appSettings?.displayName &&
|
|
39
39
|
<Typography sx={styles.appName}>
|
|
40
|
-
{appSettings.displayName.length >
|
|
40
|
+
{appSettings.displayName.length > 15 ? `${appSettings.displayName.substring(0, 15)}...` : appSettings.displayName}
|
|
41
41
|
</Typography>
|
|
42
42
|
}
|
|
43
43
|
</Box>
|
|
44
44
|
<Box component={"div"} sx={styles.rightSection}>
|
|
45
45
|
<Shortcuts showChat={setShowChat} onMenuToggle={() => setShowShortcutsMenu(!showShortcutsMenu)} />
|
|
46
|
+
{isUserAuthenticated && userData && <Profile userData={userData} onClick={() => setShowProfileMenu(!showProfileMenu)} />}
|
|
46
47
|
<Box
|
|
47
48
|
onClick={() => {
|
|
48
|
-
if (isUserAuthenticated) {
|
|
49
|
+
if (isUserAuthenticated && appsList.length > 0) {
|
|
49
50
|
setShowAppLauncher(!showAppLauncher);
|
|
50
51
|
}
|
|
51
52
|
}}
|
|
52
53
|
onMouseEnter={() => {
|
|
53
|
-
if (isUserAuthenticated) {
|
|
54
|
+
if (isUserAuthenticated && appsList.length > 0) {
|
|
54
55
|
setIsAppLauncherHovered(true);
|
|
55
56
|
}
|
|
56
57
|
}}
|
|
57
58
|
onMouseLeave={() => setIsAppLauncherHovered(false)}
|
|
58
59
|
sx={{
|
|
59
60
|
...styles.appLauncherContainer,
|
|
60
|
-
cursor: isUserAuthenticated ? "pointer" : "default",
|
|
61
|
+
cursor: isUserAuthenticated && appsList.length > 0 ? "pointer" : "default",
|
|
61
62
|
}}
|
|
62
63
|
>
|
|
63
|
-
{(isAppLauncherHovered || showAppLauncher) && isUserAuthenticated ? (
|
|
64
|
+
{(isAppLauncherHovered || showAppLauncher) && isUserAuthenticated && appsList.length > 0 ? (
|
|
64
65
|
<Box sx={styles.appLauncherHover}>
|
|
65
66
|
<FontAwesomeIcon icon={["fas", "th"]} style={styles.appLauncherIcon} />
|
|
66
67
|
<Typography sx={styles.appLauncherText}>Apps</Typography>
|
|
@@ -69,12 +70,11 @@ const NavkitContent = () => {
|
|
|
69
70
|
<Box component="img" src={taruviLogo} sx={styles.appLauncherLogo} />
|
|
70
71
|
)}
|
|
71
72
|
</Box>
|
|
72
|
-
{isUserAuthenticated && userData && <Profile userData={userData} onClick={() => setShowProfileMenu(!showProfileMenu)} />}
|
|
73
73
|
</Box>
|
|
74
74
|
</Toolbar>
|
|
75
75
|
</AppBar>
|
|
76
76
|
|
|
77
|
-
{showAppLauncher && isUserAuthenticated && (
|
|
77
|
+
{showAppLauncher && isUserAuthenticated && appsList.length > 0 && (
|
|
78
78
|
<Box>
|
|
79
79
|
<AppLauncher />
|
|
80
80
|
</Box>
|
package/src/NavkitContext.tsx
CHANGED
|
@@ -97,9 +97,9 @@ export const NavkitProvider = ({ children, client, onThemeChange }: NavkitProvid
|
|
|
97
97
|
// App settings not available, continue without app settings
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
siteSettings.current = fetchedSettings
|
|
100
|
+
siteSettings.current = fetchedSettings?.data ?? fetchedSettings
|
|
101
101
|
if (isUserAuthenticated) {
|
|
102
|
-
const userDataResponse = await
|
|
102
|
+
const userDataResponse = await auth.getCurrentUser()
|
|
103
103
|
setUserData(userDataResponse?.data || null)
|
|
104
104
|
|
|
105
105
|
// Fetch user apps using username from userData
|
|
@@ -3,7 +3,7 @@ import type { AppData } from "../../types"
|
|
|
3
3
|
import Search from "../Search/Search"
|
|
4
4
|
import { Card, Box, Grid, Typography } from "@mui/material"
|
|
5
5
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
|
6
|
-
import { findIconDefinition,
|
|
6
|
+
import { findIconDefinition, type IconName } from "@fortawesome/fontawesome-svg-core"
|
|
7
7
|
import { useNavigation } from "../../NavkitContext"
|
|
8
8
|
import { getAppLauncherStyles } from "./AppLauncher.styles"
|
|
9
9
|
|
|
@@ -37,7 +37,7 @@ const AppLauncher = () => {
|
|
|
37
37
|
return (
|
|
38
38
|
<Card sx={styles.container}>
|
|
39
39
|
<Search appsList={appsList} onSearchChange={handleSearchChange} />
|
|
40
|
-
{filteredApps && filteredApps.length > 0
|
|
40
|
+
{filteredApps && filteredApps.length > 0 && (
|
|
41
41
|
<Box sx={styles.scrollContainer}>
|
|
42
42
|
<Grid container spacing={0}>
|
|
43
43
|
{filteredApps.map((app) => {
|
|
@@ -83,12 +83,6 @@ const AppLauncher = () => {
|
|
|
83
83
|
})}
|
|
84
84
|
</Grid>
|
|
85
85
|
</Box>
|
|
86
|
-
) : (
|
|
87
|
-
<Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center', padding: '40px 16px' }}>
|
|
88
|
-
<Typography sx={{ color: styles.appName?.color || '#9e9e9e', fontSize: '0.875rem' }}>
|
|
89
|
-
No apps available
|
|
90
|
-
</Typography>
|
|
91
|
-
</Box>
|
|
92
86
|
)}
|
|
93
87
|
</Card>
|
|
94
88
|
)
|
|
@@ -31,7 +31,7 @@ export const profileStyles = {
|
|
|
31
31
|
position: 'absolute' as const,
|
|
32
32
|
top: 60,
|
|
33
33
|
right: 0,
|
|
34
|
-
width:
|
|
34
|
+
width: 200,
|
|
35
35
|
borderRadius: borderRadius.default,
|
|
36
36
|
boxShadow: shadows.dropdown,
|
|
37
37
|
backgroundColor: colours.bg.white,
|
|
@@ -70,7 +70,7 @@ export const getProfileStyles = (mode: ThemeMode) => {
|
|
|
70
70
|
display: 'flex',
|
|
71
71
|
alignItems: 'center',
|
|
72
72
|
gap: spacing.sm,
|
|
73
|
-
|
|
73
|
+
ml: spacing.md,
|
|
74
74
|
cursor: 'pointer',
|
|
75
75
|
},
|
|
76
76
|
avatar: {
|
|
@@ -92,7 +92,7 @@ export const getProfileStyles = (mode: ThemeMode) => {
|
|
|
92
92
|
position: 'absolute' as const,
|
|
93
93
|
top: 60,
|
|
94
94
|
right: 0,
|
|
95
|
-
width:
|
|
95
|
+
width: 200,
|
|
96
96
|
borderRadius: borderRadius.default,
|
|
97
97
|
boxShadow: themeShadows.dropdown,
|
|
98
98
|
backgroundColor: colors.bg.white,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Box, Card, Divider, MenuItem, Typography } from '@mui/material'
|
|
2
2
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
3
3
|
import DarkModeOutlined from '@mui/icons-material/DarkModeOutlined'
|
|
4
4
|
import LightModeOutlined from '@mui/icons-material/LightModeOutlined'
|
|
@@ -19,10 +19,7 @@ const ProfileMenu = () => {
|
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
21
|
<Card sx={styles.menu}>
|
|
22
|
-
<Box sx={{ px: 2, py: 1.5
|
|
23
|
-
{userData?.icon_url && (
|
|
24
|
-
<Avatar src={userData.icon_url} sx={{ width: 32, height: 32, maxWidth: 32, borderRadius: '50%' }} />
|
|
25
|
-
)}
|
|
22
|
+
<Box sx={{ px: 2, py: 1.5 }}>
|
|
26
23
|
<Typography sx={{ fontWeight: 600, color: styles.menuItemText.color }}>
|
|
27
24
|
{userData?.full_name}
|
|
28
25
|
</Typography>
|
package/src/types.ts
CHANGED
|
@@ -25,17 +25,16 @@ export interface UserData {
|
|
|
25
25
|
last_name?: string
|
|
26
26
|
full_name?: string
|
|
27
27
|
pfp?: string
|
|
28
|
-
icon_url?: string
|
|
29
28
|
is_active?: boolean
|
|
30
29
|
is_staff?: boolean
|
|
31
30
|
is_superuser?: boolean
|
|
32
31
|
is_deleted?: boolean
|
|
33
32
|
date_joined?: string
|
|
34
33
|
last_login?: string
|
|
35
|
-
groups?: string[]
|
|
36
|
-
user_permissions?: string[]
|
|
34
|
+
groups?: { id: number; name: string }[]
|
|
35
|
+
user_permissions?: { id: number; name: string; codename: string; content_type: string }[]
|
|
37
36
|
attributes?: Record<string, unknown>
|
|
38
|
-
missing_attributes?:
|
|
37
|
+
missing_attributes?: string[]
|
|
39
38
|
roles?: UserRole[]
|
|
40
39
|
}
|
|
41
40
|
|
package/tsconfig.app.json
CHANGED
|
@@ -18,11 +18,12 @@
|
|
|
18
18
|
|
|
19
19
|
/* Linting */
|
|
20
20
|
"strict": true,
|
|
21
|
-
"noUnusedLocals":
|
|
22
|
-
"noUnusedParameters":
|
|
23
|
-
"erasableSyntaxOnly":
|
|
21
|
+
"noUnusedLocals": false,
|
|
22
|
+
"noUnusedParameters": false,
|
|
23
|
+
"erasableSyntaxOnly": false,
|
|
24
24
|
"noFallthroughCasesInSwitch": true,
|
|
25
25
|
"noUncheckedSideEffectImports": true
|
|
26
26
|
},
|
|
27
|
-
"include": ["src"]
|
|
27
|
+
"include": ["src"],
|
|
28
|
+
"exclude": ["node_modules"]
|
|
28
29
|
}
|