@burdenoff/microfe-sandbox 2026.611.2 → 2026.623.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.
|
@@ -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: '
|
|
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.\n </div>\n }\n >\n <FeatureFlagProvider\n workspaceId={props.workspaceId ?? null}\n gateway=\"workspace\"\n defaultEnabled={true}\n >\n <SandboxProvider {...props}>\n <UserRoutes />\n </SandboxProvider>\n </FeatureFlagProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;;AAoCA,IAAa,KAAqC,MAAU;CAC1D,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ;AAqDlE,QAlDA,QAAgB;AACT,QA4BL,QADgB,EAzBgB;GAC9B,IAAI;GACJ,OAAO;GACP,MAAM;GACN,MAAM,kBAAC,GAAD,EAAK,MAAM,IAAM,CAAA;GACvB,OAAO;GACP,OAAO;GACP,UAAU,CACR;IACE,IAAI;IACJ,OAAO;IACP,MAAM;IACN,MAAM,kBAAC,GAAD,EAAK,MAAM,IAAM,CAAA;IACvB,OAAO;IACR,EACD;IACE,IAAI;IACJ,OAAO;IACP,MAAM,EAAS,GAAU,YAAY;IACrC,MAAM,kBAAC,GAAD,EAAgB,MAAM,IAAM,CAAA;IAClC,OAAO;IACR,CACF;GACF,CAE+C;IAE/C,CAAC,GAAkB,EAAS,CAAC,EAGhC,QAAgB;AACT,QAaL,QADgB,EAVI,CAClB;GACE,IAAI;GACJ,OAAO;GACP,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAE/C,CAAC,EAAoB,CAAC,EAGvB,kBAAC,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;aAAsC;GAE/C,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"}
|
|
@@ -9,27 +9,24 @@ import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
|
9
9
|
import { Tabs as l } from "@burdenoff/fe-libs/chrome";
|
|
10
10
|
//#region src/sandbox/pages/UserLandingPage.tsx
|
|
11
11
|
function u() {
|
|
12
|
-
let [u, d] = a(), { t: f } = o(), p = i(() => [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
label: e(f, "sandbox.userLanding.tabs.templates", "Templates")
|
|
24
|
-
}
|
|
25
|
-
], [f]), m = u.get("tab"), h = m && p.some((e) => e.id === m) ? m : p[0].id;
|
|
12
|
+
let [u, d] = a(), { t: f } = o(), p = i(() => [{
|
|
13
|
+
id: "overview",
|
|
14
|
+
label: e(f, "sandbox.userLanding.tabs.overview", "Sandboxes")
|
|
15
|
+
}, {
|
|
16
|
+
id: "templates",
|
|
17
|
+
label: e(f, "sandbox.userLanding.tabs.templates", "Templates")
|
|
18
|
+
}], [f]), m = [
|
|
19
|
+
"overview",
|
|
20
|
+
"create",
|
|
21
|
+
"templates"
|
|
22
|
+
], h = u.get("tab"), g = h && m.includes(h) ? h : "overview";
|
|
26
23
|
return /* @__PURE__ */ c("div", {
|
|
27
24
|
className: "flex flex-col h-full",
|
|
28
25
|
children: [/* @__PURE__ */ s("div", {
|
|
29
26
|
className: "border-b border-border-subtle px-4 pt-3",
|
|
30
27
|
children: /* @__PURE__ */ s(l, {
|
|
31
28
|
items: p,
|
|
32
|
-
activeTabId:
|
|
29
|
+
activeTabId: g,
|
|
33
30
|
onTabChange: (e) => {
|
|
34
31
|
let t = new URLSearchParams(u);
|
|
35
32
|
e === p[0].id ? t.delete("tab") : t.set("tab", e), d(t, { replace: !0 });
|
|
@@ -39,9 +36,9 @@ function u() {
|
|
|
39
36
|
}), /* @__PURE__ */ c("div", {
|
|
40
37
|
className: "flex-1 min-h-0 overflow-auto",
|
|
41
38
|
children: [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
g === "overview" && /* @__PURE__ */ s(t, {}),
|
|
40
|
+
g === "create" && /* @__PURE__ */ s(n, {}),
|
|
41
|
+
g === "templates" && /* @__PURE__ */ s(r, {})
|
|
45
42
|
]
|
|
46
43
|
})]
|
|
47
44
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserLandingPage.js","names":[],"sources":["../../../src/sandbox/pages/UserLandingPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { useSearchParams } from 'react-router-dom';\nimport { Tabs, type TabItem } from '@burdenoff/fe-libs/chrome';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\n\nimport { SandboxListPage } from './SandboxListPage';\nimport { SandboxCreatePage } from './SandboxCreatePage';\nimport { UserTemplatesPage } from './UserTemplatesPage';\nimport { tWithFallback } from '../utils/i18n';\n\n/**\n * UserLandingPage\n *\n * Tabbed landing page for the user-facing Sandbox microfrontend.\n * Shows only user-relevant tabs: sandbox list, create, and templates (read-only).\n * The active tab is reflected in the `?tab=` URL search param.\n */\nexport function UserLandingPage() {\n const [params, setParams] = useSearchParams();\n const { t } = useI18n();\n\n const tabs: TabItem[] = useMemo(\n () => [\n {\n id: 'overview',\n label: tWithFallback(t, 'sandbox.userLanding.tabs.overview', '
|
|
1
|
+
{"version":3,"file":"UserLandingPage.js","names":[],"sources":["../../../src/sandbox/pages/UserLandingPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { useSearchParams } from 'react-router-dom';\nimport { Tabs, type TabItem } from '@burdenoff/fe-libs/chrome';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\n\nimport { SandboxListPage } from './SandboxListPage';\nimport { SandboxCreatePage } from './SandboxCreatePage';\nimport { UserTemplatesPage } from './UserTemplatesPage';\nimport { tWithFallback } from '../utils/i18n';\n\n/**\n * UserLandingPage\n *\n * Tabbed landing page for the user-facing Sandbox microfrontend.\n * Shows only user-relevant tabs: sandbox list, create, and templates (read-only).\n * The active tab is reflected in the `?tab=` URL search param.\n */\nexport function UserLandingPage() {\n const [params, setParams] = useSearchParams();\n const { t } = useI18n();\n\n // No dedicated \"New Sandbox\" tab — creating a sandbox is a primary action\n // (the \"Create Sandbox\" button), not a peer view. The create page is still\n // reachable at ?tab=create (kept in VALID_TAB_IDS below) but is not shown in\n // the tab strip.\n const tabs: TabItem[] = useMemo(\n () => [\n {\n id: 'overview',\n label: tWithFallback(t, 'sandbox.userLanding.tabs.overview', 'Sandboxes'),\n },\n {\n id: 'templates',\n label: tWithFallback(t, 'sandbox.userLanding.tabs.templates', 'Templates'),\n },\n ],\n [t]\n );\n\n const VALID_TAB_IDS = ['overview', 'create', 'templates'];\n const rawTab = params.get('tab');\n const activeId = rawTab && VALID_TAB_IDS.includes(rawTab) ? rawTab : 'overview';\n\n const handleTabChange = (id: string) => {\n const next = new URLSearchParams(params);\n if (id === tabs[0].id) {\n next.delete('tab');\n } else {\n next.set('tab', id);\n }\n setParams(next, { replace: true });\n };\n\n return (\n <div className=\"flex flex-col h-full\">\n <div className=\"border-b border-border-subtle px-4 pt-3\">\n <Tabs\n items={tabs}\n activeTabId={activeId}\n onTabChange={handleTabChange}\n variant=\"underline\"\n />\n </div>\n <div className=\"flex-1 min-h-0 overflow-auto\">\n {activeId === 'overview' && <SandboxListPage />}\n {activeId === 'create' && <SandboxCreatePage />}\n {activeId === 'templates' && <UserTemplatesPage />}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAiBA,SAAgB,IAAkB;CAChC,IAAM,CAAC,GAAQ,KAAa,GAAiB,EACvC,EAAE,SAAM,GAAS,EAMjB,IAAkB,QAChB,CACJ;EACE,IAAI;EACJ,OAAO,EAAc,GAAG,qCAAqC,YAAY;EAC1E,EACD;EACE,IAAI;EACJ,OAAO,EAAc,GAAG,sCAAsC,YAAY;EAC3E,CACF,EACD,CAAC,EAAE,CACJ,EAEK,IAAgB;EAAC;EAAY;EAAU;EAAY,EACnD,IAAS,EAAO,IAAI,MAAM,EAC1B,IAAW,KAAU,EAAc,SAAS,EAAO,GAAG,IAAS;AAYrE,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,GAAD;IACE,OAAO;IACP,aAAa;IACb,cAhBiB,MAAe;KACtC,IAAM,IAAO,IAAI,gBAAgB,EAAO;AAMxC,KALI,MAAO,EAAK,GAAG,KACjB,EAAK,OAAO,MAAM,GAElB,EAAK,IAAI,OAAO,EAAG,EAErB,EAAU,GAAM,EAAE,SAAS,IAAM,CAAC;;IAU5B,SAAQ;IACR,CAAA;GACE,CAAA,EACN,kBAAC,OAAD;GAAK,WAAU;aAAf;IACG,MAAa,cAAc,kBAAC,GAAD,EAAmB,CAAA;IAC9C,MAAa,YAAY,kBAAC,GAAD,EAAqB,CAAA;IAC9C,MAAa,eAAe,kBAAC,GAAD,EAAqB,CAAA;IAC9C;KACF"}
|