elowen-plugin-ui-kit 0.2.0 → 0.5.0
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/index.d.ts +52 -3
- package/index.js +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -10,7 +10,36 @@ import type { ComponentType } from 'react';
|
|
|
10
10
|
/** See index.js — bump on incompatible changes to `ElowenUiRuntime`. Deliberately a LITERAL type:
|
|
11
11
|
* the web app re-declares the value and annotates it with `typeof PLUGIN_UI_API_VERSION`, so a kit
|
|
12
12
|
* bump that forgets the host fails the web typecheck instead of drifting silently. */
|
|
13
|
-
export declare const PLUGIN_UI_API_VERSION:
|
|
13
|
+
export declare const PLUGIN_UI_API_VERSION: 6;
|
|
14
|
+
|
|
15
|
+
/** Project metadata exposed to a contextual plugin panel. The Project remains core-owned; a panel uses
|
|
16
|
+
* this identity to address only its own project-scoped API data. */
|
|
17
|
+
export interface PluginUiProject {
|
|
18
|
+
id: number;
|
|
19
|
+
slug: string;
|
|
20
|
+
path: string;
|
|
21
|
+
notes: string;
|
|
22
|
+
icon?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** The selected core User DTO exposed only to administrator user-detail panels. Compatibility fields stay
|
|
26
|
+
* present because plugins receive the same object as the host Users screen, not a second partial identity. */
|
|
27
|
+
export interface PluginUiUser {
|
|
28
|
+
id: number;
|
|
29
|
+
username: string;
|
|
30
|
+
created_at: string;
|
|
31
|
+
is_admin: boolean;
|
|
32
|
+
allowed_execs: string[];
|
|
33
|
+
disabled_tools: string[];
|
|
34
|
+
allowed_tools: string[];
|
|
35
|
+
granted_plugins: string[];
|
|
36
|
+
name: string;
|
|
37
|
+
email: string;
|
|
38
|
+
avatar: string;
|
|
39
|
+
default_exec: string;
|
|
40
|
+
advisor_exec: string;
|
|
41
|
+
advisor_autostart: boolean;
|
|
42
|
+
}
|
|
14
43
|
|
|
15
44
|
/** Props every plugin page/settings component receives. */
|
|
16
45
|
export interface PluginPageProps {
|
|
@@ -33,12 +62,32 @@ export interface PluginPageProps {
|
|
|
33
62
|
onSaveState?: (status: 'idle' | 'saving' | 'saved' | 'error', retry?: () => void) => void;
|
|
34
63
|
}
|
|
35
64
|
|
|
65
|
+
/** Props for a contextual Project panel. It is never a standalone route: the selected Project and panel
|
|
66
|
+
* id come from the host's Project detail rail. */
|
|
67
|
+
export interface PluginProjectPanelProps {
|
|
68
|
+
plugin: string;
|
|
69
|
+
panelId: string;
|
|
70
|
+
project: PluginUiProject;
|
|
71
|
+
surface: 'project';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Props for an administrator panel mounted for one selected core User. */
|
|
75
|
+
export interface PluginUserPanelProps {
|
|
76
|
+
plugin: string;
|
|
77
|
+
panelId: string;
|
|
78
|
+
user: PluginUiUser;
|
|
79
|
+
surface: 'user';
|
|
80
|
+
}
|
|
81
|
+
|
|
36
82
|
/** What a bundle hands to window.__elowenRegisterPluginUi. Routes are `/`-joined segment patterns
|
|
37
|
-
* (`''` = the root page, `detail/:id` captures params).
|
|
38
|
-
* manifest
|
|
83
|
+
* (`''` = the root page, `detail/:id` captures params). Contextual component maps are keyed by their
|
|
84
|
+
* matching manifest panel ids and mount only in the corresponding host surface. */
|
|
39
85
|
export interface PluginUiRegistration {
|
|
40
86
|
requiresApiVersion: number;
|
|
41
87
|
pages?: Record<string, ComponentType<PluginPageProps>>;
|
|
88
|
+
account?: Record<string, ComponentType<PluginPageProps>>;
|
|
89
|
+
user?: Record<string, ComponentType<PluginUserPanelProps>>;
|
|
90
|
+
project?: Record<string, ComponentType<PluginProjectPanelProps>>;
|
|
42
91
|
settings?: Record<string, ComponentType<PluginPageProps>>;
|
|
43
92
|
}
|
|
44
93
|
|
package/index.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* `window.ElowenUiRuntime` stamped with this number; a bundle whose `requiresApiVersion` is NEWER
|
|
3
3
|
* renders a placeholder instead of executing against a contract it was not built for. Bump on
|
|
4
4
|
* incompatible changes to the `ElowenUiRuntime` surface (see index.d.ts). */
|
|
5
|
-
export const PLUGIN_UI_API_VERSION =
|
|
5
|
+
export const PLUGIN_UI_API_VERSION = 5;
|