@burdenoff/microfe-sandbox 2026.510.113
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/dist/dev/main.d.ts +2 -0
- package/dist/dev/main.d.ts.map +1 -0
- package/dist/generated/global-operations.d.ts +2 -0
- package/dist/generated/global-operations.d.ts.map +1 -0
- package/dist/generated/global-types.d.ts +21253 -0
- package/dist/generated/global-types.d.ts.map +1 -0
- package/dist/generated/wspace-operations.d.ts +1595 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -0
- package/dist/generated/wspace-operations.js +692 -0
- package/dist/generated/wspace-operations.js.map +1 -0
- package/dist/generated/wspace-types.d.ts +55214 -0
- package/dist/generated/wspace-types.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1674 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/dist/sandbox/AdminRoutes.d.ts +12 -0
- package/dist/sandbox/AdminRoutes.d.ts.map +1 -0
- package/dist/sandbox/AdminRoutes.js +45 -0
- package/dist/sandbox/AdminRoutes.js.map +1 -0
- package/dist/sandbox/SandboxAdminRoot.d.ts +21 -0
- package/dist/sandbox/SandboxAdminRoot.d.ts.map +1 -0
- package/dist/sandbox/SandboxAdminRoot.js +55 -0
- package/dist/sandbox/SandboxAdminRoot.js.map +1 -0
- package/dist/sandbox/SandboxRoot.d.ts +31 -0
- package/dist/sandbox/SandboxRoot.d.ts.map +1 -0
- package/dist/sandbox/SandboxRoot.js +61 -0
- package/dist/sandbox/SandboxRoot.js.map +1 -0
- package/dist/sandbox/SandboxRoutes.d.ts +18 -0
- package/dist/sandbox/SandboxRoutes.d.ts.map +1 -0
- package/dist/sandbox/UserRoutes.d.ts +11 -0
- package/dist/sandbox/UserRoutes.d.ts.map +1 -0
- package/dist/sandbox/UserRoutes.js +57 -0
- package/dist/sandbox/UserRoutes.js.map +1 -0
- package/dist/sandbox/components/ContainerImagePicker.d.ts +24 -0
- package/dist/sandbox/components/ContainerImagePicker.d.ts.map +1 -0
- package/dist/sandbox/components/CountdownTimer.d.ts +9 -0
- package/dist/sandbox/components/CountdownTimer.d.ts.map +1 -0
- package/dist/sandbox/components/CountdownTimer.js +75 -0
- package/dist/sandbox/components/CountdownTimer.js.map +1 -0
- package/dist/sandbox/components/ExportSandboxesDialog.d.ts +8 -0
- package/dist/sandbox/components/ExportSandboxesDialog.d.ts.map +1 -0
- package/dist/sandbox/components/ExportSandboxesDialog.js +130 -0
- package/dist/sandbox/components/ExportSandboxesDialog.js.map +1 -0
- package/dist/sandbox/components/ExtendTTLModal.d.ts +10 -0
- package/dist/sandbox/components/ExtendTTLModal.d.ts.map +1 -0
- package/dist/sandbox/components/ExtendTTLModal.js +109 -0
- package/dist/sandbox/components/ExtendTTLModal.js.map +1 -0
- package/dist/sandbox/components/PageLayout.d.ts +39 -0
- package/dist/sandbox/components/PageLayout.d.ts.map +1 -0
- package/dist/sandbox/components/PageLayout.js +75 -0
- package/dist/sandbox/components/PageLayout.js.map +1 -0
- package/dist/sandbox/components/ResourceDisplay.d.ts +17 -0
- package/dist/sandbox/components/ResourceDisplay.d.ts.map +1 -0
- package/dist/sandbox/components/ResourceDisplay.js +69 -0
- package/dist/sandbox/components/ResourceDisplay.js.map +1 -0
- package/dist/sandbox/components/RouteUtils.d.ts +28 -0
- package/dist/sandbox/components/RouteUtils.d.ts.map +1 -0
- package/dist/sandbox/components/RouteUtils.js +68 -0
- package/dist/sandbox/components/RouteUtils.js.map +1 -0
- package/dist/sandbox/components/SandboxActivityTab.d.ts +14 -0
- package/dist/sandbox/components/SandboxActivityTab.d.ts.map +1 -0
- package/dist/sandbox/components/SandboxActivityTab.js +83 -0
- package/dist/sandbox/components/SandboxActivityTab.js.map +1 -0
- package/dist/sandbox/components/SandboxAgentAppPanel.d.ts +16 -0
- package/dist/sandbox/components/SandboxAgentAppPanel.d.ts.map +1 -0
- package/dist/sandbox/components/SandboxAgentAppPanel.js +103 -0
- package/dist/sandbox/components/SandboxAgentAppPanel.js.map +1 -0
- package/dist/sandbox/components/SandboxTypeIcon.d.ts +15 -0
- package/dist/sandbox/components/SandboxTypeIcon.d.ts.map +1 -0
- package/dist/sandbox/components/SandboxTypeIcon.js +52 -0
- package/dist/sandbox/components/SandboxTypeIcon.js.map +1 -0
- package/dist/sandbox/components/SandboxTypeSelector.d.ts +35 -0
- package/dist/sandbox/components/SandboxTypeSelector.d.ts.map +1 -0
- package/dist/sandbox/components/SandboxUsageBanner.d.ts +16 -0
- package/dist/sandbox/components/SandboxUsageBanner.d.ts.map +1 -0
- package/dist/sandbox/components/SandboxUsageBanner.js +37 -0
- package/dist/sandbox/components/SandboxUsageBanner.js.map +1 -0
- package/dist/sandbox/components/StatusBadge.d.ts +15 -0
- package/dist/sandbox/components/StatusBadge.d.ts.map +1 -0
- package/dist/sandbox/components/StatusBadge.js +86 -0
- package/dist/sandbox/components/StatusBadge.js.map +1 -0
- package/dist/sandbox/components/TagsInput.d.ts +14 -0
- package/dist/sandbox/components/TagsInput.d.ts.map +1 -0
- package/dist/sandbox/components/TagsInput.js +46 -0
- package/dist/sandbox/components/TagsInput.js.map +1 -0
- package/dist/sandbox/components/ui.d.ts +6 -0
- package/dist/sandbox/components/ui.d.ts.map +1 -0
- package/dist/sandbox/components/ui.js +2 -0
- package/dist/sandbox/hooks/useRemainingSeconds.d.ts +12 -0
- package/dist/sandbox/hooks/useRemainingSeconds.d.ts.map +1 -0
- package/dist/sandbox/hooks/useRemainingSeconds.js +23 -0
- package/dist/sandbox/hooks/useRemainingSeconds.js.map +1 -0
- package/dist/sandbox/index.d.ts +30 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/index.js +4 -0
- package/dist/sandbox/pages/AdminLandingPage.d.ts +9 -0
- package/dist/sandbox/pages/AdminLandingPage.d.ts.map +1 -0
- package/dist/sandbox/pages/AdminLandingPage.js +40 -0
- package/dist/sandbox/pages/AdminLandingPage.js.map +1 -0
- package/dist/sandbox/pages/AdminPage.d.ts +2 -0
- package/dist/sandbox/pages/AdminPage.d.ts.map +1 -0
- package/dist/sandbox/pages/AdminPage.js +448 -0
- package/dist/sandbox/pages/AdminPage.js.map +1 -0
- package/dist/sandbox/pages/AdminTemplatesPage.d.ts +7 -0
- package/dist/sandbox/pages/AdminTemplatesPage.d.ts.map +1 -0
- package/dist/sandbox/pages/AdminTemplatesPage.js +155 -0
- package/dist/sandbox/pages/AdminTemplatesPage.js.map +1 -0
- package/dist/sandbox/pages/SandboxCreatePage.d.ts +2 -0
- package/dist/sandbox/pages/SandboxCreatePage.d.ts.map +1 -0
- package/dist/sandbox/pages/SandboxCreatePage.js +1121 -0
- package/dist/sandbox/pages/SandboxCreatePage.js.map +1 -0
- package/dist/sandbox/pages/SandboxDetailPage.d.ts +6 -0
- package/dist/sandbox/pages/SandboxDetailPage.d.ts.map +1 -0
- package/dist/sandbox/pages/SandboxDetailPage.js +822 -0
- package/dist/sandbox/pages/SandboxDetailPage.js.map +1 -0
- package/dist/sandbox/pages/SandboxLandingPage.d.ts +12 -0
- package/dist/sandbox/pages/SandboxLandingPage.d.ts.map +1 -0
- package/dist/sandbox/pages/SandboxListPage.d.ts +6 -0
- package/dist/sandbox/pages/SandboxListPage.d.ts.map +1 -0
- package/dist/sandbox/pages/SandboxListPage.js +820 -0
- package/dist/sandbox/pages/SandboxListPage.js.map +1 -0
- package/dist/sandbox/pages/TemplateDetailPage.d.ts +6 -0
- package/dist/sandbox/pages/TemplateDetailPage.d.ts.map +1 -0
- package/dist/sandbox/pages/TemplateDetailPage.js +691 -0
- package/dist/sandbox/pages/TemplateDetailPage.js.map +1 -0
- package/dist/sandbox/pages/TemplatesPage.d.ts +8 -0
- package/dist/sandbox/pages/TemplatesPage.d.ts.map +1 -0
- package/dist/sandbox/pages/UserLandingPage.d.ts +9 -0
- package/dist/sandbox/pages/UserLandingPage.d.ts.map +1 -0
- package/dist/sandbox/pages/UserLandingPage.js +52 -0
- package/dist/sandbox/pages/UserLandingPage.js.map +1 -0
- package/dist/sandbox/pages/UserTemplatesPage.d.ts +8 -0
- package/dist/sandbox/pages/UserTemplatesPage.d.ts.map +1 -0
- package/dist/sandbox/pages/UserTemplatesPage.js +121 -0
- package/dist/sandbox/pages/UserTemplatesPage.js.map +1 -0
- package/dist/sandbox/providers/SandboxProvider.d.ts +13 -0
- package/dist/sandbox/providers/SandboxProvider.d.ts.map +1 -0
- package/dist/sandbox/providers/SandboxProvider.js +78 -0
- package/dist/sandbox/providers/SandboxProvider.js.map +1 -0
- package/dist/sandbox/store/sandboxStore.d.ts +16 -0
- package/dist/sandbox/store/sandboxStore.d.ts.map +1 -0
- package/dist/sandbox/store/sandboxStore.js +24 -0
- package/dist/sandbox/store/sandboxStore.js.map +1 -0
- package/dist/sandbox/types/index.d.ts +238 -0
- package/dist/sandbox/types/index.d.ts.map +1 -0
- package/dist/sandbox/utils/cn.d.ts +8 -0
- package/dist/sandbox/utils/cn.d.ts.map +1 -0
- package/dist/sandbox/utils/cn.js +10 -0
- package/dist/sandbox/utils/cn.js.map +1 -0
- package/dist/sandbox/utils/formatters.d.ts +7 -0
- package/dist/sandbox/utils/formatters.d.ts.map +1 -0
- package/dist/sandbox/utils/formatters.js +10 -0
- package/dist/sandbox/utils/formatters.js.map +1 -0
- package/dist/sandbox/utils/i18n.d.ts +6 -0
- package/dist/sandbox/utils/i18n.d.ts.map +1 -0
- package/dist/sandbox/utils/i18n.js +15 -0
- package/dist/sandbox/utils/i18n.js.map +1 -0
- package/dist/sandbox/utils/navigation.d.ts +5 -0
- package/dist/sandbox/utils/navigation.d.ts.map +1 -0
- package/dist/sandbox/utils/navigation.js +8 -0
- package/dist/sandbox/utils/navigation.js.map +1 -0
- package/dist/sandbox/utils/sandboxEvents.d.ts +13 -0
- package/dist/sandbox/utils/sandboxEvents.d.ts.map +1 -0
- package/dist/sandbox/utils/sandboxEvents.js +20 -0
- package/dist/sandbox/utils/sandboxEvents.js.map +1 -0
- package/dist/utils/nativeBridge.d.ts +3 -0
- package/dist/utils/nativeBridge.d.ts.map +1 -0
- package/dist/utils/nativeBridge.js +2 -0
- package/package.json +107 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface PageLayoutProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** Page title */
|
|
6
|
+
title?: string;
|
|
7
|
+
/** Page subtitle/description */
|
|
8
|
+
subtitle?: string;
|
|
9
|
+
/** Icon component to display next to title */
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
/** Actions to display in header (buttons, etc.) */
|
|
12
|
+
headerActions?: ReactNode;
|
|
13
|
+
/** Additional header content below title */
|
|
14
|
+
headerContent?: ReactNode;
|
|
15
|
+
/** Maximum width of content: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full' */
|
|
16
|
+
maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full';
|
|
17
|
+
/** Whether to show the header section */
|
|
18
|
+
showHeader?: boolean;
|
|
19
|
+
/** Additional CSS classes for the container */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Additional CSS classes for the content area */
|
|
22
|
+
contentClassName?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* PageLayout - A consistent page wrapper with responsive design
|
|
26
|
+
*/
|
|
27
|
+
export declare function PageLayout({ children, title, subtitle, icon, headerActions, headerContent, maxWidth, showHeader, className, contentClassName, }: PageLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
/**
|
|
29
|
+
* EmptyState - A consistent empty state component
|
|
30
|
+
*/
|
|
31
|
+
export declare function EmptyState({ icon, title, description, action, className, }: {
|
|
32
|
+
icon?: ReactNode;
|
|
33
|
+
title: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
action?: ReactNode;
|
|
36
|
+
className?: string;
|
|
37
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=PageLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageLayout.d.ts","sourceRoot":"","sources":["../../../src/sandbox/components/PageLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,UAAU,eAAe;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,mDAAmD;IACnD,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,4CAA4C;IAC5C,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,mFAAmF;IACnF,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAC9D,yCAAyC;IACzC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAYD;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,aAAa,EACb,aAAa,EACb,QAAe,EACf,UAAiB,EACjB,SAAS,EACT,gBAAgB,GACjB,EAAE,eAAe,2CAgDjB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,GACV,EAAE;IACD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAiBA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/sandbox/components/PageLayout.tsx
|
|
4
|
+
var r = {
|
|
5
|
+
sm: "max-w-screen-sm",
|
|
6
|
+
md: "max-w-screen-md",
|
|
7
|
+
lg: "max-w-screen-lg",
|
|
8
|
+
xl: "max-w-screen-xl",
|
|
9
|
+
"2xl": "max-w-screen-2xl",
|
|
10
|
+
"3xl": "max-w-[1600px]",
|
|
11
|
+
full: "max-w-full"
|
|
12
|
+
};
|
|
13
|
+
function i({ children: i, title: a, subtitle: o, icon: s, headerActions: c, headerContent: l, maxWidth: u = "xl", showHeader: d = !0, className: f, contentClassName: p }) {
|
|
14
|
+
return /* @__PURE__ */ t("div", {
|
|
15
|
+
className: e("min-h-full w-full", "px-4 sm:px-6 lg:px-8 xl:px-12", "py-6 sm:py-8 lg:py-10", "animate-in fade-in-0 slide-in-from-bottom-4 duration-500", f),
|
|
16
|
+
children: /* @__PURE__ */ n("div", {
|
|
17
|
+
className: e("mx-auto w-full", r[u], p),
|
|
18
|
+
children: [d && (a || c) && /* @__PURE__ */ n("header", {
|
|
19
|
+
className: "mb-6 sm:mb-8",
|
|
20
|
+
children: [/* @__PURE__ */ n("div", {
|
|
21
|
+
className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
|
|
22
|
+
children: [/* @__PURE__ */ n("div", {
|
|
23
|
+
className: "space-y-1",
|
|
24
|
+
children: [(a || s) && /* @__PURE__ */ n("div", {
|
|
25
|
+
className: "flex items-center gap-3",
|
|
26
|
+
children: [s && /* @__PURE__ */ t("div", {
|
|
27
|
+
className: "flex-shrink-0 p-2.5 rounded-xl bg-primary/10 text-primary",
|
|
28
|
+
children: s
|
|
29
|
+
}), a && /* @__PURE__ */ t("h1", {
|
|
30
|
+
className: "text-2xl sm:text-3xl font-bold tracking-tight text-foreground",
|
|
31
|
+
children: a
|
|
32
|
+
})]
|
|
33
|
+
}), o && /* @__PURE__ */ t("p", {
|
|
34
|
+
className: "text-sm sm:text-base text-muted-foreground max-w-2xl",
|
|
35
|
+
children: o
|
|
36
|
+
})]
|
|
37
|
+
}), c && /* @__PURE__ */ t("div", {
|
|
38
|
+
className: "flex items-center gap-2 flex-shrink-0",
|
|
39
|
+
children: c
|
|
40
|
+
})]
|
|
41
|
+
}), l && /* @__PURE__ */ t("div", {
|
|
42
|
+
className: "mt-4",
|
|
43
|
+
children: l
|
|
44
|
+
})]
|
|
45
|
+
}), /* @__PURE__ */ t("div", {
|
|
46
|
+
className: "space-y-6",
|
|
47
|
+
children: i
|
|
48
|
+
})]
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function a({ icon: r, title: i, description: a, action: o, className: s }) {
|
|
53
|
+
return /* @__PURE__ */ n("div", {
|
|
54
|
+
className: e("flex flex-col items-center justify-center", "py-12 sm:py-16 px-4", "text-center", "animate-in fade-in-0 zoom-in-95 duration-300", s),
|
|
55
|
+
children: [
|
|
56
|
+
r && /* @__PURE__ */ t("div", {
|
|
57
|
+
className: "mb-4 p-4 rounded-2xl bg-muted/50 text-muted-foreground",
|
|
58
|
+
children: r
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ t("h3", {
|
|
61
|
+
className: "text-lg font-semibold text-foreground mb-1",
|
|
62
|
+
children: i
|
|
63
|
+
}),
|
|
64
|
+
a && /* @__PURE__ */ t("p", {
|
|
65
|
+
className: "text-sm text-muted-foreground max-w-sm mb-4",
|
|
66
|
+
children: a
|
|
67
|
+
}),
|
|
68
|
+
o
|
|
69
|
+
]
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
export { a as EmptyState, i as PageLayout };
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=PageLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageLayout.js","names":[],"sources":["../../../src/sandbox/components/PageLayout.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { cn } from '../utils/cn';\n\ninterface PageLayoutProps {\n children: ReactNode;\n /** Page title */\n title?: string;\n /** Page subtitle/description */\n subtitle?: string;\n /** Icon component to display next to title */\n icon?: ReactNode;\n /** Actions to display in header (buttons, etc.) */\n headerActions?: ReactNode;\n /** Additional header content below title */\n headerContent?: ReactNode;\n /** Maximum width of content: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full' */\n maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full';\n /** Whether to show the header section */\n showHeader?: boolean;\n /** Additional CSS classes for the container */\n className?: string;\n /** Additional CSS classes for the content area */\n contentClassName?: string;\n}\n\nconst maxWidthClasses = {\n sm: 'max-w-screen-sm',\n md: 'max-w-screen-md',\n lg: 'max-w-screen-lg',\n xl: 'max-w-screen-xl',\n '2xl': 'max-w-screen-2xl',\n '3xl': 'max-w-[1600px]',\n full: 'max-w-full',\n};\n\n/**\n * PageLayout - A consistent page wrapper with responsive design\n */\nexport function PageLayout({\n children,\n title,\n subtitle,\n icon,\n headerActions,\n headerContent,\n maxWidth = 'xl',\n showHeader = true,\n className,\n contentClassName,\n}: PageLayoutProps) {\n return (\n <div\n className={cn(\n 'min-h-full w-full',\n 'px-4 sm:px-6 lg:px-8 xl:px-12',\n 'py-6 sm:py-8 lg:py-10',\n 'animate-in fade-in-0 slide-in-from-bottom-4 duration-500',\n className\n )}\n >\n <div className={cn('mx-auto w-full', maxWidthClasses[maxWidth], contentClassName)}>\n {showHeader && (title || headerActions) && (\n <header className=\"mb-6 sm:mb-8\">\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"space-y-1\">\n {(title || icon) && (\n <div className=\"flex items-center gap-3\">\n {icon && (\n <div className=\"flex-shrink-0 p-2.5 rounded-xl bg-primary/10 text-primary\">\n {icon}\n </div>\n )}\n {title && (\n <h1 className=\"text-2xl sm:text-3xl font-bold tracking-tight text-foreground\">\n {title}\n </h1>\n )}\n </div>\n )}\n {subtitle && (\n <p className=\"text-sm sm:text-base text-muted-foreground max-w-2xl\">{subtitle}</p>\n )}\n </div>\n {headerActions && (\n <div className=\"flex items-center gap-2 flex-shrink-0\">{headerActions}</div>\n )}\n </div>\n {headerContent && <div className=\"mt-4\">{headerContent}</div>}\n </header>\n )}\n {/* Page content — must not use a <main> landmark here because the\n host shell (AppShellLayout) already renders one; nesting <main>\n elements is invalid HTML and an a11y violation. */}\n <div className=\"space-y-6\">{children}</div>\n </div>\n </div>\n );\n}\n\n/**\n * EmptyState - A consistent empty state component\n */\nexport function EmptyState({\n icon,\n title,\n description,\n action,\n className,\n}: {\n icon?: ReactNode;\n title: string;\n description?: string;\n action?: ReactNode;\n className?: string;\n}) {\n return (\n <div\n className={cn(\n 'flex flex-col items-center justify-center',\n 'py-12 sm:py-16 px-4',\n 'text-center',\n 'animate-in fade-in-0 zoom-in-95 duration-300',\n className\n )}\n >\n {icon && <div className=\"mb-4 p-4 rounded-2xl bg-muted/50 text-muted-foreground\">{icon}</div>}\n <h3 className=\"text-lg font-semibold text-foreground mb-1\">{title}</h3>\n {description && <p className=\"text-sm text-muted-foreground max-w-sm mb-4\">{description}</p>}\n {action}\n </div>\n );\n}\n"],"mappings":";;;AAyBA,IAAM,IAAkB;CACtB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACP,OAAO;CACP,MAAM;CACP;AAKD,SAAgB,EAAW,EACzB,aACA,UACA,aACA,SACA,kBACA,kBACA,cAAW,MACX,gBAAa,IACb,cACA,uBACkB;AAClB,QACE,kBAAC,OAAD;EACE,WAAW,EACT,qBACA,iCACA,yBACA,4DACA,EACD;YAED,kBAAC,OAAD;GAAK,WAAW,EAAG,kBAAkB,EAAgB,IAAW,EAAiB;aAAjF,CACG,MAAe,KAAS,MACvB,kBAAC,UAAD;IAAQ,WAAU;cAAlB,CACE,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,OAAD;MAAK,WAAU;gBAAf,EACI,KAAS,MACT,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACG,KACC,kBAAC,OAAD;QAAK,WAAU;kBACZ;QACG,CAAA,EAEP,KACC,kBAAC,MAAD;QAAI,WAAU;kBACX;QACE,CAAA,CAEH;UAEP,KACC,kBAAC,KAAD;OAAG,WAAU;iBAAwD;OAAa,CAAA,CAEhF;SACL,KACC,kBAAC,OAAD;MAAK,WAAU;gBAAyC;MAAoB,CAAA,CAE1E;QACL,KAAiB,kBAAC,OAAD;KAAK,WAAU;eAAQ;KAAoB,CAAA,CACtD;OAKX,kBAAC,OAAD;IAAK,WAAU;IAAa;IAAe,CAAA,CACvC;;EACF,CAAA;;AAOV,SAAgB,EAAW,EACzB,SACA,UACA,gBACA,WACA,gBAOC;AACD,QACE,kBAAC,OAAD;EACE,WAAW,EACT,6CACA,uBACA,eACA,gDACA,EACD;YAPH;GASG,KAAQ,kBAAC,OAAD;IAAK,WAAU;cAA0D;IAAW,CAAA;GAC7F,kBAAC,MAAD;IAAI,WAAU;cAA8C;IAAW,CAAA;GACtE,KAAe,kBAAC,KAAD;IAAG,WAAU;cAA+C;IAAgB,CAAA;GAC3F;GACG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ResourceDisplayProps {
|
|
4
|
+
cpuRequest: string;
|
|
5
|
+
cpuLimit?: string;
|
|
6
|
+
memoryRequest: string;
|
|
7
|
+
memoryLimit?: string;
|
|
8
|
+
containerCount?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
layout?: 'inline' | 'grid';
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Compact display for sandbox resource allocation (CPU / Memory / Containers)
|
|
14
|
+
*/
|
|
15
|
+
export declare const ResourceDisplay: FC<ResourceDisplayProps>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=ResourceDisplay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceDisplay.d.ts","sourceRoot":"","sources":["../../../src/sandbox/components/ResourceDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,UAAU,oBAAoB;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA8DpD,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { Container as t, Cpu as n, MemoryStick as r } from "lucide-react";
|
|
3
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
//#region src/sandbox/components/ResourceDisplay.tsx
|
|
5
|
+
var o = ({ cpuRequest: o, cpuLimit: s, memoryRequest: c, memoryLimit: l, containerCount: u, className: d, layout: f = "inline" }) => {
|
|
6
|
+
let p = [
|
|
7
|
+
{
|
|
8
|
+
icon: n,
|
|
9
|
+
label: "CPU",
|
|
10
|
+
value: s ? `${o} / ${s}` : o,
|
|
11
|
+
color: "text-accent-blue"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
icon: r,
|
|
15
|
+
label: "Memory",
|
|
16
|
+
value: l ? `${c} / ${l}` : c,
|
|
17
|
+
color: "text-accent-purple"
|
|
18
|
+
},
|
|
19
|
+
...u === void 0 ? [] : [{
|
|
20
|
+
icon: t,
|
|
21
|
+
label: "Containers",
|
|
22
|
+
value: `${u}`,
|
|
23
|
+
color: "text-status-warning-text"
|
|
24
|
+
}]
|
|
25
|
+
];
|
|
26
|
+
return f === "grid" ? /* @__PURE__ */ i("div", {
|
|
27
|
+
className: e("grid grid-cols-3 gap-3", d),
|
|
28
|
+
children: p.map((e) => /* @__PURE__ */ a("div", {
|
|
29
|
+
className: "flex flex-col items-center gap-1 p-2 rounded-lg bg-muted/50",
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ i(e.icon, {
|
|
32
|
+
size: 16,
|
|
33
|
+
className: e.color
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ i("span", {
|
|
36
|
+
className: "text-xs text-muted-foreground",
|
|
37
|
+
children: e.label
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ i("span", {
|
|
40
|
+
className: "text-sm font-semibold",
|
|
41
|
+
children: e.value
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
}, e.label))
|
|
45
|
+
}) : /* @__PURE__ */ i("div", {
|
|
46
|
+
className: e("flex items-center gap-3 text-sm", d),
|
|
47
|
+
children: p.map((e, t) => /* @__PURE__ */ a("span", {
|
|
48
|
+
className: "inline-flex items-center gap-1",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ i(e.icon, {
|
|
51
|
+
size: 14,
|
|
52
|
+
className: e.color
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ i("span", {
|
|
55
|
+
className: "font-medium",
|
|
56
|
+
children: e.value
|
|
57
|
+
}),
|
|
58
|
+
t < p.length - 1 && /* @__PURE__ */ i("span", {
|
|
59
|
+
className: "ml-2 text-muted-foreground/40",
|
|
60
|
+
children: "|"
|
|
61
|
+
})
|
|
62
|
+
]
|
|
63
|
+
}, e.label))
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
//#endregion
|
|
67
|
+
export { o as ResourceDisplay };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=ResourceDisplay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceDisplay.js","names":[],"sources":["../../../src/sandbox/components/ResourceDisplay.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Cpu, MemoryStick, Container } from 'lucide-react';\nimport { cn } from '../utils/cn';\n\ninterface ResourceDisplayProps {\n cpuRequest: string;\n cpuLimit?: string;\n memoryRequest: string;\n memoryLimit?: string;\n containerCount?: number;\n className?: string;\n layout?: 'inline' | 'grid';\n}\n\n/**\n * Compact display for sandbox resource allocation (CPU / Memory / Containers)\n */\nexport const ResourceDisplay: FC<ResourceDisplayProps> = ({\n cpuRequest,\n cpuLimit,\n memoryRequest,\n memoryLimit,\n containerCount,\n className,\n layout = 'inline',\n}) => {\n const items = [\n {\n icon: Cpu,\n label: 'CPU',\n value: cpuLimit ? `${cpuRequest} / ${cpuLimit}` : cpuRequest,\n color: 'text-accent-blue',\n },\n {\n icon: MemoryStick,\n label: 'Memory',\n value: memoryLimit ? `${memoryRequest} / ${memoryLimit}` : memoryRequest,\n color: 'text-accent-purple',\n },\n ...(containerCount !== undefined\n ? [\n {\n icon: Container,\n label: 'Containers',\n value: `${containerCount}`,\n color: 'text-status-warning-text',\n },\n ]\n : []),\n ];\n\n if (layout === 'grid') {\n return (\n <div className={cn('grid grid-cols-3 gap-3', className)}>\n {items.map((item) => (\n <div\n key={item.label}\n className=\"flex flex-col items-center gap-1 p-2 rounded-lg bg-muted/50\"\n >\n <item.icon size={16} className={item.color} />\n <span className=\"text-xs text-muted-foreground\">{item.label}</span>\n <span className=\"text-sm font-semibold\">{item.value}</span>\n </div>\n ))}\n </div>\n );\n }\n\n return (\n <div className={cn('flex items-center gap-3 text-sm', className)}>\n {items.map((item, index) => (\n <span key={item.label} className=\"inline-flex items-center gap-1\">\n <item.icon size={14} className={item.color} />\n <span className=\"font-medium\">{item.value}</span>\n {index < items.length - 1 && <span className=\"ml-2 text-muted-foreground/40\">|</span>}\n </span>\n ))}\n </div>\n );\n};\n"],"mappings":";;;;AAiBA,IAAa,KAA6C,EACxD,eACA,aACA,kBACA,gBACA,mBACA,cACA,YAAS,eACL;CACJ,IAAM,IAAQ;EACZ;GACE,MAAM;GACN,OAAO;GACP,OAAO,IAAW,GAAG,EAAW,KAAK,MAAa;GAClD,OAAO;GACR;EACD;GACE,MAAM;GACN,OAAO;GACP,OAAO,IAAc,GAAG,EAAc,KAAK,MAAgB;GAC3D,OAAO;GACR;EACD,GAAI,MAAmB,KAAA,IASnB,EAAE,GARF,CACE;GACE,MAAM;GACN,OAAO;GACP,OAAO,GAAG;GACV,OAAO;GACR,CACF;EAEN;AAmBD,QAjBI,MAAW,SAEX,kBAAC,OAAD;EAAK,WAAW,EAAG,0BAA0B,EAAU;YACpD,EAAM,KAAK,MACV,kBAAC,OAAD;GAEE,WAAU;aAFZ;IAIE,kBAAC,EAAK,MAAN;KAAW,MAAM;KAAI,WAAW,EAAK;KAAS,CAAA;IAC9C,kBAAC,QAAD;KAAM,WAAU;eAAiC,EAAK;KAAa,CAAA;IACnE,kBAAC,QAAD;KAAM,WAAU;eAAyB,EAAK;KAAa,CAAA;IACvD;KANC,EAAK,MAMN,CACN;EACE,CAAA,GAKR,kBAAC,OAAD;EAAK,WAAW,EAAG,mCAAmC,EAAU;YAC7D,EAAM,KAAK,GAAM,MAChB,kBAAC,QAAD;GAAuB,WAAU;aAAjC;IACE,kBAAC,EAAK,MAAN;KAAW,MAAM;KAAI,WAAW,EAAK;KAAS,CAAA;IAC9C,kBAAC,QAAD;KAAM,WAAU;eAAe,EAAK;KAAa,CAAA;IAChD,IAAQ,EAAM,SAAS,KAAK,kBAAC,QAAD;KAAM,WAAU;eAAgC;KAAQ,CAAA;IAChF;KAJI,EAAK,MAIT,CACP;EACE,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Component, ReactNode, ErrorInfo } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Loading fallback for lazy-loaded pages
|
|
5
|
+
*/
|
|
6
|
+
export declare function PageLoader(): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
/**
|
|
8
|
+
* Error boundary for lazy-loaded page chunks.
|
|
9
|
+
* Catches chunk-load failures and renders a retry UI instead of an infinite spinner.
|
|
10
|
+
*/
|
|
11
|
+
export declare class LazyErrorBoundary extends Component<{
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}, {
|
|
14
|
+
hasError: boolean;
|
|
15
|
+
error: Error | null;
|
|
16
|
+
}> {
|
|
17
|
+
constructor(props: {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
});
|
|
20
|
+
static getDerivedStateFromError(error: Error): {
|
|
21
|
+
hasError: boolean;
|
|
22
|
+
error: Error;
|
|
23
|
+
};
|
|
24
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
25
|
+
handleRetry: () => void;
|
|
26
|
+
render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=RouteUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RouteUtils.d.ts","sourceRoot":"","sources":["../../../src/sandbox/components/RouteUtils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlE;;GAEG;AACH,wBAAgB,UAAU,4CAMzB;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,SAAS,CAC9C;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,EACvB;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CAAE,CAC3C;gBACa,KAAK,EAAE;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE;IAK1C,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;;;;IAI5C,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;IAIpD,WAAW,aAMT;IAEF,MAAM;CA6BP"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Component as e } from "react";
|
|
2
|
+
import { AlertTriangle as t, Loader2 as n, RefreshCw as r } from "lucide-react";
|
|
3
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
//#region src/sandbox/components/RouteUtils.tsx
|
|
5
|
+
function o() {
|
|
6
|
+
return /* @__PURE__ */ i("div", {
|
|
7
|
+
className: "flex items-center justify-center min-h-[400px]",
|
|
8
|
+
children: /* @__PURE__ */ i(n, { className: "h-8 w-8 animate-spin text-primary" })
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
var s = class extends e {
|
|
12
|
+
constructor(e) {
|
|
13
|
+
super(e), this.state = {
|
|
14
|
+
hasError: !1,
|
|
15
|
+
error: null
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
static getDerivedStateFromError(e) {
|
|
19
|
+
return {
|
|
20
|
+
hasError: !0,
|
|
21
|
+
error: e
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
componentDidCatch(e, t) {
|
|
25
|
+
console.error("[Sandbox] Lazy page load failed:", e, t);
|
|
26
|
+
}
|
|
27
|
+
handleRetry = () => {
|
|
28
|
+
if (this.state.error?.name === "ChunkLoadError") {
|
|
29
|
+
window.location.reload();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.setState({
|
|
33
|
+
hasError: !1,
|
|
34
|
+
error: null
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
render() {
|
|
38
|
+
return this.state.hasError ? /* @__PURE__ */ a("div", {
|
|
39
|
+
className: "flex flex-col items-center justify-center min-h-[400px] gap-4 text-center p-6",
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ i("div", {
|
|
42
|
+
className: "p-3 rounded-full bg-destructive/10",
|
|
43
|
+
children: /* @__PURE__ */ i(t, { className: "h-8 w-8 text-destructive" })
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ a("div", {
|
|
46
|
+
className: "space-y-2",
|
|
47
|
+
children: [/* @__PURE__ */ i("h3", {
|
|
48
|
+
className: "text-lg font-semibold text-foreground",
|
|
49
|
+
children: "Failed to load page"
|
|
50
|
+
}), /* @__PURE__ */ i("p", {
|
|
51
|
+
className: "text-sm text-muted-foreground max-w-md",
|
|
52
|
+
children: this.state.error?.message?.includes("Loading chunk") ? "The page chunk could not be loaded. This may be due to a network issue." : "Something went wrong while loading this page. Please try again."
|
|
53
|
+
})]
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ a("button", {
|
|
56
|
+
type: "button",
|
|
57
|
+
onClick: this.handleRetry,
|
|
58
|
+
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",
|
|
59
|
+
children: [/* @__PURE__ */ i(r, { className: "h-4 w-4" }), "Try Again"]
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
}) : this.props.children;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
//#endregion
|
|
66
|
+
export { s as LazyErrorBoundary, o as PageLoader };
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=RouteUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RouteUtils.js","names":[],"sources":["../../../src/sandbox/components/RouteUtils.tsx"],"sourcesContent":["import { Component, type ReactNode, type ErrorInfo } from 'react';\nimport { Loader2, AlertTriangle, RefreshCw } from 'lucide-react';\n\n/**\n * Loading fallback for lazy-loaded pages\n */\nexport function PageLoader() {\n return (\n <div className=\"flex items-center justify-center min-h-[400px]\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n );\n}\n\n/**\n * Error boundary for lazy-loaded page chunks.\n * Catches chunk-load failures and renders a retry UI instead of an infinite spinner.\n */\nexport class LazyErrorBoundary extends Component<\n { children: ReactNode },\n { hasError: boolean; error: Error | null }\n> {\n constructor(props: { children: ReactNode }) {\n super(props);\n this.state = { hasError: false, error: null };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { hasError: true, error };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n console.error('[Sandbox] Lazy page load failed:', error, errorInfo);\n }\n\n handleRetry = () => {\n if (this.state.error?.name === 'ChunkLoadError') {\n window.location.reload();\n return;\n }\n this.setState({ hasError: false, error: null });\n };\n\n render() {\n if (this.state.hasError) {\n return (\n <div className=\"flex flex-col items-center justify-center min-h-[400px] gap-4 text-center p-6\">\n <div className=\"p-3 rounded-full bg-destructive/10\">\n <AlertTriangle className=\"h-8 w-8 text-destructive\" />\n </div>\n <div className=\"space-y-2\">\n <h3 className=\"text-lg font-semibold text-foreground\">Failed to load page</h3>\n <p className=\"text-sm text-muted-foreground max-w-md\">\n {this.state.error?.message?.includes('Loading chunk')\n ? 'The page chunk could not be loaded. This may be due to a network issue.'\n : 'Something went wrong while loading this page. Please try again.'}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={this.handleRetry}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors\"\n >\n <RefreshCw className=\"h-4 w-4\" />\n Try Again\n </button>\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n"],"mappings":";;;;AAMA,SAAgB,IAAa;AAC3B,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAS,WAAU,qCAAsC,CAAA;EACrD,CAAA;;AAQV,IAAa,IAAb,cAAuC,EAGrC;CACA,YAAY,GAAgC;AAE1C,EADA,MAAM,EAAM,EACZ,KAAK,QAAQ;GAAE,UAAU;GAAO,OAAO;GAAM;;CAG/C,OAAO,yBAAyB,GAAc;AAC5C,SAAO;GAAE,UAAU;GAAM;GAAO;;CAGlC,kBAAkB,GAAc,GAAsB;AACpD,UAAQ,MAAM,oCAAoC,GAAO,EAAU;;CAGrE,oBAAoB;AAClB,MAAI,KAAK,MAAM,OAAO,SAAS,kBAAkB;AAC/C,UAAO,SAAS,QAAQ;AACxB;;AAEF,OAAK,SAAS;GAAE,UAAU;GAAO,OAAO;GAAM,CAAC;;CAGjD,SAAS;AA2BP,SA1BI,KAAK,MAAM,WAEX,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,GAAD,EAAe,WAAU,4BAA6B,CAAA;KAClD,CAAA;IACN,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,MAAD;MAAI,WAAU;gBAAwC;MAAwB,CAAA,EAC9E,kBAAC,KAAD;MAAG,WAAU;gBACV,KAAK,MAAM,OAAO,SAAS,SAAS,gBAAgB,GACjD,4EACA;MACF,CAAA,CACA;;IACN,kBAAC,UAAD;KACE,MAAK;KACL,SAAS,KAAK;KACd,WAAU;eAHZ,CAKE,kBAAC,GAAD,EAAW,WAAU,WAAY,CAAA,EAAA,YAE1B;;IACL;OAIH,KAAK,MAAM"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
sandboxId: string;
|
|
3
|
+
workspaceId: string;
|
|
4
|
+
pageSize?: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Activity / audit feed scoped to a single sandbox. Reuses the existing
|
|
8
|
+
* `getRecentSandboxActivity` admin query and filters client-side by sandboxId
|
|
9
|
+
* so no new backend query is needed for the v0.3.0 cycle. Server-side scoping
|
|
10
|
+
* will move to a dedicated `getSandboxAuditLog(sandboxId)` query in a follow-up.
|
|
11
|
+
*/
|
|
12
|
+
export declare function SandboxActivityTab({ sandboxId, workspaceId, pageSize }: Props): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=SandboxActivityTab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SandboxActivityTab.d.ts","sourceRoot":"","sources":["../../../src/sandbox/components/SandboxActivityTab.tsx"],"names":[],"mappings":"AAiCA,UAAU,KAAK;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,QAAa,EAAE,EAAE,KAAK,2CA6ElF"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { tWithFallback as e } from "../utils/i18n.js";
|
|
2
|
+
import { useEffect as t, useMemo as n, useState as r } from "react";
|
|
3
|
+
import { gql as i } from "@apollo/client";
|
|
4
|
+
import { useApolloClient as a } from "@apollo/client/react";
|
|
5
|
+
import { useI18n as o } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
//#region src/sandbox/components/SandboxActivityTab.tsx
|
|
8
|
+
var l = i`
|
|
9
|
+
query GetRecentSandboxActivity($context: ContextInput!, $limit: Int) {
|
|
10
|
+
getRecentSandboxActivity(context: $context, limit: $limit) {
|
|
11
|
+
items {
|
|
12
|
+
id
|
|
13
|
+
action
|
|
14
|
+
sandboxName
|
|
15
|
+
sandboxId
|
|
16
|
+
actorId
|
|
17
|
+
status
|
|
18
|
+
createdAt
|
|
19
|
+
}
|
|
20
|
+
total
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
function u({ sandboxId: i, workspaceId: u, pageSize: d = 50 }) {
|
|
25
|
+
let { t: f } = o(), p = a(), [m, h] = r(null), [g, _] = r(null);
|
|
26
|
+
t(() => {
|
|
27
|
+
let e = !1;
|
|
28
|
+
return p.query({
|
|
29
|
+
query: l,
|
|
30
|
+
variables: {
|
|
31
|
+
context: { workspaceId: u },
|
|
32
|
+
limit: d
|
|
33
|
+
},
|
|
34
|
+
fetchPolicy: "network-only"
|
|
35
|
+
}).then((t) => {
|
|
36
|
+
e || h((t.data?.getRecentSandboxActivity?.items ?? []).filter((e) => e.sandboxId === i));
|
|
37
|
+
}).catch((t) => {
|
|
38
|
+
e || _(t instanceof Error ? t.message : String(t));
|
|
39
|
+
}), () => {
|
|
40
|
+
e = !0;
|
|
41
|
+
};
|
|
42
|
+
}, [
|
|
43
|
+
p,
|
|
44
|
+
i,
|
|
45
|
+
u,
|
|
46
|
+
d
|
|
47
|
+
]);
|
|
48
|
+
let v = n(() => m?.slice().sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime()) ?? null, [m]);
|
|
49
|
+
return g ? /* @__PURE__ */ s("p", {
|
|
50
|
+
className: "text-sm text-status-error-text",
|
|
51
|
+
children: e(f, "sandbox.activity.loadFailed", "Couldn't load activity.")
|
|
52
|
+
}) : v == null ? /* @__PURE__ */ s("p", {
|
|
53
|
+
className: "text-sm text-text-secondary",
|
|
54
|
+
children: "…"
|
|
55
|
+
}) : v.length === 0 ? /* @__PURE__ */ s("p", {
|
|
56
|
+
className: "text-sm text-text-secondary",
|
|
57
|
+
children: e(f, "sandbox.activity.empty", "No activity yet.")
|
|
58
|
+
}) : /* @__PURE__ */ s("ul", {
|
|
59
|
+
role: "list",
|
|
60
|
+
className: "divide-y divide-border-subtle",
|
|
61
|
+
children: v.map((t) => /* @__PURE__ */ c("li", {
|
|
62
|
+
role: "listitem",
|
|
63
|
+
className: "py-3",
|
|
64
|
+
children: [/* @__PURE__ */ s("div", {
|
|
65
|
+
className: "text-sm font-medium text-foreground",
|
|
66
|
+
children: t.action
|
|
67
|
+
}), /* @__PURE__ */ c("div", {
|
|
68
|
+
className: "mt-0.5 text-xs text-text-secondary",
|
|
69
|
+
children: [
|
|
70
|
+
e(f, "sandbox.activity.actor", `by ${t.actorId}`, { actor: t.actorId }),
|
|
71
|
+
" ",
|
|
72
|
+
"·",
|
|
73
|
+
" ",
|
|
74
|
+
e(f, "sandbox.activity.atTime", `at ${new Date(t.createdAt).toLocaleString()}`, { time: new Date(t.createdAt).toLocaleString() })
|
|
75
|
+
]
|
|
76
|
+
})]
|
|
77
|
+
}, t.id))
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
export { u as SandboxActivityTab };
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=SandboxActivityTab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SandboxActivityTab.js","names":[],"sources":["../../../src/sandbox/components/SandboxActivityTab.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useApolloClient } from '@apollo/client/react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { tWithFallback } from '../utils/i18n';\n\nconst RECENT_ACTIVITY = gql`\n query GetRecentSandboxActivity($context: ContextInput!, $limit: Int) {\n getRecentSandboxActivity(context: $context, limit: $limit) {\n items {\n id\n action\n sandboxName\n sandboxId\n actorId\n status\n createdAt\n }\n total\n }\n }\n`;\n\ninterface ActivityItem {\n id: string;\n action: string;\n sandboxName: string;\n sandboxId?: string | null;\n actorId: string;\n status: string;\n createdAt: string;\n}\n\ninterface Props {\n sandboxId: string;\n workspaceId: string;\n pageSize?: number;\n}\n\n/**\n * Activity / audit feed scoped to a single sandbox. Reuses the existing\n * `getRecentSandboxActivity` admin query and filters client-side by sandboxId\n * so no new backend query is needed for the v0.3.0 cycle. Server-side scoping\n * will move to a dedicated `getSandboxAuditLog(sandboxId)` query in a follow-up.\n */\nexport function SandboxActivityTab({ sandboxId, workspaceId, pageSize = 50 }: Props) {\n const { t } = useI18n();\n const client = useApolloClient();\n const [items, setItems] = useState<ActivityItem[] | null>(null);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n let cancelled = false;\n client\n .query<{ getRecentSandboxActivity: { items: ActivityItem[] } }>({\n query: RECENT_ACTIVITY,\n variables: { context: { workspaceId }, limit: pageSize },\n fetchPolicy: 'network-only',\n })\n .then((res: { data?: { getRecentSandboxActivity?: { items?: ActivityItem[] } } }) => {\n if (cancelled) return;\n const all: ActivityItem[] = res.data?.getRecentSandboxActivity?.items ?? [];\n setItems(all.filter((entry: ActivityItem) => entry.sandboxId === sandboxId));\n })\n .catch((err: unknown) => {\n if (cancelled) return;\n setError(err instanceof Error ? err.message : String(err));\n });\n return () => {\n cancelled = true;\n };\n }, [client, sandboxId, workspaceId, pageSize]);\n\n const sorted = useMemo(\n () =>\n items\n ?.slice()\n .sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()) ?? null,\n [items]\n );\n\n if (error) {\n return (\n <p className=\"text-sm text-status-error-text\">\n {tWithFallback(t, 'sandbox.activity.loadFailed', \"Couldn't load activity.\")}\n </p>\n );\n }\n if (sorted == null) {\n return <p className=\"text-sm text-text-secondary\">…</p>;\n }\n if (sorted.length === 0) {\n return (\n <p className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.activity.empty', 'No activity yet.')}\n </p>\n );\n }\n\n return (\n <ul role=\"list\" className=\"divide-y divide-border-subtle\">\n {sorted.map((entry) => (\n <li key={entry.id} role=\"listitem\" className=\"py-3\">\n <div className=\"text-sm font-medium text-foreground\">{entry.action}</div>\n <div className=\"mt-0.5 text-xs text-text-secondary\">\n {tWithFallback(t, 'sandbox.activity.actor', `by ${entry.actorId}`, {\n actor: entry.actorId,\n })}{' '}\n ·{' '}\n {tWithFallback(\n t,\n 'sandbox.activity.atTime',\n `at ${new Date(entry.createdAt).toLocaleString()}`,\n {\n time: new Date(entry.createdAt).toLocaleString(),\n }\n )}\n </div>\n </li>\n ))}\n </ul>\n );\n}\n"],"mappings":";;;;;;;AAMA,IAAM,IAAkB,CAAG;;;;;;;;;;;;;;;;AAuC3B,SAAgB,EAAmB,EAAE,cAAW,gBAAa,cAAW,MAAa;CACnF,IAAM,EAAE,SAAM,GAAS,EACjB,IAAS,GAAiB,EAC1B,CAAC,GAAO,KAAY,EAAgC,KAAK,EACzD,CAAC,GAAO,KAAY,EAAwB,KAAK;AAEvD,SAAgB;EACd,IAAI,IAAY;AAgBhB,SAfA,EACG,MAA+D;GAC9D,OAAO;GACP,WAAW;IAAE,SAAS,EAAE,gBAAa;IAAE,OAAO;IAAU;GACxD,aAAa;GACd,CAAC,CACD,MAAM,MAA8E;AAC/E,QAEJ,GAD4B,EAAI,MAAM,0BAA0B,SAAS,EAAE,EAC9D,QAAQ,MAAwB,EAAM,cAAc,EAAU,CAAC;IAC5E,CACD,OAAO,MAAiB;AACnB,QACJ,EAAS,aAAe,QAAQ,EAAI,UAAU,OAAO,EAAI,CAAC;IAC1D,QACS;AACX,OAAY;;IAEb;EAAC;EAAQ;EAAW;EAAa;EAAS,CAAC;CAE9C,IAAM,IAAS,QAEX,GACI,OAAO,CACR,MAAM,GAAG,MAAM,IAAI,KAAK,EAAE,UAAU,CAAC,SAAS,GAAG,IAAI,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,IAAI,MAC1F,CAAC,EAAM,CACR;AAoBD,QAlBI,IAEA,kBAAC,KAAD;EAAG,WAAU;YACV,EAAc,GAAG,+BAA+B,0BAA0B;EACzE,CAAA,GAGJ,KAAU,OACL,kBAAC,KAAD;EAAG,WAAU;YAA8B;EAAK,CAAA,GAErD,EAAO,WAAW,IAElB,kBAAC,KAAD;EAAG,WAAU;YACV,EAAc,GAAG,0BAA0B,mBAAmB;EAC7D,CAAA,GAKN,kBAAC,MAAD;EAAI,MAAK;EAAO,WAAU;YACvB,EAAO,KAAK,MACX,kBAAC,MAAD;GAAmB,MAAK;GAAW,WAAU;aAA7C,CACE,kBAAC,OAAD;IAAK,WAAU;cAAuC,EAAM;IAAa,CAAA,EACzE,kBAAC,OAAD;IAAK,WAAU;cAAf;KACG,EAAc,GAAG,0BAA0B,MAAM,EAAM,WAAW,EACjE,OAAO,EAAM,SACd,CAAC;KAAE;KAAI;KACN;KACD,EACC,GACA,2BACA,MAAM,IAAI,KAAK,EAAM,UAAU,CAAC,gBAAgB,IAChD,EACE,MAAM,IAAI,KAAK,EAAM,UAAU,CAAC,gBAAgB,EACjD,CACF;KACG;MACH;KAhBI,EAAM,GAgBV,CACL;EACC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
appId?: string | null;
|
|
3
|
+
clientId?: string | null;
|
|
4
|
+
/** Only available on first creation; backend never returns it again. */
|
|
5
|
+
clientSecret?: string | null;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Read-only panel surfacing the auto-registered DevPortal application created
|
|
9
|
+
* for the in-sandbox VibeControls agent. Backend lifecycle lives in
|
|
10
|
+
* `wspace-sandbox-svc/.../createSandboxAgentApp`. The clientSecret is shown
|
|
11
|
+
* once, on first create — afterwards the panel hides it behind a "rotate via
|
|
12
|
+
* Developer Portal" message.
|
|
13
|
+
*/
|
|
14
|
+
export declare function SandboxAgentAppPanel({ appId, clientId, clientSecret }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=SandboxAgentAppPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SandboxAgentAppPanel.d.ts","sourceRoot":"","sources":["../../../src/sandbox/components/SandboxAgentAppPanel.tsx"],"names":[],"mappings":"AAKA,UAAU,KAAK;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,KAAK,kDA6F5E"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { tWithFallback as e } from "../utils/i18n.js";
|
|
2
|
+
import { useState as t } from "react";
|
|
3
|
+
import { CheckCircle2 as n, Copy as r, Eye as i, EyeOff as a } from "lucide-react";
|
|
4
|
+
import { useI18n as o } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
5
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
//#region src/sandbox/components/SandboxAgentAppPanel.tsx
|
|
7
|
+
function u({ appId: u, clientId: f, clientSecret: p }) {
|
|
8
|
+
let { t: m } = o(), [h, g] = t(!1), [_, v] = t(null);
|
|
9
|
+
if (!u && !f) return null;
|
|
10
|
+
let y = (e, t) => {
|
|
11
|
+
navigator.clipboard.writeText(e), v(t), setTimeout(() => v((e) => e === t ? null : e), 1500);
|
|
12
|
+
};
|
|
13
|
+
return /* @__PURE__ */ l("section", {
|
|
14
|
+
"aria-label": e(m, "sandbox.agentApp.title", "Auto-registered application"),
|
|
15
|
+
className: "rounded-md border border-border-subtle bg-bg-surface p-4 text-sm",
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ c("h3", {
|
|
18
|
+
className: "text-sm font-semibold text-foreground",
|
|
19
|
+
children: e(m, "sandbox.agentApp.title", "Auto-registered application")
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ c("p", {
|
|
22
|
+
className: "mt-1 text-xs text-text-secondary",
|
|
23
|
+
children: e(m, "sandbox.agentApp.description", "An OAuth app was created so the in-sandbox VibeControls agent can authenticate against the platform automatically.")
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ l("dl", {
|
|
26
|
+
className: "mt-3 space-y-2",
|
|
27
|
+
children: [
|
|
28
|
+
u && /* @__PURE__ */ c(d, {
|
|
29
|
+
label: e(m, "sandbox.agentApp.appId", "App ID"),
|
|
30
|
+
value: u,
|
|
31
|
+
onCopy: () => y(u, "app"),
|
|
32
|
+
copied: _ === "app"
|
|
33
|
+
}),
|
|
34
|
+
f && /* @__PURE__ */ c(d, {
|
|
35
|
+
label: e(m, "sandbox.agentApp.clientId", "Client ID"),
|
|
36
|
+
value: f,
|
|
37
|
+
onCopy: () => y(f, "client"),
|
|
38
|
+
copied: _ === "client"
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ l("div", {
|
|
41
|
+
className: "flex items-center justify-between gap-2",
|
|
42
|
+
children: [/* @__PURE__ */ c("dt", {
|
|
43
|
+
className: "text-xs text-text-tertiary",
|
|
44
|
+
children: e(m, "sandbox.agentApp.clientSecret", "Client secret")
|
|
45
|
+
}), /* @__PURE__ */ c("dd", {
|
|
46
|
+
className: "flex items-center gap-2 font-mono text-xs",
|
|
47
|
+
children: p && h ? /* @__PURE__ */ l(s, { children: [
|
|
48
|
+
/* @__PURE__ */ c("span", { children: p }),
|
|
49
|
+
/* @__PURE__ */ c("button", {
|
|
50
|
+
type: "button",
|
|
51
|
+
onClick: () => y(p, "secret"),
|
|
52
|
+
"aria-label": e(m, "sandbox.agentApp.copySecret", "Copy client secret"),
|
|
53
|
+
className: "text-text-tertiary hover:text-text-secondary",
|
|
54
|
+
children: c(_ === "secret" ? n : r, { size: 12 })
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ c("button", {
|
|
57
|
+
type: "button",
|
|
58
|
+
onClick: () => g(!1),
|
|
59
|
+
className: "text-text-tertiary hover:text-text-secondary",
|
|
60
|
+
"aria-label": e(m, "sandbox.agentApp.hide", "Hide"),
|
|
61
|
+
children: /* @__PURE__ */ c(a, { size: 12 })
|
|
62
|
+
})
|
|
63
|
+
] }) : p ? /* @__PURE__ */ l("button", {
|
|
64
|
+
type: "button",
|
|
65
|
+
onClick: () => g(!0),
|
|
66
|
+
className: "inline-flex items-center gap-1 rounded-md border border-border-subtle px-2 py-0.5 text-text-secondary hover:bg-bg-sunken",
|
|
67
|
+
children: [/* @__PURE__ */ c(i, {
|
|
68
|
+
size: 12,
|
|
69
|
+
"aria-hidden": "true"
|
|
70
|
+
}), e(m, "sandbox.agentApp.secret.revealOnce", "Reveal once")]
|
|
71
|
+
}) : /* @__PURE__ */ c("span", {
|
|
72
|
+
className: "text-text-tertiary",
|
|
73
|
+
children: e(m, "sandbox.agentApp.secret.hidden", "Hidden — visible only at first creation")
|
|
74
|
+
})
|
|
75
|
+
})]
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function d({ label: e, value: t, onCopy: i, copied: a }) {
|
|
83
|
+
return /* @__PURE__ */ l("div", {
|
|
84
|
+
className: "flex items-center justify-between gap-2",
|
|
85
|
+
children: [/* @__PURE__ */ c("dt", {
|
|
86
|
+
className: "text-xs text-text-tertiary",
|
|
87
|
+
children: e
|
|
88
|
+
}), /* @__PURE__ */ l("dd", {
|
|
89
|
+
className: "flex items-center gap-2 font-mono text-xs",
|
|
90
|
+
children: [/* @__PURE__ */ c("span", { children: t }), /* @__PURE__ */ c("button", {
|
|
91
|
+
type: "button",
|
|
92
|
+
onClick: i,
|
|
93
|
+
"aria-label": `Copy ${e}`,
|
|
94
|
+
className: "text-text-tertiary hover:text-text-secondary",
|
|
95
|
+
children: c(a ? n : r, { size: 12 })
|
|
96
|
+
})]
|
|
97
|
+
})]
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
export { u as SandboxAgentAppPanel };
|
|
102
|
+
|
|
103
|
+
//# sourceMappingURL=SandboxAgentAppPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SandboxAgentAppPanel.js","names":[],"sources":["../../../src/sandbox/components/SandboxAgentAppPanel.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Copy, CheckCircle2, Eye, EyeOff } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { tWithFallback } from '../utils/i18n';\n\ninterface Props {\n appId?: string | null;\n clientId?: string | null;\n /** Only available on first creation; backend never returns it again. */\n clientSecret?: string | null;\n}\n\n/**\n * Read-only panel surfacing the auto-registered DevPortal application created\n * for the in-sandbox VibeControls agent. Backend lifecycle lives in\n * `wspace-sandbox-svc/.../createSandboxAgentApp`. The clientSecret is shown\n * once, on first create — afterwards the panel hides it behind a \"rotate via\n * Developer Portal\" message.\n */\nexport function SandboxAgentAppPanel({ appId, clientId, clientSecret }: Props) {\n const { t } = useI18n();\n const [revealed, setRevealed] = useState(false);\n const [copied, setCopied] = useState<string | null>(null);\n\n if (!appId && !clientId) return null;\n\n const copy = (value: string, key: string) => {\n void navigator.clipboard.writeText(value);\n setCopied(key);\n setTimeout(() => setCopied((current) => (current === key ? null : current)), 1500);\n };\n\n return (\n <section\n aria-label={tWithFallback(t, 'sandbox.agentApp.title', 'Auto-registered application')}\n className=\"rounded-md border border-border-subtle bg-bg-surface p-4 text-sm\"\n >\n <h3 className=\"text-sm font-semibold text-foreground\">\n {tWithFallback(t, 'sandbox.agentApp.title', 'Auto-registered application')}\n </h3>\n <p className=\"mt-1 text-xs text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.agentApp.description',\n 'An OAuth app was created so the in-sandbox VibeControls agent can authenticate against the platform automatically.'\n )}\n </p>\n <dl className=\"mt-3 space-y-2\">\n {appId && (\n <Row\n label={tWithFallback(t, 'sandbox.agentApp.appId', 'App ID')}\n value={appId}\n onCopy={() => copy(appId, 'app')}\n copied={copied === 'app'}\n />\n )}\n {clientId && (\n <Row\n label={tWithFallback(t, 'sandbox.agentApp.clientId', 'Client ID')}\n value={clientId}\n onCopy={() => copy(clientId, 'client')}\n copied={copied === 'client'}\n />\n )}\n <div className=\"flex items-center justify-between gap-2\">\n <dt className=\"text-xs text-text-tertiary\">\n {tWithFallback(t, 'sandbox.agentApp.clientSecret', 'Client secret')}\n </dt>\n <dd className=\"flex items-center gap-2 font-mono text-xs\">\n {clientSecret && revealed ? (\n <>\n <span>{clientSecret}</span>\n <button\n type=\"button\"\n onClick={() => copy(clientSecret, 'secret')}\n aria-label={tWithFallback(t, 'sandbox.agentApp.copySecret', 'Copy client secret')}\n className=\"text-text-tertiary hover:text-text-secondary\"\n >\n {copied === 'secret' ? <CheckCircle2 size={12} /> : <Copy size={12} />}\n </button>\n <button\n type=\"button\"\n onClick={() => setRevealed(false)}\n className=\"text-text-tertiary hover:text-text-secondary\"\n aria-label={tWithFallback(t, 'sandbox.agentApp.hide', 'Hide')}\n >\n <EyeOff size={12} />\n </button>\n </>\n ) : clientSecret ? (\n <button\n type=\"button\"\n onClick={() => setRevealed(true)}\n className=\"inline-flex items-center gap-1 rounded-md border border-border-subtle px-2 py-0.5 text-text-secondary hover:bg-bg-sunken\"\n >\n <Eye size={12} aria-hidden=\"true\" />\n {tWithFallback(t, 'sandbox.agentApp.secret.revealOnce', 'Reveal once')}\n </button>\n ) : (\n <span className=\"text-text-tertiary\">\n {tWithFallback(\n t,\n 'sandbox.agentApp.secret.hidden',\n 'Hidden — visible only at first creation'\n )}\n </span>\n )}\n </dd>\n </div>\n </dl>\n </section>\n );\n}\n\nfunction Row({\n label,\n value,\n onCopy,\n copied,\n}: {\n label: string;\n value: string;\n onCopy: () => void;\n copied: boolean;\n}) {\n return (\n <div className=\"flex items-center justify-between gap-2\">\n <dt className=\"text-xs text-text-tertiary\">{label}</dt>\n <dd className=\"flex items-center gap-2 font-mono text-xs\">\n <span>{value}</span>\n <button\n type=\"button\"\n onClick={onCopy}\n aria-label={`Copy ${label}`}\n className=\"text-text-tertiary hover:text-text-secondary\"\n >\n {copied ? <CheckCircle2 size={12} /> : <Copy size={12} />}\n </button>\n </dd>\n </div>\n );\n}\n"],"mappings":";;;;;;AAmBA,SAAgB,EAAqB,EAAE,UAAO,aAAU,mBAAuB;CAC7E,IAAM,EAAE,SAAM,GAAS,EACjB,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAQ,KAAa,EAAwB,KAAK;AAEzD,KAAI,CAAC,KAAS,CAAC,EAAU,QAAO;CAEhC,IAAM,KAAQ,GAAe,MAAgB;AAG3C,EAFK,UAAU,UAAU,UAAU,EAAM,EACzC,EAAU,EAAI,EACd,iBAAiB,GAAW,MAAa,MAAY,IAAM,OAAO,EAAS,EAAE,KAAK;;AAGpF,QACE,kBAAC,WAAD;EACE,cAAY,EAAc,GAAG,0BAA0B,8BAA8B;EACrF,WAAU;YAFZ;GAIE,kBAAC,MAAD;IAAI,WAAU;cACX,EAAc,GAAG,0BAA0B,8BAA8B;IACvE,CAAA;GACL,kBAAC,KAAD;IAAG,WAAU;cACV,EACC,GACA,gCACA,qHACD;IACC,CAAA;GACJ,kBAAC,MAAD;IAAI,WAAU;cAAd;KACG,KACC,kBAAC,GAAD;MACE,OAAO,EAAc,GAAG,0BAA0B,SAAS;MAC3D,OAAO;MACP,cAAc,EAAK,GAAO,MAAM;MAChC,QAAQ,MAAW;MACnB,CAAA;KAEH,KACC,kBAAC,GAAD;MACE,OAAO,EAAc,GAAG,6BAA6B,YAAY;MACjE,OAAO;MACP,cAAc,EAAK,GAAU,SAAS;MACtC,QAAQ,MAAW;MACnB,CAAA;KAEJ,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAc,GAAG,iCAAiC,gBAAgB;OAChE,CAAA,EACL,kBAAC,MAAD;OAAI,WAAU;iBACX,KAAgB,IACf,kBAAA,GAAA,EAAA,UAAA;QACE,kBAAC,QAAD,EAAA,UAAO,GAAoB,CAAA;QAC3B,kBAAC,UAAD;SACE,MAAK;SACL,eAAe,EAAK,GAAc,SAAS;SAC3C,cAAY,EAAc,GAAG,+BAA+B,qBAAqB;SACjF,WAAU;mBAEa,EAAtB,MAAW,WAAY,IAA6B,GAA9B,EAAc,MAAM,IAAM,CAAqB;SAC/D,CAAA;QACT,kBAAC,UAAD;SACE,MAAK;SACL,eAAe,EAAY,GAAM;SACjC,WAAU;SACV,cAAY,EAAc,GAAG,yBAAyB,OAAO;mBAE7D,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;SACb,CAAA;QACR,EAAA,CAAA,GACD,IACF,kBAAC,UAAD;QACE,MAAK;QACL,eAAe,EAAY,GAAK;QAChC,WAAU;kBAHZ,CAKE,kBAAC,GAAD;SAAK,MAAM;SAAI,eAAY;SAAS,CAAA,EACnC,EAAc,GAAG,sCAAsC,cAAc,CAC/D;YAET,kBAAC,QAAD;QAAM,WAAU;kBACb,EACC,GACA,kCACA,0CACD;QACI,CAAA;OAEN,CAAA,CACD;;KACH;;GACG;;;AAId,SAAS,EAAI,EACX,UACA,UACA,WACA,aAMC;AACD,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,MAAD;GAAI,WAAU;aAA8B;GAAW,CAAA,EACvD,kBAAC,MAAD;GAAI,WAAU;aAAd,CACE,kBAAC,QAAD,EAAA,UAAO,GAAa,CAAA,EACpB,kBAAC,UAAD;IACE,MAAK;IACL,SAAS;IACT,cAAY,QAAQ;IACpB,WAAU;cAEA,EAAT,IAAU,IAA6B,GAA9B,EAAc,MAAM,IAAM,CAAqB;IAClD,CAAA,CACN;KACD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SandboxTemplateType } from '../types';
|
|
3
|
+
|
|
4
|
+
interface SandboxTypeIconProps {
|
|
5
|
+
type: SandboxTemplateType;
|
|
6
|
+
size?: number;
|
|
7
|
+
className?: string;
|
|
8
|
+
showLabel?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Icon component for sandbox template type with optional label
|
|
12
|
+
*/
|
|
13
|
+
export declare const SandboxTypeIcon: FC<SandboxTypeIconProps>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=SandboxTypeIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SandboxTypeIcon.d.ts","sourceRoot":"","sources":["../../../src/sandbox/components/SandboxTypeIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,UAAU,oBAAoB;IAC5B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAsCD;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAepD,CAAC"}
|