@burdenoff/microfe-sandbox 2026.624.3 → 2026.625.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/sandbox/components/CountdownTimer.js.map +1 -1
- package/dist/sandbox/components/SandboxUsageBanner.js +8 -5
- package/dist/sandbox/components/SandboxUsageBanner.js.map +1 -1
- package/dist/sandbox/components/ui.js +2 -2
- package/dist/sandbox/pages/AdminPage.js +191 -190
- package/dist/sandbox/pages/AdminPage.js.map +1 -1
- package/dist/sandbox/pages/AdminTemplatesPage.js +18 -24
- package/dist/sandbox/pages/AdminTemplatesPage.js.map +1 -1
- package/dist/sandbox/pages/SandboxCreatePage.js +892 -874
- package/dist/sandbox/pages/SandboxCreatePage.js.map +1 -1
- package/dist/sandbox/pages/SandboxDetailPage.js +772 -718
- package/dist/sandbox/pages/SandboxDetailPage.js.map +1 -1
- package/dist/sandbox/pages/SandboxListPage.js +418 -421
- package/dist/sandbox/pages/SandboxListPage.js.map +1 -1
- package/dist/sandbox/pages/TemplateDetailPage.js +490 -475
- package/dist/sandbox/pages/TemplateDetailPage.js.map +1 -1
- package/dist/sandbox/pages/UserTemplatesPage.js +56 -55
- package/dist/sandbox/pages/UserTemplatesPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CountdownTimer.js","names":[],"sources":["../../../src/sandbox/components/CountdownTimer.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { Timer, Plus, AlertTriangle } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { tWithFallback } from '../utils/i18n';\nimport { useRemainingSeconds } from '../hooks/useRemainingSeconds';\n\ninterface CountdownTimerProps {\n expiresAt: string;\n onExpired?: () => void;\n onExtend?: () => void;\n compact?: boolean;\n}\n\nexport function CountdownTimer({\n expiresAt,\n onExpired,\n onExtend,\n compact = false,\n}: CountdownTimerProps) {\n const remainingSeconds = useRemainingSeconds(expiresAt, onExpired);\n const { t } = useI18n();\n\n // Browser notification at 60 seconds remaining, once per expiresAt window.\n // Ref-based flag avoids a render cycle and tracks the active expiresAt directly.\n const alertedForRef = useRef<string | null>(null);\n if (\n alertedForRef.current !== expiresAt &&\n remainingSeconds <= 60 &&\n remainingSeconds > 0 &&\n typeof window !== 'undefined' &&\n 'Notification' in window &&\n Notification.permission === 'granted'\n ) {\n alertedForRef.current = expiresAt;\n new Notification(tWithFallback(t, 'sandbox.timer.alertTitle', 'Sandbox expiring'), {\n body: tWithFallback(\n t,\n 'sandbox.timer.alertBody',\n 'Your sandbox will be destroyed in less than 1 minute. Extend it to continue working.'\n ),\n icon: '/favicon.ico',\n });\n }\n\n const hours = Math.floor(remainingSeconds / 3600);\n const minutes = Math.floor((remainingSeconds % 3600) / 60);\n const seconds = remainingSeconds % 60;\n const fmt = (n: number) => String(n).padStart(2, '0');\n const timeString =\n hours > 0 ? `${fmt(hours)}:${fmt(minutes)}:${fmt(seconds)}` : `${fmt(minutes)}:${fmt(seconds)}`;\n\n const color = (() => {\n if (remainingSeconds <= 0) return 'text-text-secondary';\n if (remainingSeconds <= 30) return 'text-status-error-text animate-pulse';\n if (remainingSeconds <= 60) return 'text-status-error-text';\n if (remainingSeconds <= 300) return 'text-status-warning-text';\n return 'text-status-success-text';\n })();\n\n const bg = (() => {\n if (remainingSeconds <= 0) return 'bg-bg-sunken border-border-subtle';\n if (remainingSeconds <= 60) return 'bg-status-error-bg-subtle border-border-default';\n if (remainingSeconds <= 300) return 'bg-status-warning-bg-subtle border-border-default';\n return 'bg-status-success-bg-subtle border-border-default';\n })();\n\n const remainingMinutes = Math.max(1, Math.ceil(remainingSeconds / 60));\n const accessibleLabel =\n remainingSeconds <= 0\n ? tWithFallback(t, 'sandbox.timer.expired', 'Expired')\n : tWithFallback(t, 'sandbox.timer.remaining', `${remainingMinutes} minutes remaining`, {\n count: remainingMinutes,\n });\n\n if (compact) {\n return (\n <span\n role=\"timer\"\n aria-live=\"polite\"\n aria-label={accessibleLabel}\n className={`inline-flex items-center gap-1 text-sm font-mono tabular-nums ${color}`}\n >\n <Timer aria-hidden=\"true\" className=\"size-3.5\" />\n {timeString}\n </span>\n );\n }\n\n return (\n <div\n role=\"timer\"\n aria-live=\"polite\"\n aria-label={accessibleLabel}\n className={`flex items-center gap-3 rounded-lg border px-4 py-2 ${bg}`}\n >\n <Timer aria-hidden=\"true\" className={`size-5 ${color}`} />\n <div className=\"flex flex-col\">\n <span className={`text-lg font-mono font-semibold tabular-nums ${color}`}
|
|
1
|
+
{"version":3,"file":"CountdownTimer.js","names":[],"sources":["../../../src/sandbox/components/CountdownTimer.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { Timer, Plus, AlertTriangle } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { tWithFallback } from '../utils/i18n';\nimport { useRemainingSeconds } from '../hooks/useRemainingSeconds';\n\ninterface CountdownTimerProps {\n expiresAt: string;\n onExpired?: () => void;\n onExtend?: () => void;\n compact?: boolean;\n}\n\nexport function CountdownTimer({\n expiresAt,\n onExpired,\n onExtend,\n compact = false,\n}: CountdownTimerProps) {\n const remainingSeconds = useRemainingSeconds(expiresAt, onExpired);\n const { t } = useI18n();\n\n // Browser notification at 60 seconds remaining, once per expiresAt window.\n // Ref-based flag avoids a render cycle and tracks the active expiresAt directly.\n const alertedForRef = useRef<string | null>(null);\n if (\n alertedForRef.current !== expiresAt &&\n remainingSeconds <= 60 &&\n remainingSeconds > 0 &&\n typeof window !== 'undefined' &&\n 'Notification' in window &&\n Notification.permission === 'granted'\n ) {\n alertedForRef.current = expiresAt;\n new Notification(tWithFallback(t, 'sandbox.timer.alertTitle', 'Sandbox expiring'), {\n body: tWithFallback(\n t,\n 'sandbox.timer.alertBody',\n 'Your sandbox will be destroyed in less than 1 minute. Extend it to continue working.'\n ),\n icon: '/favicon.ico',\n });\n }\n\n const hours = Math.floor(remainingSeconds / 3600);\n const minutes = Math.floor((remainingSeconds % 3600) / 60);\n const seconds = remainingSeconds % 60;\n const fmt = (n: number) => String(n).padStart(2, '0');\n const timeString =\n hours > 0 ? `${fmt(hours)}:${fmt(minutes)}:${fmt(seconds)}` : `${fmt(minutes)}:${fmt(seconds)}`;\n\n const color = (() => {\n if (remainingSeconds <= 0) return 'text-text-secondary';\n if (remainingSeconds <= 30) return 'text-status-error-text animate-pulse';\n if (remainingSeconds <= 60) return 'text-status-error-text';\n if (remainingSeconds <= 300) return 'text-status-warning-text';\n return 'text-status-success-text';\n })();\n\n const bg = (() => {\n if (remainingSeconds <= 0) return 'bg-bg-sunken border-border-subtle';\n if (remainingSeconds <= 60) return 'bg-status-error-bg-subtle border-border-default';\n if (remainingSeconds <= 300) return 'bg-status-warning-bg-subtle border-border-default';\n return 'bg-status-success-bg-subtle border-border-default';\n })();\n\n const remainingMinutes = Math.max(1, Math.ceil(remainingSeconds / 60));\n const accessibleLabel =\n remainingSeconds <= 0\n ? tWithFallback(t, 'sandbox.timer.expired', 'Expired')\n : tWithFallback(t, 'sandbox.timer.remaining', `${remainingMinutes} minutes remaining`, {\n count: remainingMinutes,\n });\n\n if (compact) {\n return (\n <span\n role=\"timer\"\n aria-live=\"polite\"\n aria-label={accessibleLabel}\n className={`inline-flex items-center gap-1 text-sm font-mono tabular-nums ${color}`}\n >\n <Timer aria-hidden=\"true\" className=\"size-3.5\" />\n {timeString}\n </span>\n );\n }\n\n return (\n <div\n role=\"timer\"\n aria-live=\"polite\"\n aria-label={accessibleLabel}\n className={`flex items-center gap-3 rounded-lg border px-4 py-2 ${bg}`}\n >\n <Timer aria-hidden=\"true\" className={`size-5 ${color}`} />\n <div className=\"flex flex-col\">\n <span className={`text-lg font-mono font-semibold tabular-nums ${color}`}>\n {timeString}\n </span>\n <span className=\"text-xs text-text-secondary\">\n {remainingSeconds <= 0\n ? tWithFallback(t, 'sandbox.timer.expired', 'Expired')\n : tWithFallback(t, 'sandbox.timer.label', 'Time remaining')}\n </span>\n </div>\n\n {remainingSeconds <= 60 && remainingSeconds > 0 && (\n <div className=\"flex items-center gap-1 text-xs text-status-error-text font-medium\">\n <AlertTriangle aria-hidden=\"true\" className=\"size-3.5\" />\n {tWithFallback(t, 'sandbox.timer.expiringSoon', 'Expiring soon')}\n </div>\n )}\n\n {onExtend && remainingSeconds > 0 && (\n <button\n type=\"button\"\n onClick={onExtend}\n aria-label={tWithFallback(t, 'sandbox.timer.extend', 'Extend sandbox duration')}\n className=\"ml-auto flex items-center gap-1 rounded-md bg-bg-surface px-3 py-1.5 text-sm font-medium text-text-secondary shadow-sm border border-border-subtle hover:bg-bg-sunken transition-colors\"\n >\n <Plus aria-hidden=\"true\" className=\"size-3.5\" />\n {tWithFallback(t, 'sandbox.timer.extend', 'Extend')}\n </button>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAaA,SAAgB,EAAe,EAC7B,cACA,cACA,aACA,aAAU,MACY;CACtB,IAAM,IAAmB,EAAoB,GAAW,EAAU,EAC5D,EAAE,SAAM,GAAS,EAIjB,IAAgB,EAAsB,KAAK;AACjD,CACE,EAAc,YAAY,KAC1B,KAAoB,MACpB,IAAmB,KACnB,OAAO,SAAW,OAClB,kBAAkB,UAClB,aAAa,eAAe,cAE5B,EAAc,UAAU,GACxB,IAAI,aAAa,EAAc,GAAG,4BAA4B,mBAAmB,EAAE;EACjF,MAAM,EACJ,GACA,2BACA,uFACD;EACD,MAAM;EACP,CAAC;CAGJ,IAAM,IAAQ,KAAK,MAAM,IAAmB,KAAK,EAC3C,IAAU,KAAK,MAAO,IAAmB,OAAQ,GAAG,EACpD,IAAU,IAAmB,IAC7B,KAAO,MAAc,OAAO,EAAE,CAAC,SAAS,GAAG,IAAI,EAC/C,IACJ,IAAQ,IAAI,GAAG,EAAI,EAAM,CAAC,GAAG,EAAI,EAAQ,CAAC,GAAG,EAAI,EAAQ,KAAK,GAAG,EAAI,EAAQ,CAAC,GAAG,EAAI,EAAQ,IAEzF,IACA,KAAoB,IAAU,wBAC9B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AEP"}
|
|
@@ -6,12 +6,15 @@ function i({ runningCount: i, maxConcurrent: a, minutesConsumed: o, minutesQuota
|
|
|
6
6
|
let { t: c } = t(), l = a > 0 ? Math.min(100, Math.round(i / a * 100)) : 0;
|
|
7
7
|
return /* @__PURE__ */ r("output", {
|
|
8
8
|
"aria-live": "polite",
|
|
9
|
-
className: "flex flex-wrap items-center gap-3 rounded-
|
|
9
|
+
className: "flex flex-wrap items-center gap-3 rounded-card border border-border-seam bg-accent-wash px-3.5 py-2.5 text-xs text-text-secondary",
|
|
10
10
|
children: [
|
|
11
|
-
/* @__PURE__ */ n("span", {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
/* @__PURE__ */ n("span", {
|
|
12
|
+
className: "tabular-nums",
|
|
13
|
+
children: e(c, "sandbox.usageBanner.concurrent", `${i} of ${a} sandboxes running`, {
|
|
14
|
+
count: i,
|
|
15
|
+
max: a
|
|
16
|
+
})
|
|
17
|
+
}),
|
|
15
18
|
/* @__PURE__ */ n("div", {
|
|
16
19
|
className: "h-1.5 w-32 overflow-hidden rounded-full bg-bg-surface",
|
|
17
20
|
"aria-hidden": "true",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxUsageBanner.js","names":[],"sources":["../../../src/sandbox/components/SandboxUsageBanner.tsx"],"sourcesContent":["import { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { tWithFallback } from '../utils/i18n';\n\ninterface Props {\n /** Concurrent running count from the live list (cheap to compute client-side). */\n runningCount: number;\n /** Workspace policy max (`SandboxConfig.maxConcurrentPerWorkspace`). */\n maxConcurrent: number;\n /** Optional consumed/quota minute counts for monthly usage. Hide block if not provided. */\n minutesConsumed?: number;\n minutesQuota?: number;\n}\n\n/**\n * Compact usage banner shown above the sandbox list. Mirrors the per-workspace\n * limits set by admins so members see why creates are blocked when they hit a cap.\n */\nexport function SandboxUsageBanner({\n runningCount,\n maxConcurrent,\n minutesConsumed,\n minutesQuota,\n}: Props) {\n const { t } = useI18n();\n\n const pct =\n maxConcurrent > 0 ? Math.min(100, Math.round((runningCount / maxConcurrent) * 100)) : 0;\n\n return (\n <output\n aria-live=\"polite\"\n className=\"flex flex-wrap items-center gap-3 rounded-
|
|
1
|
+
{"version":3,"file":"SandboxUsageBanner.js","names":[],"sources":["../../../src/sandbox/components/SandboxUsageBanner.tsx"],"sourcesContent":["import { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { tWithFallback } from '../utils/i18n';\n\ninterface Props {\n /** Concurrent running count from the live list (cheap to compute client-side). */\n runningCount: number;\n /** Workspace policy max (`SandboxConfig.maxConcurrentPerWorkspace`). */\n maxConcurrent: number;\n /** Optional consumed/quota minute counts for monthly usage. Hide block if not provided. */\n minutesConsumed?: number;\n minutesQuota?: number;\n}\n\n/**\n * Compact usage banner shown above the sandbox list. Mirrors the per-workspace\n * limits set by admins so members see why creates are blocked when they hit a cap.\n */\nexport function SandboxUsageBanner({\n runningCount,\n maxConcurrent,\n minutesConsumed,\n minutesQuota,\n}: Props) {\n const { t } = useI18n();\n\n const pct =\n maxConcurrent > 0 ? Math.min(100, Math.round((runningCount / maxConcurrent) * 100)) : 0;\n\n return (\n <output\n aria-live=\"polite\"\n className=\"flex flex-wrap items-center gap-3 rounded-card border border-border-seam bg-accent-wash px-3.5 py-2.5 text-xs text-text-secondary\"\n >\n <span className=\"tabular-nums\">\n {tWithFallback(\n t,\n 'sandbox.usageBanner.concurrent',\n `${runningCount} of ${maxConcurrent} sandboxes running`,\n { count: runningCount, max: maxConcurrent }\n )}\n </span>\n <div className=\"h-1.5 w-32 overflow-hidden rounded-full bg-bg-surface\" aria-hidden=\"true\">\n <div\n className={`h-full ${pct >= 90 ? 'bg-status-error-bg-default' : pct >= 70 ? 'bg-status-warning-bg-default' : 'bg-status-success-bg-default'}`}\n style={{ width: `${pct}%` }}\n />\n </div>\n {typeof minutesConsumed === 'number' && typeof minutesQuota === 'number' && (\n <span className=\"ml-auto\">\n {tWithFallback(\n t,\n 'sandbox.usageBanner.consumed',\n `${minutesConsumed} of ${minutesQuota} minutes used this month`,\n { minutes: minutesConsumed, quota: minutesQuota }\n )}\n </span>\n )}\n </output>\n );\n}\n"],"mappings":";;;;AAiBA,SAAgB,EAAmB,EACjC,iBACA,kBACA,oBACA,mBACQ;CACR,IAAM,EAAE,SAAM,GAAS,EAEjB,IACJ,IAAgB,IAAI,KAAK,IAAI,KAAK,KAAK,MAAO,IAAe,IAAiB,IAAI,CAAC,GAAG;AAExF,QACE,kBAAC,UAAD;EACE,aAAU;EACV,WAAU;YAFZ;GAIE,kBAAC,QAAD;IAAM,WAAU;cACb,EACC,GACA,kCACA,GAAG,EAAa,MAAM,EAAc,qBACpC;KAAE,OAAO;KAAc,KAAK;KAAe,CAC5C;IACI,CAAA;GACP,kBAAC,OAAD;IAAK,WAAU;IAAwD,eAAY;cACjF,kBAAC,OAAD;KACE,WAAW,UAAU,KAAO,KAAK,+BAA+B,KAAO,KAAK,iCAAiC;KAC7G,OAAO,EAAE,OAAO,GAAG,EAAI,IAAI;KAC3B,CAAA;IACE,CAAA;GACL,OAAO,KAAoB,YAAY,OAAO,KAAiB,YAC9D,kBAAC,QAAD;IAAM,WAAU;cACb,EACC,GACA,gCACA,GAAG,EAAgB,MAAM,EAAa,2BACtC;KAAE,SAAS;KAAiB,OAAO;KAAc,CAClD;IACI,CAAA;GAEF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Badge as e, Button as t,
|
|
2
|
-
export { e as Badge, t as Button, n as
|
|
1
|
+
import { Badge as e, Button as t, CTAOverflowMenu as n, Card as r, CardContent as i, Checkbox as a, Dialog as o, DialogContent as s, DialogDescription as c, DialogFooter as l, DialogHeader as u, DialogTitle as d, EmphasisPanel as f, GlassCard as p, Input as m, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y, ShowMore as b, Skeleton as x } from "@burdenoff/fe-libs/ui";
|
|
2
|
+
export { e as Badge, t as Button, n as CTAOverflowMenu, r as Card, i as CardContent, a as Checkbox, o as Dialog, s as DialogContent, c as DialogDescription, l as DialogFooter, u as DialogHeader, d as DialogTitle, f as EmphasisPanel, p as GlassCard, m as Input, h as Select, g as SelectContent, _ as SelectItem, v as SelectTrigger, y as SelectValue, b as ShowMore, x as Skeleton };
|