@burdenoff/microfe-sandbox 2026.830.1 → 2026.1013.1
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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -4
- package/dist/sandbox/SandboxAdminRoot.d.ts.map +1 -1
- package/dist/sandbox/SandboxAdminRoot.js +33 -28
- package/dist/sandbox/SandboxAdminRoot.js.map +1 -1
- package/dist/sandbox/SandboxRoot.d.ts.map +1 -1
- package/dist/sandbox/SandboxRoot.js +36 -31
- package/dist/sandbox/SandboxRoot.js.map +1 -1
- package/dist/sandbox/components/ExtendTTLModal.d.ts.map +1 -1
- package/dist/sandbox/components/ExtendTTLModal.js +49 -56
- package/dist/sandbox/components/ExtendTTLModal.js.map +1 -1
- package/dist/sandbox/components/SandboxAgentAppPanel.d.ts.map +1 -1
- package/dist/sandbox/components/SandboxAgentAppPanel.js +40 -38
- package/dist/sandbox/components/SandboxAgentAppPanel.js.map +1 -1
- package/dist/sandbox/components/SandboxTypeIcon.d.ts.map +1 -1
- package/dist/sandbox/components/SandboxTypeIcon.js +30 -22
- package/dist/sandbox/components/SandboxTypeIcon.js.map +1 -1
- package/dist/sandbox/hooks/useTr.d.ts +17 -0
- package/dist/sandbox/hooks/useTr.d.ts.map +1 -0
- package/dist/sandbox/hooks/useTr.js +14 -0
- package/dist/sandbox/hooks/useTr.js.map +1 -0
- package/dist/sandbox/index.d.ts +1 -0
- package/dist/sandbox/index.d.ts.map +1 -1
- package/dist/sandbox/index.js +1 -0
- package/dist/sandbox/pages/SandboxCreatePage.d.ts.map +1 -1
- package/dist/sandbox/pages/SandboxCreatePage.js +466 -465
- package/dist/sandbox/pages/SandboxCreatePage.js.map +1 -1
- package/dist/sandbox/pages/TemplateDetailPage.d.ts.map +1 -1
- package/dist/sandbox/pages/TemplateDetailPage.js +315 -294
- package/dist/sandbox/pages/TemplateDetailPage.js.map +1 -1
- package/dist/sandbox/types/index.d.ts.map +1 -1
- package/dist/translations/en.d.ts +877 -0
- package/dist/translations/en.d.ts.map +1 -0
- package/dist/translations/en.js +753 -0
- package/dist/translations/en.js.map +1 -0
- package/dist/translations/hi.d.ts +4 -0
- package/dist/translations/hi.d.ts.map +1 -0
- package/dist/translations/hi.js +75 -0
- package/dist/translations/hi.js.map +1 -0
- package/dist/translations/index.d.ts +4 -0
- package/dist/translations/index.d.ts.map +1 -0
- package/dist/translations/index.js +3 -0
- package/dist/translations/ta.d.ts +4 -0
- package/dist/translations/ta.d.ts.map +1 -0
- package/dist/translations/ta.js +75 -0
- package/dist/translations/ta.js.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,WAAW,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { useSandbox as e } from "./sandbox/providers/SandboxProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useTr as t } from "./sandbox/hooks/useTr.js";
|
|
3
|
+
import { useSandboxStore as n } from "./sandbox/store/sandboxStore.js";
|
|
4
|
+
import { SandboxRoot as r } from "./sandbox/SandboxRoot.js";
|
|
5
|
+
import { SandboxAdminRoot as i } from "./sandbox/SandboxAdminRoot.js";
|
|
5
6
|
import "./sandbox/index.js";
|
|
6
|
-
|
|
7
|
+
import { enTranslations as a } from "./translations/en.js";
|
|
8
|
+
import { hiTranslations as o } from "./translations/hi.js";
|
|
9
|
+
import { taTranslations as s } from "./translations/ta.js";
|
|
10
|
+
import "./translations/index.js";
|
|
11
|
+
export { i as SandboxAdminRoot, r as SandboxRoot, a as enTranslations, o as hiTranslations, s as taTranslations, e as useSandbox, n as useSandboxStore, t as useTr };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxAdminRoot.d.ts","sourceRoot":"","sources":["../../src/sandbox/SandboxAdminRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKhC,OAAO,KAAK,EAAW,qBAAqB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"SandboxAdminRoot.d.ts","sourceRoot":"","sources":["../../src/sandbox/SandboxAdminRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKhC,OAAO,KAAK,EAAW,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAK9D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAuEtD,CAAC"}
|
|
@@ -1,55 +1,60 @@
|
|
|
1
1
|
import { SandboxProvider as e } from "./providers/SandboxProvider.js";
|
|
2
2
|
import { joinPath as t } from "./utils/navigation.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { useTr as n } from "./hooks/useTr.js";
|
|
4
|
+
import { AdminRoutes as r } from "./AdminRoutes.js";
|
|
5
|
+
import { useEffect as i } from "react";
|
|
6
|
+
import { ErrorBoundary as a } from "@burdenoff/fe-libs/shared/components";
|
|
7
|
+
import { Activity as o, LayoutTemplate as s } from "lucide-react";
|
|
8
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
8
9
|
//#region src/sandbox/SandboxAdminRoot.tsx
|
|
9
|
-
var
|
|
10
|
-
let { registerNavItems:
|
|
11
|
-
return
|
|
12
|
-
if (
|
|
10
|
+
var l = (l) => {
|
|
11
|
+
let { registerNavItems: u, registerFooterItems: d, basePath: f = "/" } = l, p = n();
|
|
12
|
+
return i(() => {
|
|
13
|
+
if (u) return u({
|
|
13
14
|
id: "sandbox",
|
|
14
|
-
label: "Sandbox",
|
|
15
|
-
path:
|
|
16
|
-
icon: /* @__PURE__ */ s
|
|
15
|
+
label: p("sandbox.nav.admin.rootLabel", "Sandbox"),
|
|
16
|
+
path: f,
|
|
17
|
+
icon: /* @__PURE__ */ c(s, { size: 20 }),
|
|
17
18
|
order: 50,
|
|
18
19
|
group: "sandbox",
|
|
19
20
|
children: [{
|
|
20
21
|
id: "sandbox-admin-templates",
|
|
21
|
-
label: "Templates",
|
|
22
|
-
path: t(
|
|
23
|
-
icon: /* @__PURE__ */ s
|
|
22
|
+
label: p("sandbox.nav.admin.templatesLabel", "Templates"),
|
|
23
|
+
path: t(f, "templates"),
|
|
24
|
+
icon: /* @__PURE__ */ c(s, { size: 16 }),
|
|
24
25
|
order: 10
|
|
25
26
|
}, {
|
|
26
27
|
id: "sandbox-admin-dashboard",
|
|
27
|
-
label: "Dashboard",
|
|
28
|
-
path: t(
|
|
29
|
-
icon: /* @__PURE__ */
|
|
28
|
+
label: p("sandbox.nav.admin.dashboardLabel", "Dashboard"),
|
|
29
|
+
path: t(f, "admin"),
|
|
30
|
+
icon: /* @__PURE__ */ c(o, { size: 16 }),
|
|
30
31
|
order: 20
|
|
31
32
|
}]
|
|
32
33
|
});
|
|
33
|
-
}, [
|
|
34
|
-
|
|
34
|
+
}, [
|
|
35
|
+
u,
|
|
36
|
+
f,
|
|
37
|
+
p
|
|
38
|
+
]), i(() => {
|
|
39
|
+
if (d) return d([{
|
|
35
40
|
id: "sandbox-admin-status",
|
|
36
|
-
label: "Sandbox Admin Ready",
|
|
41
|
+
label: p("sandbox.footer.adminStatus", "Sandbox Admin Ready"),
|
|
37
42
|
type: "status",
|
|
38
43
|
order: 50,
|
|
39
44
|
section: "left"
|
|
40
45
|
}]);
|
|
41
|
-
}, [
|
|
42
|
-
fallback: /* @__PURE__ */
|
|
46
|
+
}, [d, p]), /* @__PURE__ */ c(a, {
|
|
47
|
+
fallback: /* @__PURE__ */ c("div", {
|
|
43
48
|
className: "p-6 text-center text-text-secondary",
|
|
44
|
-
children: "Something went wrong loading this module. Please refresh the page."
|
|
49
|
+
children: p("sandbox.error.moduleLoad", "Something went wrong loading this module. Please refresh the page.")
|
|
45
50
|
}),
|
|
46
|
-
children: /* @__PURE__ */
|
|
47
|
-
...
|
|
48
|
-
children: /* @__PURE__ */
|
|
51
|
+
children: /* @__PURE__ */ c(e, {
|
|
52
|
+
...l,
|
|
53
|
+
children: /* @__PURE__ */ c(r, {})
|
|
49
54
|
})
|
|
50
55
|
});
|
|
51
56
|
};
|
|
52
57
|
//#endregion
|
|
53
|
-
export {
|
|
58
|
+
export { l as SandboxAdminRoot };
|
|
54
59
|
|
|
55
60
|
//# sourceMappingURL=SandboxAdminRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxAdminRoot.js","names":[],"sources":["../../src/sandbox/SandboxAdminRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { LayoutTemplate, Activity } from 'lucide-react';\nimport { SandboxProvider } from './providers/SandboxProvider';\nimport type { NavItem, SandboxAdminRootProps } from './types';\nimport { joinPath } from './utils/navigation';\nimport { AdminRoutes } from './AdminRoutes';\n\n/**\n * Admin root component for the Sandbox microfrontend.\n *\n * This is the entry point for admin-facing app shells (e.g., admin-app).\n * It renders only admin routes (template management, dashboard) and\n * registers admin-specific navigation items.\n *\n * @example\n * ```tsx\n * import { SandboxAdminRoot } from '@burdenoff/micro-fe/sandbox';\n *\n * function AdminApp() {\n * return <SandboxAdminRoot basePath=\"/sandbox\" {...globalBaseProps} />;\n * }\n * ```\n */\nexport const SandboxAdminRoot: FC<SandboxAdminRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n\n // Register admin navigation items with the shell\n useEffect(() => {\n if (!registerNavItems) return;\n\n const sandboxNavItem: NavItem = {\n id: 'sandbox',\n label: 'Sandbox',\n path: basePath,\n icon: <LayoutTemplate size={20} />,\n order: 50,\n group: 'sandbox',\n children: [\n {\n id: 'sandbox-admin-templates',\n label: 'Templates',\n path: joinPath(basePath, 'templates'),\n icon: <LayoutTemplate size={16} />,\n order: 10,\n },\n {\n id: 'sandbox-admin-dashboard',\n label: 'Dashboard',\n path: joinPath(basePath, 'admin'),\n icon: <Activity size={16} />,\n order: 20,\n },\n ],\n };\n\n const cleanup = registerNavItems(sandboxNavItem);\n return cleanup;\n }, [registerNavItems, basePath]);\n\n // Register footer items\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'sandbox-admin-status',\n label: 'Sandbox Admin Ready',\n type: 'status' as const,\n order: 50,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems]);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n Something went wrong loading this module. Please refresh the page
|
|
1
|
+
{"version":3,"file":"SandboxAdminRoot.js","names":[],"sources":["../../src/sandbox/SandboxAdminRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { LayoutTemplate, Activity } from 'lucide-react';\nimport { SandboxProvider } from './providers/SandboxProvider';\nimport type { NavItem, SandboxAdminRootProps } from './types';\nimport { joinPath } from './utils/navigation';\nimport { AdminRoutes } from './AdminRoutes';\nimport { useTr } from './hooks/useTr';\n\n/**\n * Admin root component for the Sandbox microfrontend.\n *\n * This is the entry point for admin-facing app shells (e.g., admin-app).\n * It renders only admin routes (template management, dashboard) and\n * registers admin-specific navigation items.\n *\n * @example\n * ```tsx\n * import { SandboxAdminRoot } from '@burdenoff/micro-fe/sandbox';\n *\n * function AdminApp() {\n * return <SandboxAdminRoot basePath=\"/sandbox\" {...globalBaseProps} />;\n * }\n * ```\n */\nexport const SandboxAdminRoot: FC<SandboxAdminRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const tr = useTr();\n\n // Register admin navigation items with the shell\n useEffect(() => {\n if (!registerNavItems) return;\n\n const sandboxNavItem: NavItem = {\n id: 'sandbox',\n label: tr('sandbox.nav.admin.rootLabel', 'Sandbox'),\n path: basePath,\n icon: <LayoutTemplate size={20} />,\n order: 50,\n group: 'sandbox',\n children: [\n {\n id: 'sandbox-admin-templates',\n label: tr('sandbox.nav.admin.templatesLabel', 'Templates'),\n path: joinPath(basePath, 'templates'),\n icon: <LayoutTemplate size={16} />,\n order: 10,\n },\n {\n id: 'sandbox-admin-dashboard',\n label: tr('sandbox.nav.admin.dashboardLabel', 'Dashboard'),\n path: joinPath(basePath, 'admin'),\n icon: <Activity size={16} />,\n order: 20,\n },\n ],\n };\n\n const cleanup = registerNavItems(sandboxNavItem);\n return cleanup;\n }, [registerNavItems, basePath, tr]);\n\n // Register footer items\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'sandbox-admin-status',\n label: tr('sandbox.footer.adminStatus', 'Sandbox Admin Ready'),\n type: 'status' as const,\n order: 50,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems, tr]);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n 'sandbox.error.moduleLoad',\n 'Something went wrong loading this module. Please refresh the page.'\n )}\n </div>\n }\n >\n <SandboxProvider {...props}>\n <AdminRoutes />\n </SandboxProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;;AA0BA,IAAa,KAA+C,MAAU;CACpE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,IAAK,GAAO;AAqDlB,QAlDA,QAAgB;AACT,QA4BL,QADgB,EAzBgB;GAC9B,IAAI;GACJ,OAAO,EAAG,+BAA+B,UAAU;GACnD,MAAM;GACN,MAAM,kBAAC,GAAD,EAAgB,MAAM,IAAM,CAAA;GAClC,OAAO;GACP,OAAO;GACP,UAAU,CACR;IACE,IAAI;IACJ,OAAO,EAAG,oCAAoC,YAAY;IAC1D,MAAM,EAAS,GAAU,YAAY;IACrC,MAAM,kBAAC,GAAD,EAAgB,MAAM,IAAM,CAAA;IAClC,OAAO;IACR,EACD;IACE,IAAI;IACJ,OAAO,EAAG,oCAAoC,YAAY;IAC1D,MAAM,EAAS,GAAU,QAAQ;IACjC,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;IAC5B,OAAO;IACR,CACF;GACF,CAE+C;IAE/C;EAAC;EAAkB;EAAU;EAAG,CAAC,EAGpC,QAAgB;AACT,QAaL,QADgB,EAVI,CAClB;GACE,IAAI;GACJ,OAAO,EAAG,8BAA8B,sBAAsB;GAC9D,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAE/C,CAAC,GAAqB,EAAG,CAAC,EAG3B,kBAAC,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;aACZ,EACC,4BACA,qEACD;GACG,CAAA;YAGR,kBAAC,GAAD;GAAiB,GAAI;aACnB,kBAAC,GAAD,EAAe,CAAA;GACC,CAAA;EACJ,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxRoot.d.ts","sourceRoot":"","sources":["../../src/sandbox/SandboxRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,KAAK,EAAW,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"SandboxRoot.d.ts","sourceRoot":"","sources":["../../src/sandbox/SandboxRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,KAAK,EAAW,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAKzD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA6E5C,CAAC"}
|
|
@@ -1,61 +1,66 @@
|
|
|
1
1
|
import { SandboxProvider as e } from "./providers/SandboxProvider.js";
|
|
2
2
|
import { joinPath as t } from "./utils/navigation.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { useTr as n } from "./hooks/useTr.js";
|
|
4
|
+
import { UserRoutes as r } from "./UserRoutes.js";
|
|
5
|
+
import { useEffect as i } from "react";
|
|
6
|
+
import { ErrorBoundary as a } from "@burdenoff/fe-libs/shared/components";
|
|
7
|
+
import { Box as o, LayoutTemplate as s } from "lucide-react";
|
|
8
|
+
import { FeatureFlagProvider as c } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
9
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
9
10
|
//#region src/sandbox/SandboxRoot.tsx
|
|
10
|
-
var
|
|
11
|
-
let { registerNavItems:
|
|
12
|
-
return
|
|
13
|
-
if (
|
|
11
|
+
var u = (u) => {
|
|
12
|
+
let { registerNavItems: d, registerFooterItems: f, basePath: p = "/" } = u, m = n();
|
|
13
|
+
return i(() => {
|
|
14
|
+
if (d) return d({
|
|
14
15
|
id: "sandbox",
|
|
15
|
-
label: "Sandbox",
|
|
16
|
-
path:
|
|
17
|
-
icon: /* @__PURE__ */
|
|
16
|
+
label: m("sandbox.nav.rootLabel", "Sandbox"),
|
|
17
|
+
path: p,
|
|
18
|
+
icon: /* @__PURE__ */ l(o, { size: 20 }),
|
|
18
19
|
order: 50,
|
|
19
20
|
group: "sandbox",
|
|
20
21
|
children: [{
|
|
21
22
|
id: "sandbox-all",
|
|
22
|
-
label: "Sandboxes",
|
|
23
|
-
path:
|
|
24
|
-
icon: /* @__PURE__ */
|
|
23
|
+
label: m("sandbox.nav.sandboxesLabel", "Sandboxes"),
|
|
24
|
+
path: p,
|
|
25
|
+
icon: /* @__PURE__ */ l(o, { size: 16 }),
|
|
25
26
|
order: 10
|
|
26
27
|
}, {
|
|
27
28
|
id: "sandbox-templates",
|
|
28
|
-
label: "Templates",
|
|
29
|
-
path: t(
|
|
30
|
-
icon: /* @__PURE__ */
|
|
29
|
+
label: m("sandbox.nav.templatesLabel", "Templates"),
|
|
30
|
+
path: t(p, "templates"),
|
|
31
|
+
icon: /* @__PURE__ */ l(s, { size: 16 }),
|
|
31
32
|
order: 20
|
|
32
33
|
}]
|
|
33
34
|
});
|
|
34
|
-
}, [
|
|
35
|
-
|
|
35
|
+
}, [
|
|
36
|
+
d,
|
|
37
|
+
p,
|
|
38
|
+
m
|
|
39
|
+
]), i(() => {
|
|
40
|
+
if (f) return f([{
|
|
36
41
|
id: "sandbox-status",
|
|
37
|
-
label: "Sandbox Ready",
|
|
42
|
+
label: m("sandbox.footer.status", "Sandbox Ready"),
|
|
38
43
|
type: "status",
|
|
39
44
|
order: 50,
|
|
40
45
|
section: "left"
|
|
41
46
|
}]);
|
|
42
|
-
}, [
|
|
43
|
-
fallback: /* @__PURE__ */
|
|
47
|
+
}, [f, m]), /* @__PURE__ */ l(a, {
|
|
48
|
+
fallback: /* @__PURE__ */ l("div", {
|
|
44
49
|
className: "p-6 text-center text-text-secondary",
|
|
45
|
-
children: "Something went wrong loading this module. Please refresh the page."
|
|
50
|
+
children: m("sandbox.error.moduleLoad", "Something went wrong loading this module. Please refresh the page.")
|
|
46
51
|
}),
|
|
47
|
-
children: /* @__PURE__ */ c
|
|
48
|
-
workspaceId:
|
|
52
|
+
children: /* @__PURE__ */ l(c, {
|
|
53
|
+
workspaceId: u.workspaceId ?? null,
|
|
49
54
|
gateway: "global",
|
|
50
55
|
defaultEnabled: !0,
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
...
|
|
53
|
-
children: /* @__PURE__ */
|
|
56
|
+
children: /* @__PURE__ */ l(e, {
|
|
57
|
+
...u,
|
|
58
|
+
children: /* @__PURE__ */ l(r, {})
|
|
54
59
|
})
|
|
55
60
|
})
|
|
56
61
|
});
|
|
57
62
|
};
|
|
58
63
|
//#endregion
|
|
59
|
-
export {
|
|
64
|
+
export { u as SandboxRoot };
|
|
60
65
|
|
|
61
66
|
//# sourceMappingURL=SandboxRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxRoot.js","names":[],"sources":["../../src/sandbox/SandboxRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { Box, LayoutTemplate } from 'lucide-react';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { SandboxProvider } from './providers/SandboxProvider';\nimport type { NavItem, SandboxRootProps } from './types';\nimport { joinPath } from './utils/navigation';\nimport { UserRoutes } from './UserRoutes';\n\n/**\n * Root component for the Sandbox microfrontend.\n *\n * This is the main entry point that user-facing host applications import and render.\n * It sets up the necessary providers and renders user-only routing.\n * For admin-facing apps, use SandboxAdminRoot instead.\n *\n * @example\n * ```tsx\n * import { SandboxRoot, type SandboxRootProps } from '@burdenoff/micro-fe/sandbox';\n *\n * function App() {\n * const props: SandboxRootProps = {\n * basePath: '/sandbox',\n * navigate: (path) => router.push(path),\n * currentUser: { id: '1', email: 'user@example.com', firstName: 'John', lastName: 'Doe' },\n * workspaceId: 'ws-123',\n * apiGatewayUrl: 'https://api.example.com',\n * authToken: 'token',\n * registerNavItems: (items) => { return () => {}; },\n * };\n *\n * return <SandboxRoot {...props} />;\n * }\n * ```\n */\nexport const SandboxRoot: FC<SandboxRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n\n // Register navigation items with the shell\n useEffect(() => {\n if (!registerNavItems) return;\n\n const sandboxNavItem: NavItem = {\n id: 'sandbox',\n label: 'Sandbox',\n path: basePath,\n icon: <Box size={20} />,\n order: 50,\n group: 'sandbox',\n children: [\n {\n id: 'sandbox-all',\n label: 'Sandboxes',\n path: basePath,\n icon: <Box size={16} />,\n order: 10,\n },\n {\n id: 'sandbox-templates',\n label: 'Templates',\n path: joinPath(basePath, 'templates'),\n icon: <LayoutTemplate size={16} />,\n order: 20,\n },\n ],\n };\n\n const cleanup = registerNavItems(sandboxNavItem);\n return cleanup;\n }, [registerNavItems, basePath]);\n\n // Register footer items\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'sandbox-status',\n label: 'Sandbox Ready',\n type: 'status' as const,\n order: 50,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems]);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n Something went wrong loading this module. Please refresh the page
|
|
1
|
+
{"version":3,"file":"SandboxRoot.js","names":[],"sources":["../../src/sandbox/SandboxRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { Box, LayoutTemplate } from 'lucide-react';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { SandboxProvider } from './providers/SandboxProvider';\nimport type { NavItem, SandboxRootProps } from './types';\nimport { joinPath } from './utils/navigation';\nimport { UserRoutes } from './UserRoutes';\nimport { useTr } from './hooks/useTr';\n\n/**\n * Root component for the Sandbox microfrontend.\n *\n * This is the main entry point that user-facing host applications import and render.\n * It sets up the necessary providers and renders user-only routing.\n * For admin-facing apps, use SandboxAdminRoot instead.\n *\n * @example\n * ```tsx\n * import { SandboxRoot, type SandboxRootProps } from '@burdenoff/micro-fe/sandbox';\n *\n * function App() {\n * const props: SandboxRootProps = {\n * basePath: '/sandbox',\n * navigate: (path) => router.push(path),\n * currentUser: { id: '1', email: 'user@example.com', firstName: 'John', lastName: 'Doe' },\n * workspaceId: 'ws-123',\n * apiGatewayUrl: 'https://api.example.com',\n * authToken: 'token',\n * registerNavItems: (items) => { return () => {}; },\n * };\n *\n * return <SandboxRoot {...props} />;\n * }\n * ```\n */\nexport const SandboxRoot: FC<SandboxRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const tr = useTr();\n\n // Register navigation items with the shell\n useEffect(() => {\n if (!registerNavItems) return;\n\n const sandboxNavItem: NavItem = {\n id: 'sandbox',\n label: tr('sandbox.nav.rootLabel', 'Sandbox'),\n path: basePath,\n icon: <Box size={20} />,\n order: 50,\n group: 'sandbox',\n children: [\n {\n id: 'sandbox-all',\n label: tr('sandbox.nav.sandboxesLabel', 'Sandboxes'),\n path: basePath,\n icon: <Box size={16} />,\n order: 10,\n },\n {\n id: 'sandbox-templates',\n label: tr('sandbox.nav.templatesLabel', 'Templates'),\n path: joinPath(basePath, 'templates'),\n icon: <LayoutTemplate size={16} />,\n order: 20,\n },\n ],\n };\n\n const cleanup = registerNavItems(sandboxNavItem);\n return cleanup;\n }, [registerNavItems, basePath, tr]);\n\n // Register footer items\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'sandbox-status',\n label: tr('sandbox.footer.status', 'Sandbox Ready'),\n type: 'status' as const,\n order: 50,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems, tr]);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n 'sandbox.error.moduleLoad',\n 'Something went wrong loading this module. Please refresh the page.'\n )}\n </div>\n }\n >\n <FeatureFlagProvider\n workspaceId={props.workspaceId ?? null}\n gateway=\"global\"\n defaultEnabled={true}\n >\n <SandboxProvider {...props}>\n <UserRoutes />\n </SandboxProvider>\n </FeatureFlagProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;;;AAqCA,IAAa,KAAqC,MAAU;CAC1D,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,IAAK,GAAO;AAqDlB,QAlDA,QAAgB;AACT,QA4BL,QADgB,EAzBgB;GAC9B,IAAI;GACJ,OAAO,EAAG,yBAAyB,UAAU;GAC7C,MAAM;GACN,MAAM,kBAAC,GAAD,EAAK,MAAM,IAAM,CAAA;GACvB,OAAO;GACP,OAAO;GACP,UAAU,CACR;IACE,IAAI;IACJ,OAAO,EAAG,8BAA8B,YAAY;IACpD,MAAM;IACN,MAAM,kBAAC,GAAD,EAAK,MAAM,IAAM,CAAA;IACvB,OAAO;IACR,EACD;IACE,IAAI;IACJ,OAAO,EAAG,8BAA8B,YAAY;IACpD,MAAM,EAAS,GAAU,YAAY;IACrC,MAAM,kBAAC,GAAD,EAAgB,MAAM,IAAM,CAAA;IAClC,OAAO;IACR,CACF;GACF,CAE+C;IAE/C;EAAC;EAAkB;EAAU;EAAG,CAAC,EAGpC,QAAgB;AACT,QAaL,QADgB,EAVI,CAClB;GACE,IAAI;GACJ,OAAO,EAAG,yBAAyB,gBAAgB;GACnD,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAE/C,CAAC,GAAqB,EAAG,CAAC,EAG3B,kBAAC,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;aACZ,EACC,4BACA,qEACD;GACG,CAAA;YAGR,kBAAC,GAAD;GACE,aAAa,EAAM,eAAe;GAClC,SAAQ;GACR,gBAAgB;aAEhB,kBAAC,GAAD;IAAiB,GAAI;cACnB,kBAAC,GAAD,EAAc,CAAA;IACE,CAAA;GACE,CAAA;EACR,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtendTTLModal.d.ts","sourceRoot":"","sources":["../../../src/sandbox/components/ExtendTTLModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExtendTTLModal.d.ts","sourceRoot":"","sources":["../../../src/sandbox/components/ExtendTTLModal.tsx"],"names":[],"mappings":"AAYA,UAAU,mBAAmB;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,iBAAiB,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,SAAS,GACV,EAAE,mBAAmB,sCA+HrB"}
|
|
@@ -1,102 +1,95 @@
|
|
|
1
1
|
import { Button as e } from "./ui.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { useTr as t } from "../hooks/useTr.js";
|
|
3
|
+
import { useState as n } from "react";
|
|
4
|
+
import { Clock as r } from "lucide-react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { ResponsiveDialog as o, ResponsiveDialogContent as s, ResponsiveDialogFooter as c, ResponsiveDialogHeader as l, ResponsiveDialogTitle as u } from "@burdenoff/fe-libs/ui";
|
|
6
7
|
//#region src/sandbox/components/ExtendTTLModal.tsx
|
|
7
|
-
var u = [
|
|
8
|
-
{
|
|
9
|
-
label: "15 minutes",
|
|
10
|
-
seconds: 900
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
label: "30 minutes",
|
|
14
|
-
seconds: 1800
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
label: "1 hour",
|
|
18
|
-
seconds: 3600
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
label: "2 hours",
|
|
22
|
-
seconds: 7200
|
|
23
|
-
}
|
|
24
|
-
];
|
|
25
8
|
function d({ isOpen: d, onClose: f, onExtend: p, currentExpiresAt: m, isLoading: h }) {
|
|
26
|
-
let
|
|
9
|
+
let g = t(), [_, v] = n(null), [y, b] = n(""), x = [
|
|
10
|
+
{
|
|
11
|
+
label: g("sandbox.extendDialog.preset.15min", "15 minutes"),
|
|
12
|
+
seconds: 900
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
label: g("sandbox.extendDialog.preset.30min", "30 minutes"),
|
|
16
|
+
seconds: 1800
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: g("sandbox.extendDialog.preset.1hour", "1 hour"),
|
|
20
|
+
seconds: 3600
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: g("sandbox.extendDialog.preset.2hours", "2 hours"),
|
|
24
|
+
seconds: 7200
|
|
25
|
+
}
|
|
26
|
+
];
|
|
27
27
|
if (!d) return null;
|
|
28
|
-
let
|
|
29
|
-
return /* @__PURE__ */
|
|
28
|
+
let S = new Date(m).getTime() - Date.now(), C = Math.max(0, Math.floor(S / 6e4));
|
|
29
|
+
return /* @__PURE__ */ i(o, {
|
|
30
30
|
open: d,
|
|
31
31
|
onOpenChange: (e) => {
|
|
32
32
|
e || f();
|
|
33
33
|
},
|
|
34
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ a(s, {
|
|
35
35
|
className: "max-w-md",
|
|
36
36
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ i(l, { children: /* @__PURE__ */ a(u, {
|
|
38
38
|
className: "flex items-center gap-2",
|
|
39
|
-
children: [/* @__PURE__ */ r
|
|
39
|
+
children: [/* @__PURE__ */ i(r, { className: "size-5 text-accent-blue" }), g("sandbox.extendDialog.new.title", "Extend Sandbox Duration")]
|
|
40
40
|
}) }),
|
|
41
41
|
/* @__PURE__ */ i("p", {
|
|
42
42
|
className: "text-sm text-text-secondary mb-4",
|
|
43
|
-
children:
|
|
44
|
-
"Current remaining time:",
|
|
45
|
-
" ",
|
|
46
|
-
/* @__PURE__ */ i("span", {
|
|
47
|
-
className: "font-medium tabular-nums",
|
|
48
|
-
children: [x, " minutes"]
|
|
49
|
-
})
|
|
50
|
-
]
|
|
43
|
+
children: g("sandbox.extendDialog.currentRemaining", "Current remaining time: {{count}} minutes", { count: C })
|
|
51
44
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ i("div", {
|
|
53
46
|
className: "space-y-2 mb-4",
|
|
54
|
-
children:
|
|
47
|
+
children: x.map((e, t) => /* @__PURE__ */ a("button", {
|
|
55
48
|
type: "button",
|
|
56
49
|
onClick: () => {
|
|
57
|
-
|
|
50
|
+
v(t), b("");
|
|
58
51
|
},
|
|
59
|
-
className: `w-full rounded-lg border px-4 py-2.5 text-left text-sm font-medium transition-colors ${
|
|
52
|
+
className: `w-full rounded-lg border px-4 py-2.5 text-left text-sm font-medium transition-colors ${_ === t ? "border-primary bg-status-info-bg-subtle text-status-info-text" : "border-border-subtle hover:bg-bg-sunken text-text-secondary"}`,
|
|
60
53
|
children: ["+ ", e.label]
|
|
61
54
|
}, e.seconds))
|
|
62
55
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ a("div", {
|
|
64
57
|
className: "mb-2",
|
|
65
|
-
children: [/* @__PURE__ */
|
|
58
|
+
children: [/* @__PURE__ */ i("label", {
|
|
66
59
|
htmlFor: "extend-ttl-custom-minutes",
|
|
67
60
|
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
68
|
-
children: "Custom duration (minutes)"
|
|
69
|
-
}), /* @__PURE__ */
|
|
61
|
+
children: g("sandbox.extendDialog.customLabel", "Custom duration (minutes)")
|
|
62
|
+
}), /* @__PURE__ */ i("input", {
|
|
70
63
|
id: "extend-ttl-custom-minutes",
|
|
71
64
|
type: "number",
|
|
72
65
|
min: "1",
|
|
73
66
|
max: "1440",
|
|
74
|
-
value:
|
|
67
|
+
value: y,
|
|
75
68
|
onChange: (e) => {
|
|
76
|
-
|
|
69
|
+
b(e.target.value), v(null);
|
|
77
70
|
},
|
|
78
|
-
placeholder: "Enter minutes",
|
|
79
|
-
"aria-label": "Custom duration in minutes",
|
|
71
|
+
placeholder: g("sandbox.extendDialog.customPlaceholder", "Enter minutes"),
|
|
72
|
+
"aria-label": g("sandbox.extendDialog.customAriaLabel", "Custom duration in minutes"),
|
|
80
73
|
className: "w-full rounded-lg border border-border-subtle px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary"
|
|
81
74
|
})]
|
|
82
75
|
}),
|
|
83
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ a(c, { children: [/* @__PURE__ */ i(e, {
|
|
84
77
|
variant: "outline",
|
|
85
78
|
onClick: f,
|
|
86
79
|
className: "flex-1",
|
|
87
|
-
children: "Cancel"
|
|
88
|
-
}), /* @__PURE__ */
|
|
80
|
+
children: g("sandbox.extendDialog.cancel", "Cancel")
|
|
81
|
+
}), /* @__PURE__ */ i(e, {
|
|
89
82
|
onClick: () => {
|
|
90
83
|
let e;
|
|
91
|
-
if (
|
|
92
|
-
else if (
|
|
93
|
-
if (e = parseInt(
|
|
84
|
+
if (_ !== null) e = x[_].seconds;
|
|
85
|
+
else if (y) {
|
|
86
|
+
if (e = parseInt(y, 10) * 60, isNaN(e) || e <= 0) return;
|
|
94
87
|
} else return;
|
|
95
88
|
p(e);
|
|
96
89
|
},
|
|
97
|
-
disabled: h ||
|
|
90
|
+
disabled: h || _ === null && !y,
|
|
98
91
|
className: "flex-1",
|
|
99
|
-
children: h ? "Extending..." : "Extend"
|
|
92
|
+
children: h ? g("sandbox.extendDialog.extending", "Extending...") : g("sandbox.extendDialog.submit", "Extend")
|
|
100
93
|
})] })
|
|
101
94
|
]
|
|
102
95
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtendTTLModal.js","names":[],"sources":["../../../src/sandbox/components/ExtendTTLModal.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Clock } from 'lucide-react';\nimport {\n ResponsiveDialog,\n ResponsiveDialogContent,\n ResponsiveDialogHeader,\n ResponsiveDialogTitle,\n ResponsiveDialogFooter,\n} from '@burdenoff/fe-libs/ui';\nimport { Button } from './ui';\n\ninterface ExtendTTLModalProps {\n isOpen: boolean;\n onClose: () => void;\n onExtend: (additionalSeconds: number) => void;\n currentExpiresAt: string;\n isLoading?: boolean;\n}\n\
|
|
1
|
+
{"version":3,"file":"ExtendTTLModal.js","names":[],"sources":["../../../src/sandbox/components/ExtendTTLModal.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Clock } from 'lucide-react';\nimport {\n ResponsiveDialog,\n ResponsiveDialogContent,\n ResponsiveDialogHeader,\n ResponsiveDialogTitle,\n ResponsiveDialogFooter,\n} from '@burdenoff/fe-libs/ui';\nimport { Button } from './ui';\nimport { useTr } from '../hooks/useTr';\n\ninterface ExtendTTLModalProps {\n isOpen: boolean;\n onClose: () => void;\n onExtend: (additionalSeconds: number) => void;\n currentExpiresAt: string;\n isLoading?: boolean;\n}\n\nexport function ExtendTTLModal({\n isOpen,\n onClose,\n onExtend,\n currentExpiresAt,\n isLoading,\n}: ExtendTTLModalProps) {\n const tr = useTr();\n const [selectedPreset, setSelectedPreset] = useState<number | null>(null);\n const [customMinutes, setCustomMinutes] = useState('');\n\n const presetDurations = [\n {\n label: tr('sandbox.extendDialog.preset.15min', '15 minutes'),\n seconds: 15 * 60,\n },\n {\n label: tr('sandbox.extendDialog.preset.30min', '30 minutes'),\n seconds: 30 * 60,\n },\n {\n label: tr('sandbox.extendDialog.preset.1hour', '1 hour'),\n seconds: 60 * 60,\n },\n {\n label: tr('sandbox.extendDialog.preset.2hours', '2 hours'),\n seconds: 2 * 60 * 60,\n },\n ];\n\n if (!isOpen) return null;\n\n const remainingMs = new Date(currentExpiresAt).getTime() - Date.now();\n const remainingMinutes = Math.max(0, Math.floor(remainingMs / 60000));\n\n const handleExtend = () => {\n let seconds: number;\n if (selectedPreset !== null) {\n seconds = presetDurations[selectedPreset].seconds;\n } else if (customMinutes) {\n seconds = parseInt(customMinutes, 10) * 60;\n if (isNaN(seconds) || seconds <= 0) return;\n } else {\n return;\n }\n onExtend(seconds);\n };\n\n return (\n <ResponsiveDialog\n open={isOpen}\n onOpenChange={(open) => {\n if (!open) onClose();\n }}\n >\n <ResponsiveDialogContent className=\"max-w-md\">\n <ResponsiveDialogHeader>\n <ResponsiveDialogTitle className=\"flex items-center gap-2\">\n <Clock className=\"size-5 text-accent-blue\" />\n {tr('sandbox.extendDialog.new.title', 'Extend Sandbox Duration')}\n </ResponsiveDialogTitle>\n </ResponsiveDialogHeader>\n\n <p className=\"text-sm text-text-secondary mb-4\">\n {tr(\n 'sandbox.extendDialog.currentRemaining',\n 'Current remaining time: {{count}} minutes',\n {\n count: remainingMinutes,\n }\n )}\n </p>\n\n <div className=\"space-y-2 mb-4\">\n {presetDurations.map((preset, i) => (\n <button\n key={preset.seconds}\n type=\"button\"\n onClick={() => {\n setSelectedPreset(i);\n setCustomMinutes('');\n }}\n className={`w-full rounded-lg border px-4 py-2.5 text-left text-sm font-medium transition-colors ${\n selectedPreset === i\n ? 'border-primary bg-status-info-bg-subtle text-status-info-text'\n : 'border-border-subtle hover:bg-bg-sunken text-text-secondary'\n }`}\n >\n + {preset.label}\n </button>\n ))}\n </div>\n\n <div className=\"mb-2\">\n <label\n htmlFor=\"extend-ttl-custom-minutes\"\n className=\"block text-sm font-medium text-text-secondary mb-1\"\n >\n {tr('sandbox.extendDialog.customLabel', 'Custom duration (minutes)')}\n </label>\n <input\n id=\"extend-ttl-custom-minutes\"\n type=\"number\"\n min=\"1\"\n max=\"1440\"\n value={customMinutes}\n onChange={(e) => {\n setCustomMinutes(e.target.value);\n setSelectedPreset(null);\n }}\n placeholder={tr('sandbox.extendDialog.customPlaceholder', 'Enter minutes')}\n aria-label={tr('sandbox.extendDialog.customAriaLabel', 'Custom duration in minutes')}\n className=\"w-full rounded-lg border border-border-subtle px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary\"\n />\n </div>\n\n <ResponsiveDialogFooter>\n <Button variant=\"outline\" onClick={onClose} className=\"flex-1\">\n {tr('sandbox.extendDialog.cancel', 'Cancel')}\n </Button>\n <Button\n onClick={handleExtend}\n disabled={isLoading || (selectedPreset === null && !customMinutes)}\n className=\"flex-1\"\n >\n {isLoading\n ? tr('sandbox.extendDialog.extending', 'Extending...')\n : tr('sandbox.extendDialog.submit', 'Extend')}\n </Button>\n </ResponsiveDialogFooter>\n </ResponsiveDialogContent>\n </ResponsiveDialog>\n );\n}\n"],"mappings":";;;;;;;AAoBA,SAAgB,EAAe,EAC7B,WACA,YACA,aACA,qBACA,gBACsB;CACtB,IAAM,IAAK,GAAO,EACZ,CAAC,GAAgB,KAAqB,EAAwB,KAAK,EACnE,CAAC,GAAe,KAAoB,EAAS,GAAG,EAEhD,IAAkB;EACtB;GACE,OAAO,EAAG,qCAAqC,aAAa;GAC5D,SAAS;GACV;EACD;GACE,OAAO,EAAG,qCAAqC,aAAa;GAC5D,SAAS;GACV;EACD;GACE,OAAO,EAAG,qCAAqC,SAAS;GACxD,SAAS;GACV;EACD;GACE,OAAO,EAAG,sCAAsC,UAAU;GAC1D,SAAS;GACV;EACF;AAED,KAAI,CAAC,EAAQ,QAAO;CAEpB,IAAM,IAAc,IAAI,KAAK,EAAiB,CAAC,SAAS,GAAG,KAAK,KAAK,EAC/D,IAAmB,KAAK,IAAI,GAAG,KAAK,MAAM,IAAc,IAAM,CAAC;AAerE,QACE,kBAAC,GAAD;EACE,MAAM;EACN,eAAe,MAAS;AACtB,GAAK,KAAM,GAAS;;YAGtB,kBAAC,GAAD;GAAyB,WAAU;aAAnC;IACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;KAAuB,WAAU;eAAjC,CACE,kBAAC,GAAD,EAAO,WAAU,2BAA4B,CAAA,EAC5C,EAAG,kCAAkC,0BAA0B,CAC1C;QACD,CAAA;IAEzB,kBAAC,KAAD;KAAG,WAAU;eACV,EACC,yCACA,6CACA,EACE,OAAO,GACR,CACF;KACC,CAAA;IAEJ,kBAAC,OAAD;KAAK,WAAU;eACZ,EAAgB,KAAK,GAAQ,MAC5B,kBAAC,UAAD;MAEE,MAAK;MACL,eAAe;AAEb,OADA,EAAkB,EAAE,EACpB,EAAiB,GAAG;;MAEtB,WAAW,wFACT,MAAmB,IACf,kEACA;gBAVR,CAYC,MACI,EAAO,MACH;QAbF,EAAO,QAaL,CACT;KACE,CAAA;IAEN,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,SAAD;MACE,SAAQ;MACR,WAAU;gBAET,EAAG,oCAAoC,4BAA4B;MAC9D,CAAA,EACR,kBAAC,SAAD;MACE,IAAG;MACH,MAAK;MACL,KAAI;MACJ,KAAI;MACJ,OAAO;MACP,WAAW,MAAM;AAEf,OADA,EAAiB,EAAE,OAAO,MAAM,EAChC,EAAkB,KAAK;;MAEzB,aAAa,EAAG,0CAA0C,gBAAgB;MAC1E,cAAY,EAAG,wCAAwC,6BAA6B;MACpF,WAAU;MACV,CAAA,CACE;;IAEN,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;KAAQ,SAAQ;KAAU,SAAS;KAAS,WAAU;eACnD,EAAG,+BAA+B,SAAS;KACrC,CAAA,EACT,kBAAC,GAAD;KACE,eAtFiB;MACzB,IAAI;AACJ,UAAI,MAAmB,KACrB,KAAU,EAAgB,GAAgB;eACjC,GAET;WADA,IAAU,SAAS,GAAe,GAAG,GAAG,IACpC,MAAM,EAAQ,IAAI,KAAW,EAAG;YAEpC;AAEF,QAAS,EAAQ;;KA6ET,UAAU,KAAc,MAAmB,QAAQ,CAAC;KACpD,WAAU;eAET,IACG,EAAG,kCAAkC,eAAe,GACpD,EAAG,+BAA+B,SAAS;KACxC,CAAA,CACc,EAAA,CAAA;IACD;;EACT,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxAgentAppPanel.d.ts","sourceRoot":"","sources":["../../../src/sandbox/components/SandboxAgentAppPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SandboxAgentAppPanel.d.ts","sourceRoot":"","sources":["../../../src/sandbox/components/SandboxAgentAppPanel.tsx"],"names":[],"mappings":"AAMA,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,sCA6F5E"}
|
|
@@ -1,74 +1,75 @@
|
|
|
1
1
|
import { tWithFallback as e } from "../utils/i18n.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { useTr as t } from "../hooks/useTr.js";
|
|
3
|
+
import { useState as n } from "react";
|
|
4
|
+
import { CheckCircle2 as r, Copy as i, Eye as a, EyeOff as o } from "lucide-react";
|
|
5
|
+
import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
6
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
7
|
//#region src/sandbox/components/SandboxAgentAppPanel.tsx
|
|
7
|
-
function
|
|
8
|
-
let { t: m } =
|
|
9
|
-
if (!
|
|
8
|
+
function d({ appId: t, clientId: d, clientSecret: p }) {
|
|
9
|
+
let { t: m } = s(), [h, g] = n(!1), [_, v] = n(null);
|
|
10
|
+
if (!t && !d) return null;
|
|
10
11
|
let y = (e, t) => {
|
|
11
12
|
navigator.clipboard.writeText(e), v(t), setTimeout(() => v((e) => e === t ? null : e), 1500);
|
|
12
13
|
};
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ u("section", {
|
|
14
15
|
"aria-label": e(m, "sandbox.agentApp.title", "Auto-registered application"),
|
|
15
16
|
className: "rounded-md border border-border-subtle bg-bg-surface p-4 text-sm",
|
|
16
17
|
children: [
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
+
/* @__PURE__ */ l("h3", {
|
|
18
19
|
className: "text-sm font-semibold text-text-primary",
|
|
19
20
|
children: e(m, "sandbox.agentApp.title", "Auto-registered application")
|
|
20
21
|
}),
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ l("p", {
|
|
22
23
|
className: "mt-1 text-xs text-text-secondary",
|
|
23
24
|
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
|
}),
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ u("dl", {
|
|
26
27
|
className: "mt-3 space-y-2",
|
|
27
28
|
children: [
|
|
28
|
-
|
|
29
|
+
t && /* @__PURE__ */ l(f, {
|
|
29
30
|
label: e(m, "sandbox.agentApp.appId", "App ID"),
|
|
30
|
-
value:
|
|
31
|
-
onCopy: () => y(
|
|
31
|
+
value: t,
|
|
32
|
+
onCopy: () => y(t, "app"),
|
|
32
33
|
copied: _ === "app"
|
|
33
34
|
}),
|
|
34
|
-
|
|
35
|
+
d && /* @__PURE__ */ l(f, {
|
|
35
36
|
label: e(m, "sandbox.agentApp.clientId", "Client ID"),
|
|
36
|
-
value:
|
|
37
|
-
onCopy: () => y(
|
|
37
|
+
value: d,
|
|
38
|
+
onCopy: () => y(d, "client"),
|
|
38
39
|
copied: _ === "client"
|
|
39
40
|
}),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ u("div", {
|
|
41
42
|
className: "flex items-center justify-between gap-2",
|
|
42
|
-
children: [/* @__PURE__ */
|
|
43
|
+
children: [/* @__PURE__ */ l("dt", {
|
|
43
44
|
className: "text-xs text-text-tertiary",
|
|
44
45
|
children: e(m, "sandbox.agentApp.clientSecret", "Client secret")
|
|
45
|
-
}), /* @__PURE__ */
|
|
46
|
+
}), /* @__PURE__ */ l("dd", {
|
|
46
47
|
className: "flex items-center gap-2 font-mono text-xs",
|
|
47
|
-
children: p && h ? /* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
48
|
+
children: p && h ? /* @__PURE__ */ u(c, { children: [
|
|
49
|
+
/* @__PURE__ */ l("span", { children: p }),
|
|
50
|
+
/* @__PURE__ */ l("button", {
|
|
50
51
|
type: "button",
|
|
51
52
|
onClick: () => y(p, "secret"),
|
|
52
53
|
"aria-label": e(m, "sandbox.agentApp.copySecret", "Copy client secret"),
|
|
53
54
|
className: "text-text-tertiary hover:text-text-secondary",
|
|
54
|
-
children:
|
|
55
|
+
children: l(_ === "secret" ? r : i, { size: 12 })
|
|
55
56
|
}),
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ l("button", {
|
|
57
58
|
type: "button",
|
|
58
59
|
onClick: () => g(!1),
|
|
59
60
|
className: "text-text-tertiary hover:text-text-secondary",
|
|
60
61
|
"aria-label": e(m, "sandbox.agentApp.hide", "Hide"),
|
|
61
|
-
children: /* @__PURE__ */
|
|
62
|
+
children: /* @__PURE__ */ l(o, { size: 12 })
|
|
62
63
|
})
|
|
63
|
-
] }) : p ? /* @__PURE__ */
|
|
64
|
+
] }) : p ? /* @__PURE__ */ u("button", {
|
|
64
65
|
type: "button",
|
|
65
66
|
onClick: () => g(!0),
|
|
66
67
|
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__ */
|
|
68
|
+
children: [/* @__PURE__ */ l(a, {
|
|
68
69
|
size: 12,
|
|
69
70
|
"aria-hidden": "true"
|
|
70
71
|
}), e(m, "sandbox.agentApp.secret.revealOnce", "Reveal once")]
|
|
71
|
-
}) : /* @__PURE__ */
|
|
72
|
+
}) : /* @__PURE__ */ l("span", {
|
|
72
73
|
className: "text-text-tertiary",
|
|
73
74
|
children: e(m, "sandbox.agentApp.secret.hidden", "Hidden — visible only at first creation")
|
|
74
75
|
})
|
|
@@ -79,25 +80,26 @@ function u({ appId: u, clientId: f, clientSecret: p }) {
|
|
|
79
80
|
]
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
-
|
|
83
|
+
function f({ label: e, value: n, onCopy: a, copied: o }) {
|
|
84
|
+
let s = t();
|
|
85
|
+
return /* @__PURE__ */ u("div", {
|
|
84
86
|
className: "flex items-center justify-between gap-2",
|
|
85
|
-
children: [/* @__PURE__ */
|
|
87
|
+
children: [/* @__PURE__ */ l("dt", {
|
|
86
88
|
className: "text-xs text-text-tertiary",
|
|
87
89
|
children: e
|
|
88
|
-
}), /* @__PURE__ */
|
|
90
|
+
}), /* @__PURE__ */ u("dd", {
|
|
89
91
|
className: "flex items-center gap-2 font-mono text-xs",
|
|
90
|
-
children: [/* @__PURE__ */
|
|
92
|
+
children: [/* @__PURE__ */ l("span", { children: n }), /* @__PURE__ */ l("button", {
|
|
91
93
|
type: "button",
|
|
92
|
-
onClick:
|
|
93
|
-
"aria-label":
|
|
94
|
+
onClick: a,
|
|
95
|
+
"aria-label": s("sandbox.agentApp.copyLabel", "Copy {{label}}", { label: e }),
|
|
94
96
|
className: "text-text-tertiary hover:text-text-secondary",
|
|
95
|
-
children:
|
|
97
|
+
children: l(o ? r : i, { size: 12 })
|
|
96
98
|
})]
|
|
97
99
|
})]
|
|
98
100
|
});
|
|
99
101
|
}
|
|
100
102
|
//#endregion
|
|
101
|
-
export {
|
|
103
|
+
export { d as SandboxAgentAppPanel };
|
|
102
104
|
|
|
103
105
|
//# sourceMappingURL=SandboxAgentAppPanel.js.map
|