@stigmer/react 3.0.5 → 3.0.6
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/agent/AgentDetailView.d.ts.map +1 -1
- package/agent/AgentDetailView.js +1 -1
- package/agent/AgentDetailView.js.map +1 -1
- package/agent-instance/AgentInstanceDetailPanel.d.ts.map +1 -1
- package/agent-instance/AgentInstanceDetailPanel.js +2 -6
- package/agent-instance/AgentInstanceDetailPanel.js.map +1 -1
- package/agent-instance/AgentInstanceList.d.ts.map +1 -1
- package/agent-instance/AgentInstanceList.js +2 -6
- package/agent-instance/AgentInstanceList.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.d.ts.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/library/InstanceVisibilitySelector.d.ts +8 -15
- package/library/InstanceVisibilitySelector.d.ts.map +1 -1
- package/library/InstanceVisibilitySelector.js +11 -139
- package/library/InstanceVisibilitySelector.js.map +1 -1
- package/library/ResourceVisibilityControl.d.ts +23 -6
- package/library/ResourceVisibilityControl.d.ts.map +1 -1
- package/library/ResourceVisibilityControl.js +38 -9
- package/library/ResourceVisibilityControl.js.map +1 -1
- package/library/ScopeToggle.d.ts +1 -1
- package/library/ScopeToggle.js +1 -1
- package/library/VisibilitySelector.d.ts +75 -0
- package/library/VisibilitySelector.d.ts.map +1 -0
- package/library/VisibilitySelector.js +171 -0
- package/library/VisibilitySelector.js.map +1 -0
- package/library/index.d.ts +4 -2
- package/library/index.d.ts.map +1 -1
- package/library/index.js +2 -1
- package/library/index.js.map +1 -1
- package/library/useUpdateVisibility.d.ts +5 -4
- package/library/useUpdateVisibility.d.ts.map +1 -1
- package/library/useUpdateVisibility.js +5 -4
- package/library/useUpdateVisibility.js.map +1 -1
- package/library/visibilityLevels.d.ts +74 -0
- package/library/visibilityLevels.d.ts.map +1 -0
- package/library/visibilityLevels.js +91 -0
- package/library/visibilityLevels.js.map +1 -0
- package/mcp-server/McpServerDetailView.d.ts +1 -11
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js +3 -6
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/package.json +4 -4
- package/resource-detail/types.d.ts +1 -1
- package/skill/SkillDetailView.d.ts.map +1 -1
- package/skill/SkillDetailView.js +1 -1
- package/skill/SkillDetailView.js.map +1 -1
- package/src/agent/AgentDetailView.tsx +1 -0
- package/src/agent-instance/AgentInstanceDetailPanel.tsx +2 -7
- package/src/agent-instance/AgentInstanceList.tsx +2 -7
- package/src/index.ts +8 -2
- package/src/library/InstanceVisibilitySelector.tsx +19 -276
- package/src/library/ResourceVisibilityControl.tsx +54 -8
- package/src/library/ScopeToggle.tsx +1 -1
- package/src/library/VisibilitySelector.tsx +393 -0
- package/src/library/index.ts +13 -2
- package/src/library/useUpdateVisibility.ts +5 -4
- package/src/library/visibilityLevels.ts +144 -0
- package/src/mcp-server/McpServerDetailView.tsx +10 -35
- package/src/resource-detail/types.ts +1 -1
- package/src/skill/SkillDetailView.tsx +1 -0
- package/src/workflow/WorkflowDetailView.tsx +1 -0
- package/src/workflow/instance/WorkflowInstanceDetailPanel.tsx +2 -7
- package/src/workflow/instance/WorkflowInstanceList.tsx +2 -7
- package/styles.css +1 -1
- package/workflow/WorkflowDetailView.d.ts.map +1 -1
- package/workflow/WorkflowDetailView.js +1 -1
- package/workflow/WorkflowDetailView.js.map +1 -1
- package/workflow/instance/WorkflowInstanceDetailPanel.d.ts.map +1 -1
- package/workflow/instance/WorkflowInstanceDetailPanel.js +2 -6
- package/workflow/instance/WorkflowInstanceDetailPanel.js.map +1 -1
- package/workflow/instance/WorkflowInstanceList.d.ts.map +1 -1
- package/workflow/instance/WorkflowInstanceList.js +2 -6
- package/workflow/instance/WorkflowInstanceList.js.map +1 -1
- package/library/VisibilityToggle.d.ts +0 -53
- package/library/VisibilityToggle.d.ts.map +0 -1
- package/library/VisibilityToggle.js +0 -100
- package/library/VisibilityToggle.js.map +0 -1
- package/src/library/VisibilityToggle.tsx +0 -280
|
@@ -1,41 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
6
|
-
const OPTIONS = [
|
|
7
|
-
{
|
|
8
|
-
value: ApiResourceVisibility.visibility_private,
|
|
9
|
-
label: "Private",
|
|
10
|
-
description: "Only you can access",
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
value: ApiResourceVisibility.visibility_org,
|
|
14
|
-
label: "Organization",
|
|
15
|
-
description: "All org members can view executions",
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
value: ApiResourceVisibility.visibility_public,
|
|
19
|
-
label: "Public",
|
|
20
|
-
description: "All authenticated users can view",
|
|
21
|
-
},
|
|
22
|
-
];
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { VisibilitySelector } from "./VisibilitySelector";
|
|
4
|
+
import { INSTANCE_VISIBILITY_LEVELS } from "./visibilityLevels";
|
|
23
5
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
6
|
+
* Visibility selector for instances (AgentInstance, WorkflowInstance):
|
|
7
|
+
* {@link VisibilitySelector} preconfigured with the instance level set
|
|
8
|
+
* (Private / Organization / Public — platform is excluded by design to
|
|
9
|
+
* preserve tenant isolation).
|
|
26
10
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* shows an inline confirmation prompt since expanding access is
|
|
31
|
-
* consequential.
|
|
32
|
-
*
|
|
33
|
-
* For workflow instances, ORG visibility has cascading effects:
|
|
34
|
-
* all org members automatically see all executions via FGA
|
|
35
|
-
* inheritance (zero per-execution tuples needed).
|
|
36
|
-
*
|
|
37
|
-
* WAI-ARIA Radio Group with roving tabindex. All visual properties
|
|
38
|
-
* flow through `--stgm-*` design tokens.
|
|
11
|
+
* For workflow instances, ORG visibility has cascading effects: all org
|
|
12
|
+
* members automatically see all executions via FGA inheritance (zero
|
|
13
|
+
* per-execution tuples needed).
|
|
39
14
|
*
|
|
40
15
|
* @example
|
|
41
16
|
* ```tsx
|
|
@@ -52,109 +27,6 @@ const OPTIONS = [
|
|
|
52
27
|
* ```
|
|
53
28
|
*/
|
|
54
29
|
export function InstanceVisibilitySelector({ visibility, onVisibilityChange, isPending = false, disabled = false, className, }) {
|
|
55
|
-
|
|
56
|
-
const optionRefs = useRef([]);
|
|
57
|
-
const effectivelyDisabled = disabled || isPending;
|
|
58
|
-
const isEscalation = useCallback((target) => {
|
|
59
|
-
const order = [
|
|
60
|
-
ApiResourceVisibility.visibility_private,
|
|
61
|
-
ApiResourceVisibility.visibility_org,
|
|
62
|
-
ApiResourceVisibility.visibility_public,
|
|
63
|
-
];
|
|
64
|
-
return order.indexOf(target) > order.indexOf(visibility);
|
|
65
|
-
}, [visibility]);
|
|
66
|
-
const handleSelect = useCallback((value) => {
|
|
67
|
-
if (value === visibility)
|
|
68
|
-
return;
|
|
69
|
-
if (isEscalation(value)) {
|
|
70
|
-
setConfirming(value);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
onVisibilityChange(value);
|
|
74
|
-
}, [visibility, onVisibilityChange, isEscalation]);
|
|
75
|
-
const confirmChange = useCallback(() => {
|
|
76
|
-
if (confirming === null)
|
|
77
|
-
return;
|
|
78
|
-
setConfirming(null);
|
|
79
|
-
onVisibilityChange(confirming);
|
|
80
|
-
}, [confirming, onVisibilityChange]);
|
|
81
|
-
const cancelConfirm = useCallback(() => {
|
|
82
|
-
setConfirming(null);
|
|
83
|
-
}, []);
|
|
84
|
-
const handleKeyDown = useCallback((e, index) => {
|
|
85
|
-
let nextIndex = null;
|
|
86
|
-
if (e.key === "ArrowRight" || e.key === "ArrowDown") {
|
|
87
|
-
e.preventDefault();
|
|
88
|
-
nextIndex = (index + 1) % OPTIONS.length;
|
|
89
|
-
}
|
|
90
|
-
else if (e.key === "ArrowLeft" || e.key === "ArrowUp") {
|
|
91
|
-
e.preventDefault();
|
|
92
|
-
nextIndex = (index - 1 + OPTIONS.length) % OPTIONS.length;
|
|
93
|
-
}
|
|
94
|
-
if (nextIndex !== null) {
|
|
95
|
-
optionRefs.current[nextIndex]?.focus();
|
|
96
|
-
handleSelect(OPTIONS[nextIndex].value);
|
|
97
|
-
}
|
|
98
|
-
}, [handleSelect]);
|
|
99
|
-
const confirmingOption = confirming
|
|
100
|
-
? OPTIONS.find((o) => o.value === confirming)
|
|
101
|
-
: null;
|
|
102
|
-
return (_jsxs("div", { className: cn("inline-flex flex-col gap-1.5", className), children: [_jsx("div", { role: "radiogroup", "aria-label": "Instance visibility", "aria-disabled": effectivelyDisabled || undefined, className: cn("inline-flex rounded-md bg-muted p-0.5", effectivelyDisabled && "pointer-events-none opacity-50"), children: OPTIONS.map((option, index) => {
|
|
103
|
-
const isSelected = visibility === option.value;
|
|
104
|
-
return (_jsxs("button", { ref: (el) => {
|
|
105
|
-
optionRefs.current[index] = el;
|
|
106
|
-
}, type: "button", role: "radio", "aria-checked": isSelected, "aria-label": `${option.label}: ${option.description}`, tabIndex: isSelected ? 0 : -1, disabled: effectivelyDisabled, onClick: () => handleSelect(option.value), onKeyDown: (e) => handleKeyDown(e, index), className: cn("inline-flex cursor-pointer items-center gap-1 rounded-sm px-2.5 py-1 text-xs font-medium transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", isSelected
|
|
107
|
-
? getSelectedStyle(option.value)
|
|
108
|
-
: "text-muted-foreground hover:text-foreground"), children: [isPending && isSelected ? (_jsx("span", { className: "inline-block size-3 animate-spin rounded-full border-2 border-current border-t-transparent", "aria-hidden": "true" })) : (getIcon(option.value)), option.label] }, option.value));
|
|
109
|
-
}) }), !confirming && (_jsx("p", { className: "text-[0.65rem] text-muted-foreground", children: OPTIONS.find((o) => o.value === visibility)?.description })), confirming !== null && confirmingOption && (_jsxs("div", { className: cn("flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs", confirming === ApiResourceVisibility.visibility_public
|
|
110
|
-
? "border-amber-200 bg-amber-50 dark:border-amber-800/50 dark:bg-amber-950/30"
|
|
111
|
-
: "border-blue-200 bg-blue-50 dark:border-blue-800/50 dark:bg-blue-950/30"), role: "alert", children: [_jsx("span", { className: cn(confirming === ApiResourceVisibility.visibility_public
|
|
112
|
-
? "text-amber-800 dark:text-amber-200"
|
|
113
|
-
: "text-blue-800 dark:text-blue-200"), children: confirming === ApiResourceVisibility.visibility_public
|
|
114
|
-
? "Make visible to all authenticated users?"
|
|
115
|
-
: "Make visible to all org members?" }), _jsx("button", { type: "button", onClick: confirmChange, className: cn("rounded px-2 py-0.5 text-xs font-medium text-white", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", confirming === ApiResourceVisibility.visibility_public
|
|
116
|
-
? "bg-amber-600 hover:bg-amber-700 dark:bg-amber-600 dark:hover:bg-amber-500"
|
|
117
|
-
: "bg-blue-600 hover:bg-blue-700 dark:bg-blue-600 dark:hover:bg-blue-500"), children: "Confirm" }), _jsx("button", { type: "button", onClick: cancelConfirm, className: cn("rounded px-2 py-0.5 text-xs font-medium", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", confirming === ApiResourceVisibility.visibility_public
|
|
118
|
-
? "text-amber-700 hover:text-amber-900 dark:text-amber-300 dark:hover:text-amber-100"
|
|
119
|
-
: "text-blue-700 hover:text-blue-900 dark:text-blue-300 dark:hover:text-blue-100"), children: "Cancel" })] }))] }));
|
|
120
|
-
}
|
|
121
|
-
// ---------------------------------------------------------------------------
|
|
122
|
-
// Helpers
|
|
123
|
-
// ---------------------------------------------------------------------------
|
|
124
|
-
function getSelectedStyle(value) {
|
|
125
|
-
switch (value) {
|
|
126
|
-
case ApiResourceVisibility.visibility_private:
|
|
127
|
-
return "bg-amber-50 text-amber-800 shadow-sm dark:bg-amber-900/30 dark:text-amber-300";
|
|
128
|
-
case ApiResourceVisibility.visibility_org:
|
|
129
|
-
return "bg-blue-100 text-blue-800 shadow-sm dark:bg-blue-900/40 dark:text-blue-300";
|
|
130
|
-
case ApiResourceVisibility.visibility_public:
|
|
131
|
-
return "bg-emerald-100 text-emerald-800 shadow-sm dark:bg-emerald-900/40 dark:text-emerald-300";
|
|
132
|
-
default:
|
|
133
|
-
return "bg-background text-foreground shadow-sm";
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
function getIcon(value) {
|
|
137
|
-
switch (value) {
|
|
138
|
-
case ApiResourceVisibility.visibility_private:
|
|
139
|
-
return _jsx(LockIcon, { className: "size-3" });
|
|
140
|
-
case ApiResourceVisibility.visibility_org:
|
|
141
|
-
return _jsx(UsersIcon, { className: "size-3" });
|
|
142
|
-
case ApiResourceVisibility.visibility_public:
|
|
143
|
-
return _jsx(GlobeIcon, { className: "size-3" });
|
|
144
|
-
default:
|
|
145
|
-
return null;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
// ---------------------------------------------------------------------------
|
|
149
|
-
// Icons
|
|
150
|
-
// ---------------------------------------------------------------------------
|
|
151
|
-
function LockIcon({ className }) {
|
|
152
|
-
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("rect", { x: "3.5", y: "7", width: "9", height: "7", rx: "1.5" }), _jsx("path", { d: "M5.5 7V5a2.5 2.5 0 0 1 5 0v2" })] }));
|
|
153
|
-
}
|
|
154
|
-
function UsersIcon({ className }) {
|
|
155
|
-
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("circle", { cx: "6", cy: "5", r: "2.5" }), _jsx("path", { d: "M2 13c0-2.21 1.79-4 4-4s4 1.79 4 4" }), _jsx("circle", { cx: "11.5", cy: "5.5", r: "2" }), _jsx("path", { d: "M14 13c0-1.66-1.12-3-2.5-3-.5 0-1 .14-1.4.4" })] }));
|
|
156
|
-
}
|
|
157
|
-
function GlobeIcon({ className }) {
|
|
158
|
-
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("circle", { cx: "8", cy: "8", r: "6" }), _jsx("path", { d: "M2 8h12" }), _jsx("path", { d: "M8 2c1.66 1.46 2.6 3.63 2.6 6s-.94 4.54-2.6 6c-1.66-1.46-2.6-3.63-2.6-6s.94-4.54 2.6-6Z" })] }));
|
|
30
|
+
return (_jsx(VisibilitySelector, { visibility: visibility, options: INSTANCE_VISIBILITY_LEVELS, onVisibilityChange: onVisibilityChange, isPending: isPending, disabled: disabled, ariaLabel: "Instance visibility", className: className }));
|
|
159
31
|
}
|
|
160
32
|
//# sourceMappingURL=InstanceVisibilitySelector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InstanceVisibilitySelector.js","sourceRoot":"","sources":["../../src/library/InstanceVisibilitySelector.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;
|
|
1
|
+
{"version":3,"file":"InstanceVisibilitySelector.js","sourceRoot":"","sources":["../../src/library/InstanceVisibilitySelector.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAmBhE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,0BAA0B,CAAC,EACzC,UAAU,EACV,kBAAkB,EAClB,SAAS,GAAG,KAAK,EACjB,QAAQ,GAAG,KAAK,EAChB,SAAS,GACuB;IAChC,OAAO,CACL,KAAC,kBAAkB,IACjB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,0BAA0B,EACnC,kBAAkB,EAAE,kBAAkB,EACtC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAC,qBAAqB,EAC/B,SAAS,EAAE,SAAS,GACpB,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -8,6 +8,13 @@ export interface ResourceVisibilityControlProps {
|
|
|
8
8
|
readonly resourceId: string;
|
|
9
9
|
/** Current visibility of the resource. */
|
|
10
10
|
readonly visibility: ApiResourceVisibility;
|
|
11
|
+
/**
|
|
12
|
+
* Slug of the organization that OWNS the resource (`metadata.org`).
|
|
13
|
+
* Used to look up whether the org operates an IdentityProvider, which
|
|
14
|
+
* gates the Platform option for blueprints. When omitted, Platform is
|
|
15
|
+
* simply not offered (the other levels need no org context).
|
|
16
|
+
*/
|
|
17
|
+
readonly org?: string;
|
|
11
18
|
/**
|
|
12
19
|
* Called after a successful visibility change so the host can refresh the
|
|
13
20
|
* resource (e.g. `refetch`) and reflect the new state.
|
|
@@ -21,15 +28,25 @@ export interface ResourceVisibilityControlProps {
|
|
|
21
28
|
*
|
|
22
29
|
* Behavior:
|
|
23
30
|
* - Always renders a legible state: a read-only {@link VisibilityBadge}
|
|
24
|
-
* (
|
|
31
|
+
* (all four levels) is shown to viewers without `can_edit` and while the
|
|
25
32
|
* permission check is in flight — never a silent blank.
|
|
26
|
-
* - Upgrades to the interactive {@link
|
|
33
|
+
* - Upgrades to the interactive {@link VisibilitySelector} for users with
|
|
27
34
|
* `can_edit`, persisting changes via {@link useUpdateVisibility} and invoking
|
|
28
35
|
* {@link ResourceVisibilityControlProps.onChanged} on success.
|
|
29
36
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
37
|
+
* Offered levels are kind- and context-aware (`visibilityLevels.ts`):
|
|
38
|
+
* - Blueprints (agent/workflow/skill/mcp_server): Private / Organization /
|
|
39
|
+
* Public, plus Platform when the deployment is `cloud` AND the owning org
|
|
40
|
+
* operates an IdentityProvider (checked via {@link useSsoProvider}, the
|
|
41
|
+
* only permission-free IdP lookup — blueprint owners editing visibility
|
|
42
|
+
* are not necessarily org admins). In `local` mode (OSS Go backend) the
|
|
43
|
+
* set collapses to Private / Public.
|
|
44
|
+
* - Instances: Private / Organization / Public — platform is excluded by
|
|
45
|
+
* design to preserve tenant isolation.
|
|
46
|
+
*
|
|
47
|
+
* The backend remains the enforcer (`ValidateVisibilityStep` rejects
|
|
48
|
+
* platform without an IdP); the gate here only prevents offering an option
|
|
49
|
+
* that is guaranteed to fail.
|
|
33
50
|
*/
|
|
34
|
-
export declare function ResourceVisibilityControl({ kind, resourceId, visibility, onChanged, className, }: ResourceVisibilityControlProps): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare function ResourceVisibilityControl({ kind, resourceId, visibility, org, onChanged, className, }: ResourceVisibilityControlProps): import("react/jsx-runtime").JSX.Element;
|
|
35
52
|
//# sourceMappingURL=ResourceVisibilityControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceVisibilityControl.d.ts","sourceRoot":"","sources":["../../src/library/ResourceVisibilityControl.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;
|
|
1
|
+
{"version":3,"file":"ResourceVisibilityControl.d.ts","sourceRoot":"","sources":["../../src/library/ResourceVisibilityControl.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AASpG,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAC;AAsB/B,mDAAmD;AACnD,MAAM,WAAW,8BAA8B;IAC7C,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,2DAA2D;IAC3D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,0CAA0C;IAC1C,QAAQ,CAAC,UAAU,EAAE,qBAAqB,CAAC;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,IAAI,EACJ,UAAU,EACV,UAAU,EACV,GAAG,EACH,SAAS,EACT,SAAS,GACV,EAAE,8BAA8B,2CAmDhC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback } from "react";
|
|
4
|
+
import { useDeploymentMode } from "../deployment-mode";
|
|
4
5
|
import { PermissionGate } from "../iam-policy/PermissionGate";
|
|
5
|
-
import {
|
|
6
|
+
import { useSsoProvider } from "../identity-provider/useSsoProvider";
|
|
7
|
+
import { VisibilityBadge, VisibilitySelector } from "./VisibilitySelector";
|
|
8
|
+
import { blueprintVisibilityLevels, INSTANCE_VISIBILITY_LEVELS, } from "./visibilityLevels";
|
|
6
9
|
import { useUpdateVisibility, } from "./useUpdateVisibility";
|
|
7
10
|
/**
|
|
8
11
|
* Maps a {@link VisibilityResourceKind} (which mirrors the SDK method namespace,
|
|
@@ -18,23 +21,49 @@ const FGA_KIND = {
|
|
|
18
21
|
agentInstance: "agent_instance",
|
|
19
22
|
workflowInstance: "workflow_instance",
|
|
20
23
|
};
|
|
24
|
+
const INSTANCE_KINDS = new Set([
|
|
25
|
+
"agentInstance",
|
|
26
|
+
"workflowInstance",
|
|
27
|
+
]);
|
|
21
28
|
/**
|
|
22
29
|
* Single source of truth for the resource-visibility control in detail headers.
|
|
23
30
|
*
|
|
24
31
|
* Behavior:
|
|
25
32
|
* - Always renders a legible state: a read-only {@link VisibilityBadge}
|
|
26
|
-
* (
|
|
33
|
+
* (all four levels) is shown to viewers without `can_edit` and while the
|
|
27
34
|
* permission check is in flight — never a silent blank.
|
|
28
|
-
* - Upgrades to the interactive {@link
|
|
35
|
+
* - Upgrades to the interactive {@link VisibilitySelector} for users with
|
|
29
36
|
* `can_edit`, persisting changes via {@link useUpdateVisibility} and invoking
|
|
30
37
|
* {@link ResourceVisibilityControlProps.onChanged} on success.
|
|
31
38
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
39
|
+
* Offered levels are kind- and context-aware (`visibilityLevels.ts`):
|
|
40
|
+
* - Blueprints (agent/workflow/skill/mcp_server): Private / Organization /
|
|
41
|
+
* Public, plus Platform when the deployment is `cloud` AND the owning org
|
|
42
|
+
* operates an IdentityProvider (checked via {@link useSsoProvider}, the
|
|
43
|
+
* only permission-free IdP lookup — blueprint owners editing visibility
|
|
44
|
+
* are not necessarily org admins). In `local` mode (OSS Go backend) the
|
|
45
|
+
* set collapses to Private / Public.
|
|
46
|
+
* - Instances: Private / Organization / Public — platform is excluded by
|
|
47
|
+
* design to preserve tenant isolation.
|
|
48
|
+
*
|
|
49
|
+
* The backend remains the enforcer (`ValidateVisibilityStep` rejects
|
|
50
|
+
* platform without an IdP); the gate here only prevents offering an option
|
|
51
|
+
* that is guaranteed to fail.
|
|
35
52
|
*/
|
|
36
|
-
export function ResourceVisibilityControl({ kind, resourceId, visibility, onChanged, className, }) {
|
|
53
|
+
export function ResourceVisibilityControl({ kind, resourceId, visibility, org, onChanged, className, }) {
|
|
37
54
|
const { updateVisibility, isPending } = useUpdateVisibility(kind, resourceId);
|
|
55
|
+
const deploymentMode = useDeploymentMode();
|
|
56
|
+
const isInstance = INSTANCE_KINDS.has(kind);
|
|
57
|
+
// The IdP lookup only matters for blueprints in cloud mode; passing null
|
|
58
|
+
// makes the hook a stable no-op everywhere else.
|
|
59
|
+
const idpLookupOrg = !isInstance && deploymentMode === "cloud" ? (org ?? null) : null;
|
|
60
|
+
const { ssoProvider } = useSsoProvider(idpLookupOrg);
|
|
61
|
+
const options = isInstance
|
|
62
|
+
? INSTANCE_VISIBILITY_LEVELS
|
|
63
|
+
: blueprintVisibilityLevels({
|
|
64
|
+
deploymentMode,
|
|
65
|
+
hasIdentityProvider: ssoProvider !== null,
|
|
66
|
+
});
|
|
38
67
|
const handleChange = useCallback(async (next) => {
|
|
39
68
|
try {
|
|
40
69
|
await updateVisibility(next);
|
|
@@ -42,11 +71,11 @@ export function ResourceVisibilityControl({ kind, resourceId, visibility, onChan
|
|
|
42
71
|
}
|
|
43
72
|
catch {
|
|
44
73
|
// The RPC error is captured in useUpdateVisibility's `error` state;
|
|
45
|
-
// swallow here so the
|
|
74
|
+
// swallow here so the selector's promise settles without an unhandled
|
|
46
75
|
// rejection. Surfacing a toast is the host app's concern.
|
|
47
76
|
}
|
|
48
77
|
}, [updateVisibility, onChanged]);
|
|
49
78
|
const badge = _jsx(VisibilityBadge, { visibility: visibility, className: className });
|
|
50
|
-
return (_jsx(PermissionGate, { resource: { kind: FGA_KIND[kind], id: resourceId }, relation: "can_edit", fallback: badge, loading: badge, children: _jsx(
|
|
79
|
+
return (_jsx(PermissionGate, { resource: { kind: FGA_KIND[kind], id: resourceId }, relation: "can_edit", fallback: badge, loading: badge, children: _jsx(VisibilitySelector, { visibility: visibility, options: options, onVisibilityChange: handleChange, isPending: isPending, ariaLabel: isInstance ? "Instance visibility" : "Resource visibility", className: className }) }));
|
|
51
80
|
}
|
|
52
81
|
//# sourceMappingURL=ResourceVisibilityControl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceVisibilityControl.js","sourceRoot":"","sources":["../../src/library/ResourceVisibilityControl.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"ResourceVisibilityControl.js","sourceRoot":"","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I-ARIA Radio Group with roving tabindex and
|
|
24
24
|
* arrow-key navigation. Follows the same visual pattern as
|
|
25
|
-
* {@link
|
|
25
|
+
* {@link VisibilitySelector}.
|
|
26
26
|
*
|
|
27
27
|
* The component is controlled — the consumer owns the `value` state
|
|
28
28
|
* and handles persistence (e.g., localStorage).
|
package/library/ScopeToggle.js
CHANGED
|
@@ -22,7 +22,7 @@ const OPTIONS = [
|
|
|
22
22
|
*
|
|
23
23
|
* Renders as a WAI-ARIA Radio Group with roving tabindex and
|
|
24
24
|
* arrow-key navigation. Follows the same visual pattern as
|
|
25
|
-
* {@link
|
|
25
|
+
* {@link VisibilitySelector}.
|
|
26
26
|
*
|
|
27
27
|
* The component is controlled — the consumer owns the `value` state
|
|
28
28
|
* and handles persistence (e.g., localStorage).
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
2
|
+
import { type VisibilityLevelOption } from "./visibilityLevels";
|
|
3
|
+
/** Props for {@link VisibilitySelector}. */
|
|
4
|
+
export interface VisibilitySelectorProps {
|
|
5
|
+
/** Current visibility of the resource. */
|
|
6
|
+
readonly visibility: ApiResourceVisibility;
|
|
7
|
+
/**
|
|
8
|
+
* Levels to offer, in escalation order (see {@link blueprintVisibilityLevels}).
|
|
9
|
+
* Selecting a level later in the list than the current one is an
|
|
10
|
+
* escalation and shows that option's inline confirmation prompt;
|
|
11
|
+
* de-escalation applies immediately (revoking access is always safe).
|
|
12
|
+
*/
|
|
13
|
+
readonly options: readonly VisibilityLevelOption[];
|
|
14
|
+
/** Called when the user selects (and, for escalations, confirms) a level. */
|
|
15
|
+
readonly onVisibilityChange: (v: ApiResourceVisibility) => void;
|
|
16
|
+
/** Shows a spinner/disabled state while the RPC is in flight. */
|
|
17
|
+
readonly isPending?: boolean;
|
|
18
|
+
/** Disables all interaction (e.g., when the user lacks can_edit). */
|
|
19
|
+
readonly disabled?: boolean;
|
|
20
|
+
/** Accessible name for the radio group. Defaults to "Resource visibility". */
|
|
21
|
+
readonly ariaLabel?: string;
|
|
22
|
+
/** Additional CSS classes applied to the root element. */
|
|
23
|
+
readonly className?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Segmented visibility selector — the single control for resource
|
|
27
|
+
* visibility across blueprints AND instances. The offered levels are pure
|
|
28
|
+
* data ({@link VisibilityLevelOption}); per-kind level sets live in
|
|
29
|
+
* `visibilityLevels.ts`, so this component carries no kind-specific logic.
|
|
30
|
+
*
|
|
31
|
+
* Escalating (moving right in the options list) shows an inline
|
|
32
|
+
* confirmation prompt colored by the target level's tone, since expanding
|
|
33
|
+
* access is consequential. De-escalating applies immediately.
|
|
34
|
+
*
|
|
35
|
+
* If the current visibility is not among the offered options (e.g. a
|
|
36
|
+
* platform-shared blueprint whose org no longer operates an
|
|
37
|
+
* IdentityProvider), its canonical option is rendered in place so the
|
|
38
|
+
* state stays legible and the user can still move to an offered level.
|
|
39
|
+
*
|
|
40
|
+
* WAI-ARIA Radio Group with roving tabindex, following the same visual
|
|
41
|
+
* pattern as {@link ScopeToggle}. All visual properties flow through
|
|
42
|
+
* `--stgm-*` design tokens.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <VisibilitySelector
|
|
47
|
+
* visibility={agent.metadata.visibility}
|
|
48
|
+
* options={blueprintVisibilityLevels({ deploymentMode, hasIdentityProvider })}
|
|
49
|
+
* onVisibilityChange={updateVisibility}
|
|
50
|
+
* isPending={isPending}
|
|
51
|
+
* />
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function VisibilitySelector({ visibility, options, onVisibilityChange, isPending, disabled, ariaLabel, className, }: VisibilitySelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
type Tone = VisibilityLevelOption["tone"];
|
|
56
|
+
/** Icon for a visibility tone; shared with {@link VisibilityBadge}. */
|
|
57
|
+
export declare function VisibilityIcon({ tone, className, }: {
|
|
58
|
+
readonly tone: Tone;
|
|
59
|
+
readonly className?: string;
|
|
60
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
/**
|
|
62
|
+
* Read-only visibility indicator with a matching icon, covering all four
|
|
63
|
+
* levels (Private / Organization / Platform / Public).
|
|
64
|
+
*
|
|
65
|
+
* Rendered wherever the interactive {@link VisibilitySelector} is not
|
|
66
|
+
* available — for viewers who lack `can_edit`, and while a permission check
|
|
67
|
+
* is in flight — so a resource's visibility is always legible rather than
|
|
68
|
+
* silently blank.
|
|
69
|
+
*/
|
|
70
|
+
export declare function VisibilityBadge({ visibility, className, }: {
|
|
71
|
+
readonly visibility: ApiResourceVisibility;
|
|
72
|
+
readonly className?: string;
|
|
73
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
74
|
+
export {};
|
|
75
|
+
//# sourceMappingURL=VisibilitySelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VisibilitySelector.d.ts","sourceRoot":"","sources":["../../src/library/VisibilitySelector.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAC/F,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,oBAAoB,CAAC;AAE5B,4CAA4C;AAC5C,MAAM,WAAW,uBAAuB;IACtC,0CAA0C;IAC1C,QAAQ,CAAC,UAAU,EAAE,qBAAqB,CAAC;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACnD,6EAA6E;IAC7E,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChE,iEAAiE;IACjE,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,8EAA8E;IAC9E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,UAAU,EACV,OAAO,EACP,kBAAkB,EAClB,SAAiB,EACjB,QAAgB,EAChB,SAAiC,EACjC,SAAS,GACV,EAAE,uBAAuB,2CAwKzB;AAMD,KAAK,IAAI,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;AA2D1C,uEAAuE;AACvE,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,SAAS,GACV,EAAE;IACD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B,2CAWA;AA2CD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,SAAS,GACV,EAAE;IACD,QAAQ,CAAC,UAAU,EAAE,qBAAqB,CAAC;IAC3C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B,2CAaA"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { visibilityOption, } from "./visibilityLevels";
|
|
6
|
+
/**
|
|
7
|
+
* Segmented visibility selector — the single control for resource
|
|
8
|
+
* visibility across blueprints AND instances. The offered levels are pure
|
|
9
|
+
* data ({@link VisibilityLevelOption}); per-kind level sets live in
|
|
10
|
+
* `visibilityLevels.ts`, so this component carries no kind-specific logic.
|
|
11
|
+
*
|
|
12
|
+
* Escalating (moving right in the options list) shows an inline
|
|
13
|
+
* confirmation prompt colored by the target level's tone, since expanding
|
|
14
|
+
* access is consequential. De-escalating applies immediately.
|
|
15
|
+
*
|
|
16
|
+
* If the current visibility is not among the offered options (e.g. a
|
|
17
|
+
* platform-shared blueprint whose org no longer operates an
|
|
18
|
+
* IdentityProvider), its canonical option is rendered in place so the
|
|
19
|
+
* state stays legible and the user can still move to an offered level.
|
|
20
|
+
*
|
|
21
|
+
* WAI-ARIA Radio Group with roving tabindex, following the same visual
|
|
22
|
+
* pattern as {@link ScopeToggle}. All visual properties flow through
|
|
23
|
+
* `--stgm-*` design tokens.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <VisibilitySelector
|
|
28
|
+
* visibility={agent.metadata.visibility}
|
|
29
|
+
* options={blueprintVisibilityLevels({ deploymentMode, hasIdentityProvider })}
|
|
30
|
+
* onVisibilityChange={updateVisibility}
|
|
31
|
+
* isPending={isPending}
|
|
32
|
+
* />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export function VisibilitySelector({ visibility, options, onVisibilityChange, isPending = false, disabled = false, ariaLabel = "Resource visibility", className, }) {
|
|
36
|
+
const [confirming, setConfirming] = useState(null);
|
|
37
|
+
const optionRefs = useRef([]);
|
|
38
|
+
const effectivelyDisabled = disabled || isPending;
|
|
39
|
+
// Keep the current state legible even when it is not offerable in the
|
|
40
|
+
// current context: render its canonical option as an extra segment.
|
|
41
|
+
const effectiveOptions = useMemo(() => {
|
|
42
|
+
if (options.some((o) => o.value === visibility))
|
|
43
|
+
return options;
|
|
44
|
+
return [...options, visibilityOption(visibility)];
|
|
45
|
+
}, [options, visibility]);
|
|
46
|
+
const isEscalation = useCallback((target) => {
|
|
47
|
+
const values = effectiveOptions.map((o) => o.value);
|
|
48
|
+
return values.indexOf(target) > values.indexOf(visibility);
|
|
49
|
+
}, [effectiveOptions, visibility]);
|
|
50
|
+
const handleSelect = useCallback((value) => {
|
|
51
|
+
if (value === visibility)
|
|
52
|
+
return;
|
|
53
|
+
if (isEscalation(value)) {
|
|
54
|
+
setConfirming(value);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
setConfirming(null);
|
|
58
|
+
onVisibilityChange(value);
|
|
59
|
+
}, [visibility, onVisibilityChange, isEscalation]);
|
|
60
|
+
const confirmChange = useCallback(() => {
|
|
61
|
+
if (confirming === null)
|
|
62
|
+
return;
|
|
63
|
+
setConfirming(null);
|
|
64
|
+
onVisibilityChange(confirming);
|
|
65
|
+
}, [confirming, onVisibilityChange]);
|
|
66
|
+
const cancelConfirm = useCallback(() => {
|
|
67
|
+
setConfirming(null);
|
|
68
|
+
}, []);
|
|
69
|
+
const handleKeyDown = useCallback((e, index) => {
|
|
70
|
+
let nextIndex = null;
|
|
71
|
+
if (e.key === "ArrowRight" || e.key === "ArrowDown") {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
nextIndex = (index + 1) % effectiveOptions.length;
|
|
74
|
+
}
|
|
75
|
+
else if (e.key === "ArrowLeft" || e.key === "ArrowUp") {
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
nextIndex =
|
|
78
|
+
(index - 1 + effectiveOptions.length) % effectiveOptions.length;
|
|
79
|
+
}
|
|
80
|
+
if (nextIndex !== null) {
|
|
81
|
+
optionRefs.current[nextIndex]?.focus();
|
|
82
|
+
handleSelect(effectiveOptions[nextIndex].value);
|
|
83
|
+
}
|
|
84
|
+
}, [effectiveOptions, handleSelect]);
|
|
85
|
+
const confirmingOption = confirming !== null
|
|
86
|
+
? effectiveOptions.find((o) => o.value === confirming)
|
|
87
|
+
: undefined;
|
|
88
|
+
return (_jsxs("div", { className: cn("inline-flex flex-col gap-1.5", className), children: [_jsx("div", { role: "radiogroup", "aria-label": ariaLabel, "aria-disabled": effectivelyDisabled || undefined, className: cn("inline-flex rounded-md bg-muted p-0.5", effectivelyDisabled && "pointer-events-none opacity-50"), children: effectiveOptions.map((option, index) => {
|
|
89
|
+
const isSelected = visibility === option.value;
|
|
90
|
+
return (_jsxs("button", { ref: (el) => {
|
|
91
|
+
optionRefs.current[index] = el;
|
|
92
|
+
}, type: "button", role: "radio", "aria-checked": isSelected, "aria-label": `${option.label}: ${option.description}`, tabIndex: isSelected ? 0 : -1, disabled: effectivelyDisabled, onClick: () => handleSelect(option.value), onKeyDown: (e) => handleKeyDown(e, index), className: cn("inline-flex cursor-pointer items-center gap-1 rounded-sm px-2.5 py-1 text-xs font-medium transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", isSelected
|
|
93
|
+
? SELECTED_STYLES[option.tone]
|
|
94
|
+
: "text-muted-foreground hover:text-foreground"), children: [isPending && isSelected ? (_jsx("span", { className: "inline-block size-3 animate-spin rounded-full border-2 border-current border-t-transparent", "aria-hidden": "true" })) : (_jsx(VisibilityIcon, { tone: option.tone, className: "size-3" })), option.label] }, option.value));
|
|
95
|
+
}) }), confirming === null && (_jsx("p", { className: "text-[0.65rem] text-muted-foreground", children: effectiveOptions.find((o) => o.value === visibility)?.description })), confirmingOption?.confirmPrompt && (_jsxs("div", { className: cn("flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs", PROMPT_STYLES[confirmingOption.tone].container), role: "alert", children: [_jsx("span", { className: PROMPT_STYLES[confirmingOption.tone].text, children: confirmingOption.confirmPrompt }), _jsx("button", { type: "button", onClick: confirmChange, className: cn("rounded px-2 py-0.5 text-xs font-medium text-white", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", PROMPT_STYLES[confirmingOption.tone].confirm), children: "Confirm" }), _jsx("button", { type: "button", onClick: cancelConfirm, className: cn("rounded px-2 py-0.5 text-xs font-medium", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", PROMPT_STYLES[confirmingOption.tone].cancel), children: "Cancel" })] }))] }));
|
|
96
|
+
}
|
|
97
|
+
const SELECTED_STYLES = {
|
|
98
|
+
private: "bg-amber-50 text-amber-800 shadow-sm dark:bg-amber-900/30 dark:text-amber-300",
|
|
99
|
+
org: "bg-blue-100 text-blue-800 shadow-sm dark:bg-blue-900/40 dark:text-blue-300",
|
|
100
|
+
platform: "bg-violet-100 text-violet-800 shadow-sm dark:bg-violet-900/40 dark:text-violet-300",
|
|
101
|
+
public: "bg-emerald-100 text-emerald-800 shadow-sm dark:bg-emerald-900/40 dark:text-emerald-300",
|
|
102
|
+
};
|
|
103
|
+
const PROMPT_STYLES = {
|
|
104
|
+
// Private never escalates, but the row keeps the Record total.
|
|
105
|
+
private: {
|
|
106
|
+
container: "border-amber-200 bg-amber-50 dark:border-amber-800/50 dark:bg-amber-950/30",
|
|
107
|
+
text: "text-amber-800 dark:text-amber-200",
|
|
108
|
+
confirm: "bg-amber-600 hover:bg-amber-700 dark:bg-amber-600 dark:hover:bg-amber-500",
|
|
109
|
+
cancel: "text-amber-700 hover:text-amber-900 dark:text-amber-300 dark:hover:text-amber-100",
|
|
110
|
+
},
|
|
111
|
+
org: {
|
|
112
|
+
container: "border-blue-200 bg-blue-50 dark:border-blue-800/50 dark:bg-blue-950/30",
|
|
113
|
+
text: "text-blue-800 dark:text-blue-200",
|
|
114
|
+
confirm: "bg-blue-600 hover:bg-blue-700 dark:bg-blue-600 dark:hover:bg-blue-500",
|
|
115
|
+
cancel: "text-blue-700 hover:text-blue-900 dark:text-blue-300 dark:hover:text-blue-100",
|
|
116
|
+
},
|
|
117
|
+
platform: {
|
|
118
|
+
container: "border-violet-200 bg-violet-50 dark:border-violet-800/50 dark:bg-violet-950/30",
|
|
119
|
+
text: "text-violet-800 dark:text-violet-200",
|
|
120
|
+
confirm: "bg-violet-600 hover:bg-violet-700 dark:bg-violet-600 dark:hover:bg-violet-500",
|
|
121
|
+
cancel: "text-violet-700 hover:text-violet-900 dark:text-violet-300 dark:hover:text-violet-100",
|
|
122
|
+
},
|
|
123
|
+
public: {
|
|
124
|
+
container: "border-amber-200 bg-amber-50 dark:border-amber-800/50 dark:bg-amber-950/30",
|
|
125
|
+
text: "text-amber-800 dark:text-amber-200",
|
|
126
|
+
confirm: "bg-amber-600 hover:bg-amber-700 dark:bg-amber-600 dark:hover:bg-amber-500",
|
|
127
|
+
cancel: "text-amber-700 hover:text-amber-900 dark:text-amber-300 dark:hover:text-amber-100",
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
// ---------------------------------------------------------------------------
|
|
131
|
+
// Icons — inline SVGs following the SDK pattern (no icon library dependency)
|
|
132
|
+
// ---------------------------------------------------------------------------
|
|
133
|
+
/** Icon for a visibility tone; shared with {@link VisibilityBadge}. */
|
|
134
|
+
export function VisibilityIcon({ tone, className, }) {
|
|
135
|
+
switch (tone) {
|
|
136
|
+
case "org":
|
|
137
|
+
return _jsx(UsersIcon, { className: className });
|
|
138
|
+
case "platform":
|
|
139
|
+
return _jsx(BuildingsIcon, { className: className });
|
|
140
|
+
case "public":
|
|
141
|
+
return _jsx(GlobeIcon, { className: className });
|
|
142
|
+
default:
|
|
143
|
+
return _jsx(LockIcon, { className: className });
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function LockIcon({ className }) {
|
|
147
|
+
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("rect", { x: "3.5", y: "7", width: "9", height: "7", rx: "1.5" }), _jsx("path", { d: "M5.5 7V5a2.5 2.5 0 0 1 5 0v2" })] }));
|
|
148
|
+
}
|
|
149
|
+
function UsersIcon({ className }) {
|
|
150
|
+
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("circle", { cx: "6", cy: "5", r: "2.5" }), _jsx("path", { d: "M2 13c0-2.21 1.79-4 4-4s4 1.79 4 4" }), _jsx("circle", { cx: "11.5", cy: "5.5", r: "2" }), _jsx("path", { d: "M14 13c0-1.66-1.12-3-2.5-3-.5 0-1 .14-1.4.4" })] }));
|
|
151
|
+
}
|
|
152
|
+
function BuildingsIcon({ className }) {
|
|
153
|
+
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M2 14V4.5L6.5 2v12" }), _jsx("path", { d: "M6.5 6.5 14 8.5V14" }), _jsx("path", { d: "M2 14h12" }), _jsx("path", { d: "M4.25 6h.01M4.25 8.5h.01M4.25 11h.01M10.5 10.5h.01M10.5 12.5h.01" })] }));
|
|
154
|
+
}
|
|
155
|
+
function GlobeIcon({ className }) {
|
|
156
|
+
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("circle", { cx: "8", cy: "8", r: "6" }), _jsx("path", { d: "M2 8h12" }), _jsx("path", { d: "M8 2c1.66 1.46 2.6 3.63 2.6 6s-.94 4.54-2.6 6c-1.66-1.46-2.6-3.63-2.6-6s.94-4.54 2.6-6Z" })] }));
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Read-only visibility indicator with a matching icon, covering all four
|
|
160
|
+
* levels (Private / Organization / Platform / Public).
|
|
161
|
+
*
|
|
162
|
+
* Rendered wherever the interactive {@link VisibilitySelector} is not
|
|
163
|
+
* available — for viewers who lack `can_edit`, and while a permission check
|
|
164
|
+
* is in flight — so a resource's visibility is always legible rather than
|
|
165
|
+
* silently blank.
|
|
166
|
+
*/
|
|
167
|
+
export function VisibilityBadge({ visibility, className, }) {
|
|
168
|
+
const option = visibilityOption(visibility);
|
|
169
|
+
return (_jsxs("span", { className: cn("inline-flex shrink-0 items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground", className), children: [_jsx(VisibilityIcon, { tone: option.tone, className: "size-2.5" }), option.label] }));
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=VisibilitySelector.js.map
|
|
@@ -0,0 +1 @@
|
|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