@burdenoff/microfe-sandbox 2026.802.1 → 2026.830.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/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 +2 -2
|
@@ -1 +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-text-primary\">\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={
|
|
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';\nimport { useTr } from '../hooks/useTr';\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-text-primary\">\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 const tr = useTr();\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={tr('sandbox.agentApp.copyLabel', 'Copy {{label}}', { 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":";;;;;;;AAoBA,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;CACD,IAAM,IAAK,GAAO;AAClB,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,EAAG,8BAA8B,kBAAkB,EAAE,UAAO,CAAC;IACzE,WAAU;cAEA,EAAT,IAAU,IAA6B,GAA9B,EAAc,MAAM,IAAM,CAAqB;IAClD,CAAA,CACN;KACD"}
|
|
@@ -1 +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;
|
|
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;AAGpD,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;AAoDD;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAgBpD,CAAC"}
|
|
@@ -1,52 +1,60 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useTr as t } from "../hooks/useTr.js";
|
|
3
|
+
import { Bot as n, Box as r, Brain as i, FileCog as a, Terminal as o, Workflow as s } from "lucide-react";
|
|
4
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
4
5
|
//#region src/sandbox/components/SandboxTypeIcon.tsx
|
|
5
|
-
var
|
|
6
|
+
var u = {
|
|
6
7
|
AI_BUILDER: {
|
|
7
|
-
icon:
|
|
8
|
-
label: "AI Builder",
|
|
8
|
+
icon: i,
|
|
9
9
|
color: "text-accent-purple"
|
|
10
10
|
},
|
|
11
11
|
WORKFLOW_MULTI_NODE: {
|
|
12
|
-
icon:
|
|
13
|
-
label: "Workflow Multi-Node",
|
|
12
|
+
icon: s,
|
|
14
13
|
color: "text-accent-cyan"
|
|
15
14
|
},
|
|
16
15
|
MISC_SHELL: {
|
|
17
|
-
icon:
|
|
18
|
-
label: "Misc Shell",
|
|
16
|
+
icon: o,
|
|
19
17
|
color: "text-slate-600 dark:text-slate-400"
|
|
20
18
|
},
|
|
21
19
|
CUSTOM: {
|
|
22
|
-
icon:
|
|
23
|
-
label: "Custom",
|
|
20
|
+
icon: r,
|
|
24
21
|
color: "text-status-warning-text"
|
|
25
22
|
},
|
|
26
23
|
VIBECONTROLS: {
|
|
27
|
-
icon:
|
|
28
|
-
label: "VibeControls",
|
|
24
|
+
icon: n,
|
|
29
25
|
color: "text-primary"
|
|
30
26
|
},
|
|
31
27
|
DOCS_BUILDER: {
|
|
32
|
-
icon:
|
|
33
|
-
label: "Docs Builder",
|
|
28
|
+
icon: a,
|
|
34
29
|
color: "text-accent-cyan"
|
|
35
30
|
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
};
|
|
32
|
+
function d(e) {
|
|
33
|
+
let n = t();
|
|
34
|
+
switch (e) {
|
|
35
|
+
case "AI_BUILDER": return n("sandbox.typeIcon.aiBuilder", "AI Builder");
|
|
36
|
+
case "WORKFLOW_MULTI_NODE": return n("sandbox.typeIcon.workflowMultiNode", "Workflow Multi-Node");
|
|
37
|
+
case "MISC_SHELL": return n("sandbox.typeIcon.miscShell", "Misc Shell");
|
|
38
|
+
case "CUSTOM": return n("sandbox.typeIcon.custom", "Custom");
|
|
39
|
+
case "VIBECONTROLS": return n("sandbox.typeIcon.vibecontrols", "VibeControls");
|
|
40
|
+
case "DOCS_BUILDER": return n("sandbox.typeIcon.docsBuilder", "Docs Builder");
|
|
41
|
+
default: return n("sandbox.typeIcon.custom", "Custom");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
var f = ({ type: t, size: n = 16, className: r, showLabel: i = !1 }) => {
|
|
45
|
+
let a = u[t] || u.CUSTOM, o = a.icon, s = d(t);
|
|
46
|
+
return /* @__PURE__ */ l("span", {
|
|
39
47
|
className: e("inline-flex items-center gap-1.5", r),
|
|
40
|
-
children: [/* @__PURE__ */
|
|
48
|
+
children: [/* @__PURE__ */ c(o, {
|
|
41
49
|
size: n,
|
|
42
50
|
className: a.color
|
|
43
|
-
}), i && /* @__PURE__ */
|
|
51
|
+
}), i && /* @__PURE__ */ c("span", {
|
|
44
52
|
className: e("text-sm font-medium", a.color),
|
|
45
|
-
children:
|
|
53
|
+
children: s
|
|
46
54
|
})]
|
|
47
55
|
});
|
|
48
56
|
};
|
|
49
57
|
//#endregion
|
|
50
|
-
export {
|
|
58
|
+
export { f as SandboxTypeIcon };
|
|
51
59
|
|
|
52
60
|
//# sourceMappingURL=SandboxTypeIcon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxTypeIcon.js","names":[],"sources":["../../../src/sandbox/components/SandboxTypeIcon.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Brain, Workflow, Terminal, Box, Bot, FileCog } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport type { SandboxTemplateType } from '../types';\n\ninterface SandboxTypeIconProps {\n type: SandboxTemplateType;\n size?: number;\n className?: string;\n showLabel?: boolean;\n}\n\nconst typeConfig: Record<\n SandboxTemplateType,\n { icon: FC<{ size?: number; className?: string }>;
|
|
1
|
+
{"version":3,"file":"SandboxTypeIcon.js","names":[],"sources":["../../../src/sandbox/components/SandboxTypeIcon.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Brain, Workflow, Terminal, Box, Bot, FileCog } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport type { SandboxTemplateType } from '../types';\nimport { useTr } from '../hooks/useTr';\n\ninterface SandboxTypeIconProps {\n type: SandboxTemplateType;\n size?: number;\n className?: string;\n showLabel?: boolean;\n}\n\nconst typeConfig: Record<\n SandboxTemplateType,\n { icon: FC<{ size?: number; className?: string }>; color: string }\n> = {\n AI_BUILDER: {\n icon: Brain,\n color: 'text-accent-purple',\n },\n WORKFLOW_MULTI_NODE: {\n icon: Workflow,\n color: 'text-accent-cyan',\n },\n MISC_SHELL: {\n icon: Terminal,\n color: 'text-slate-600 dark:text-slate-400',\n },\n CUSTOM: {\n icon: Box,\n color: 'text-status-warning-text',\n },\n VIBECONTROLS: {\n icon: Bot,\n color: 'text-primary',\n },\n DOCS_BUILDER: {\n icon: FileCog,\n color: 'text-accent-cyan',\n },\n};\n\nfunction useTypeLabel(type: SandboxTemplateType): string {\n const tr = useTr();\n switch (type) {\n case 'AI_BUILDER':\n return tr('sandbox.typeIcon.aiBuilder', 'AI Builder');\n case 'WORKFLOW_MULTI_NODE':\n return tr('sandbox.typeIcon.workflowMultiNode', 'Workflow Multi-Node');\n case 'MISC_SHELL':\n return tr('sandbox.typeIcon.miscShell', 'Misc Shell');\n case 'CUSTOM':\n return tr('sandbox.typeIcon.custom', 'Custom');\n case 'VIBECONTROLS':\n return tr('sandbox.typeIcon.vibecontrols', 'VibeControls');\n case 'DOCS_BUILDER':\n return tr('sandbox.typeIcon.docsBuilder', 'Docs Builder');\n default:\n return tr('sandbox.typeIcon.custom', 'Custom');\n }\n}\n\n/**\n * Icon component for sandbox template type with optional label\n */\nexport const SandboxTypeIcon: FC<SandboxTypeIconProps> = ({\n type,\n size = 16,\n className,\n showLabel = false,\n}) => {\n const config = typeConfig[type] || typeConfig.CUSTOM;\n const Icon = config.icon;\n const label = useTypeLabel(type);\n\n return (\n <span className={cn('inline-flex items-center gap-1.5', className)}>\n <Icon size={size} className={config.color} />\n {showLabel && <span className={cn('text-sm font-medium', config.color)}>{label}</span>}\n </span>\n );\n};\n"],"mappings":";;;;;AAaA,IAAM,IAGF;CACF,YAAY;EACV,MAAM;EACN,OAAO;EACR;CACD,qBAAqB;EACnB,MAAM;EACN,OAAO;EACR;CACD,YAAY;EACV,MAAM;EACN,OAAO;EACR;CACD,QAAQ;EACN,MAAM;EACN,OAAO;EACR;CACD,cAAc;EACZ,MAAM;EACN,OAAO;EACR;CACD,cAAc;EACZ,MAAM;EACN,OAAO;EACR;CACF;AAED,SAAS,EAAa,GAAmC;CACvD,IAAM,IAAK,GAAO;AAClB,SAAQ,GAAR;EACE,KAAK,aACH,QAAO,EAAG,8BAA8B,aAAa;EACvD,KAAK,sBACH,QAAO,EAAG,sCAAsC,sBAAsB;EACxE,KAAK,aACH,QAAO,EAAG,8BAA8B,aAAa;EACvD,KAAK,SACH,QAAO,EAAG,2BAA2B,SAAS;EAChD,KAAK,eACH,QAAO,EAAG,iCAAiC,eAAe;EAC5D,KAAK,eACH,QAAO,EAAG,gCAAgC,eAAe;EAC3D,QACE,QAAO,EAAG,2BAA2B,SAAS;;;AAOpD,IAAa,KAA6C,EACxD,SACA,UAAO,IACP,cACA,eAAY,SACR;CACJ,IAAM,IAAS,EAAW,MAAS,EAAW,QACxC,IAAO,EAAO,MACd,IAAQ,EAAa,EAAK;AAEhC,QACE,kBAAC,QAAD;EAAM,WAAW,EAAG,oCAAoC,EAAU;YAAlE,CACE,kBAAC,GAAD;GAAY;GAAM,WAAW,EAAO;GAAS,CAAA,EAC5C,KAAa,kBAAC,QAAD;GAAM,WAAW,EAAG,uBAAuB,EAAO,MAAM;aAAG;GAAa,CAAA,CACjF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useTr — translation hook with fallback semantics.
|
|
3
|
+
*
|
|
4
|
+
* Wraps `useI18n().t()` so that when a key has no translation (i.e. the
|
|
5
|
+
* provider returns the key itself), the caller's English fallback is used
|
|
6
|
+
* instead. This keeps consumer call sites consistent and avoids leaking
|
|
7
|
+
* untranslated keys into the UI.
|
|
8
|
+
*
|
|
9
|
+
* Supports optional interpolation params using `{{key}}` placeholders.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const tr = useTr();
|
|
13
|
+
* return <h1>{tr('sandbox.list.title', 'Sandboxes')}</h1>;
|
|
14
|
+
* return <p>{tr('sandbox.list.selectedCount', '{{count}} selected', { count: 5 })}</p>;
|
|
15
|
+
*/
|
|
16
|
+
export declare function useTr(): (key: string, fallback: string, params?: Record<string, string | number>) => string;
|
|
17
|
+
//# sourceMappingURL=useTr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTr.d.ts","sourceRoot":"","sources":["../../../src/sandbox/hooks/useTr.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,IAAI,CACvB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KACrC,MAAM,CAcV"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useCallback as e } from "react";
|
|
2
|
+
import { useI18n as t } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
3
|
+
//#region src/sandbox/hooks/useTr.ts
|
|
4
|
+
function n() {
|
|
5
|
+
let { t: n } = t();
|
|
6
|
+
return e((e, t, r) => {
|
|
7
|
+
let i = n(e), a = i === e ? t : i;
|
|
8
|
+
return r ? Object.entries(r).reduce((e, [t, n]) => e.replace(RegExp(`\\{\\{${t}\\}\\}`, "g"), String(n)), a) : a;
|
|
9
|
+
}, [n]);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as useTr };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=useTr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTr.js","names":[],"sources":["../../../src/sandbox/hooks/useTr.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\n/**\n * useTr — translation hook with fallback semantics.\n *\n * Wraps `useI18n().t()` so that when a key has no translation (i.e. the\n * provider returns the key itself), the caller's English fallback is used\n * instead. This keeps consumer call sites consistent and avoids leaking\n * untranslated keys into the UI.\n *\n * Supports optional interpolation params using `{{key}}` placeholders.\n *\n * @example\n * const tr = useTr();\n * return <h1>{tr('sandbox.list.title', 'Sandboxes')}</h1>;\n * return <p>{tr('sandbox.list.selectedCount', '{{count}} selected', { count: 5 })}</p>;\n */\nexport function useTr(): (\n key: string,\n fallback: string,\n params?: Record<string, string | number>\n) => string {\n const { t } = useI18n();\n return useCallback(\n (key: string, fallback: string, params?: Record<string, string | number>): string => {\n const translated = t(key);\n const raw = translated === key ? fallback : translated;\n if (!params) return raw;\n return Object.entries(params).reduce(\n (str, [k, v]) => str.replace(new RegExp(`\\\\{\\\\{${k}\\\\}\\\\}`, 'g'), String(v)),\n raw\n );\n },\n [t]\n );\n}\n"],"mappings":";;;AAkBA,SAAgB,IAIJ;CACV,IAAM,EAAE,SAAM,GAAS;AACvB,QAAO,GACJ,GAAa,GAAkB,MAAqD;EACnF,IAAM,IAAa,EAAE,EAAI,EACnB,IAAM,MAAe,IAAM,IAAW;AAE5C,SADK,IACE,OAAO,QAAQ,EAAO,CAAC,QAC3B,GAAK,CAAC,GAAG,OAAO,EAAI,QAAY,OAAO,SAAS,EAAE,SAAS,IAAI,EAAE,OAAO,EAAE,CAAC,EAC5E,EACD,GAJmB;IAMtB,CAAC,EAAE,CACJ"}
|
package/dist/sandbox/index.d.ts
CHANGED
|
@@ -27,4 +27,5 @@ export { SandboxAdminRoot } from './SandboxAdminRoot';
|
|
|
27
27
|
export type { SandboxRootProps, SandboxAdminRootProps, Sandbox, SandboxTemplate, SandboxFilter, } from './types';
|
|
28
28
|
export { useSandbox } from './providers/SandboxProvider';
|
|
29
29
|
export { useSandboxStore } from './store/sandboxStore';
|
|
30
|
+
export { useTr } from './hooks/useTr';
|
|
30
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sandbox/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,gBAAgB,EAChB,qBAAqB,EACrB,OAAO,EACP,eAAe,EACf,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sandbox/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,gBAAgB,EAChB,qBAAqB,EACrB,OAAO,EACP,eAAe,EACf,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/sandbox/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxCreatePage.d.ts","sourceRoot":"","sources":["../../../src/sandbox/pages/SandboxCreatePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SandboxCreatePage.d.ts","sourceRoot":"","sources":["../../../src/sandbox/pages/SandboxCreatePage.tsx"],"names":[],"mappings":"AAkKA,wBAAgB,iBAAiB,gCAyiDhC"}
|