@skyhook-io/radar-app 1.6.0 → 1.6.2
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 +3 -2
- package/src/App.tsx +19 -22
- package/src/api/client.ts +29 -16
- package/src/components/gitops/GitOpsView.tsx +13 -6
- package/src/components/helm/ChartBrowser.tsx +1 -1
- package/src/components/helm/RoleGatedPanel.tsx +1 -1
- package/src/components/home/ClusterHealthCard.tsx +12 -10
- package/src/components/home/HomeView.tsx +204 -56
- package/src/components/resources/ResourceDetailDrawer.tsx +3 -0
- package/src/components/resources/ResourcesView.tsx +46 -8
- package/src/components/timeline/TimelineList.tsx +6 -1
- package/src/components/timeline/TimelineView.tsx +9 -0
- package/src/components/ui/Omnibar.tsx +225 -115
- package/src/components/ui/RadarOmnibar.tsx +52 -0
- package/src/index.ts +15 -0
- package/src/main.tsx +6 -1
- package/src/monaco-setup.ts +17 -10
package/src/index.ts
CHANGED
|
@@ -31,3 +31,18 @@ export type { ClusterSwitcherProps, ClusterSwitcherItem } from '@skyhook-io/k8s-
|
|
|
31
31
|
// cluster prefix (e.g. /c/:id).
|
|
32
32
|
export { resourcePath, buildWorkloadPath } from './utils/navigation';
|
|
33
33
|
export type { SelectedResource } from '@skyhook-io/k8s-ui/types/core';
|
|
34
|
+
|
|
35
|
+
// Injectable omnibar — the standalone search/command surface, decoupled from
|
|
36
|
+
// Radar's own data hooks so embedders (Radar Hub) can drive it with fleet
|
|
37
|
+
// search + their own command items while sharing the exact UX (pills, modifier
|
|
38
|
+
// autocomplete, kind-first ranking, match highlighting, keyboard nav, recents).
|
|
39
|
+
export { Omnibar } from './components/ui/Omnibar';
|
|
40
|
+
export type {
|
|
41
|
+
OmnibarProps,
|
|
42
|
+
OmnibarHandle,
|
|
43
|
+
OmnibarRecent,
|
|
44
|
+
OmnibarSearchResult,
|
|
45
|
+
} from './components/ui/Omnibar';
|
|
46
|
+
export { bestScore } from './components/ui/command-items';
|
|
47
|
+
export type { CommandItem } from './components/ui/command-items';
|
|
48
|
+
export type { SearchHit, SearchMatchedField } from './api/client';
|
package/src/main.tsx
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import ReactDOM from 'react-dom/client'
|
|
3
|
-
import './monaco-setup'
|
|
3
|
+
import { configureBundledMonaco } from './monaco-setup'
|
|
4
4
|
import { RadarApp } from './RadarApp'
|
|
5
5
|
import { openExternal } from './utils/navigation'
|
|
6
6
|
import './index.css'
|
|
7
7
|
|
|
8
|
+
// Keep this as an explicit call: side-effect-only imports of the Monaco setup can
|
|
9
|
+
// be dropped by production tree-shaking, which makes offline desktop builds fall
|
|
10
|
+
// back to Monaco's CDN loader.
|
|
11
|
+
configureBundledMonaco()
|
|
12
|
+
|
|
8
13
|
// Intercept external link clicks in the Wails desktop app.
|
|
9
14
|
// <a target="_blank"> is swallowed by WKWebView/WebView2 — route through openExternal()
|
|
10
15
|
// which calls the backend /api/desktop/open-url endpoint to open in the system browser.
|
package/src/monaco-setup.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// over the network, so the YAML editor never loads in airgapped / offline
|
|
4
4
|
// deployments. Bundling makes the binary fully self-contained.
|
|
5
5
|
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
6
|
+
// Called from main.tsx (Radar's binary entry) only — library consumers
|
|
7
|
+
// (e.g. Radar Hub) keep the default CDN loader unless they opt in.
|
|
8
8
|
//
|
|
9
9
|
// Import the editor API + YAML grammar directly rather than the `monaco-editor`
|
|
10
10
|
// barrel: the barrel pulls in the JSON/CSS/HTML/TypeScript language services,
|
|
@@ -15,12 +15,19 @@ import 'monaco-editor/esm/vs/basic-languages/yaml/yaml.contribution'
|
|
|
15
15
|
import { loader } from '@monaco-editor/react'
|
|
16
16
|
import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
}
|
|
18
|
+
let configured = false
|
|
19
|
+
|
|
20
|
+
export function configureBundledMonaco() {
|
|
21
|
+
if (configured) return
|
|
22
|
+
configured = true
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
// YAML has no dedicated Monaco language worker — the base editor worker covers
|
|
25
|
+
// everything we use, so route every label to it.
|
|
26
|
+
;(globalThis as typeof globalThis & { MonacoEnvironment?: { getWorker(): Worker } }).MonacoEnvironment = {
|
|
27
|
+
getWorker() {
|
|
28
|
+
return new EditorWorker()
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
loader.config({ monaco })
|
|
33
|
+
}
|