@leverege/imaginarium-ui 1.0.0-beta.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/LICENSE.md +3 -0
- package/README.md +4 -0
- package/dist/Card-CFK_M3Te.js +192 -0
- package/dist/Card-CFK_M3Te.js.map +1 -0
- package/dist/Card-Z-6q-k3a.cjs +2 -0
- package/dist/Card-Z-6q-k3a.cjs.map +1 -0
- package/dist/ImaginariumApp-CCSmWwRB.js +278 -0
- package/dist/ImaginariumApp-CCSmWwRB.js.map +1 -0
- package/dist/ImaginariumApp-DoCgiASz.cjs +2 -0
- package/dist/ImaginariumApp-DoCgiASz.cjs.map +1 -0
- package/dist/ImaginariumUI.d.ts +40 -0
- package/dist/ImaginariumUI.d.ts.map +1 -0
- package/dist/PluginSetup-Cauc3iMv.cjs +2 -0
- package/dist/PluginSetup-Cauc3iMv.cjs.map +1 -0
- package/dist/PluginSetup-DnpUFDph.js +459 -0
- package/dist/PluginSetup-DnpUFDph.js.map +1 -0
- package/dist/PluginSetup.d.ts +11 -0
- package/dist/PluginSetup.d.ts.map +1 -0
- package/dist/PluginTypes-Bt6202F8.js +7 -0
- package/dist/PluginTypes-Bt6202F8.js.map +1 -0
- package/dist/PluginTypes-DOX3G1ip.cjs +2 -0
- package/dist/PluginTypes-DOX3G1ip.cjs.map +1 -0
- package/dist/api/ImaginariumApiContext.d.ts +13 -0
- package/dist/api/ImaginariumApiContext.d.ts.map +1 -0
- package/dist/auth/LoginPage.d.ts +13 -0
- package/dist/auth/LoginPage.d.ts.map +1 -0
- package/dist/auth/RequireAuth.d.ts +23 -0
- package/dist/auth/RequireAuth.d.ts.map +1 -0
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/components/ui/Button.d.ts +12 -0
- package/dist/components/ui/Button.d.ts.map +1 -0
- package/dist/components/ui/Card.d.ts +9 -0
- package/dist/components/ui/Card.d.ts.map +1 -0
- package/dist/components/ui/Dialog.d.ts +20 -0
- package/dist/components/ui/Dialog.d.ts.map +1 -0
- package/dist/components/ui/Input.d.ts +4 -0
- package/dist/components/ui/Input.d.ts.map +1 -0
- package/dist/components/ui/Label.d.ts +6 -0
- package/dist/components/ui/Label.d.ts.map +1 -0
- package/dist/components/ui/Toast.d.ts +16 -0
- package/dist/components/ui/Toast.d.ts.map +1 -0
- package/dist/components/ui/Toaster.d.ts +2 -0
- package/dist/components/ui/Toaster.d.ts.map +1 -0
- package/dist/components/ui/Tooltip.d.ts +8 -0
- package/dist/components/ui/Tooltip.d.ts.map +1 -0
- package/dist/hooks/useToast.d.ts +45 -0
- package/dist/hooks/useToast.d.ts.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +122 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/plugins/PluginTypes.d.ts +4 -0
- package/dist/plugins/PluginTypes.d.ts.map +1 -0
- package/dist/plugins/index.d.ts +4 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/registry.d.ts +8 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/types.d.ts +21 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins.cjs +2 -0
- package/dist/plugins.cjs.map +1 -0
- package/dist/plugins.js +14 -0
- package/dist/plugins.js.map +1 -0
- package/dist/registry--NcHYEqp.js +31 -0
- package/dist/registry--NcHYEqp.js.map +1 -0
- package/dist/registry-Nyaf2ket.cjs +2 -0
- package/dist/registry-Nyaf2ket.cjs.map +1 -0
- package/dist/shell/AppNav.d.ts +17 -0
- package/dist/shell/AppNav.d.ts.map +1 -0
- package/dist/shell/ImaginariumApp.d.ts +15 -0
- package/dist/shell/ImaginariumApp.d.ts.map +1 -0
- package/dist/shell/Shell.d.ts +7 -0
- package/dist/shell/Shell.d.ts.map +1 -0
- package/dist/shell/index.d.ts +4 -0
- package/dist/shell/index.d.ts.map +1 -0
- package/dist/shell.cjs +2 -0
- package/dist/shell.cjs.map +1 -0
- package/dist/shell.js +7 -0
- package/dist/shell.js.map +1 -0
- package/dist/system/ImagineSystemNavItem.d.ts +9 -0
- package/dist/system/ImagineSystemNavItem.d.ts.map +1 -0
- package/dist/system/ImagineSystemPage.d.ts +8 -0
- package/dist/system/ImagineSystemPage.d.ts.map +1 -0
- package/dist/system/ImagineSystemView.d.ts +12 -0
- package/dist/system/ImagineSystemView.d.ts.map +1 -0
- package/dist/system/PluginSetup.d.ts +23 -0
- package/dist/system/PluginSetup.d.ts.map +1 -0
- package/dist/system/index.d.ts +7 -0
- package/dist/system/index.d.ts.map +1 -0
- package/dist/system/types.d.ts +22 -0
- package/dist/system/types.d.ts.map +1 -0
- package/dist/system.cjs +2 -0
- package/dist/system.cjs.map +1 -0
- package/dist/system.js +11 -0
- package/dist/system.js.map +1 -0
- package/dist/theme/tailwind-preset.cjs +2 -0
- package/dist/theme/tailwind-preset.cjs.map +1 -0
- package/dist/theme/tailwind-preset.d.ts +4 -0
- package/dist/theme/tailwind-preset.d.ts.map +1 -0
- package/dist/theme/tailwind-preset.js +62 -0
- package/dist/theme/tailwind-preset.js.map +1 -0
- package/lib/index.cjs +2 -0
- package/lib/index.js +122 -0
- package/package.json +82 -0
- package/src/ImaginariumUI.tsx +98 -0
- package/src/PluginSetup.ts +30 -0
- package/src/api/ImaginariumApiContext.tsx +54 -0
- package/src/auth/LoginPage.tsx +84 -0
- package/src/auth/RequireAuth.tsx +72 -0
- package/src/auth/index.ts +2 -0
- package/src/components/ui/Button.tsx +49 -0
- package/src/components/ui/Card.tsx +58 -0
- package/src/components/ui/Dialog.tsx +105 -0
- package/src/components/ui/Input.tsx +22 -0
- package/src/components/ui/Label.tsx +19 -0
- package/src/components/ui/Toast.tsx +106 -0
- package/src/components/ui/Toaster.tsx +29 -0
- package/src/components/ui/Tooltip.tsx +26 -0
- package/src/hooks/useToast.ts +130 -0
- package/src/index.ts +63 -0
- package/src/lib/utils.ts +6 -0
- package/src/plugins/PluginTypes.ts +3 -0
- package/src/plugins/index.ts +10 -0
- package/src/plugins/leverege-plugin.d.ts +20 -0
- package/src/plugins/registry.ts +31 -0
- package/src/plugins/types.ts +19 -0
- package/src/shell/AppNav.tsx +63 -0
- package/src/shell/ImaginariumApp.tsx +78 -0
- package/src/shell/Shell.tsx +46 -0
- package/src/shell/index.ts +3 -0
- package/src/system/ImagineSystemNavItem.ts +9 -0
- package/src/system/ImagineSystemPage.tsx +7 -0
- package/src/system/ImagineSystemView.tsx +423 -0
- package/src/system/PluginSetup.ts +57 -0
- package/src/system/index.ts +14 -0
- package/src/system/types.ts +24 -0
- package/src/theme/index.css +133 -0
- package/src/theme/tailwind-preset.ts +62 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),f=require("react"),b=require("@tanstack/react-query"),d=require("@leverege/plugin"),O=require("@radix-ui/react-tooltip"),s=require("./Card-Z-6q-k3a.cjs"),V=require("@radix-ui/react-toast"),D=require("class-variance-authority"),M=require("lucide-react"),g=require("wouter"),j=require("./registry-Nyaf2ket.cjs");function y(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return n.default=t,Object.freeze(n)}const m=y(f),x=y(O),c=y(V);function $(t){const{element:n}=t;return f.isValidElement(n)?n:typeof n=="function"?f.createElement(n):n}function P({fallback:t,children:n}){const r=j.getPages(),o=j.getProviders();let i=e.jsxs(g.Switch,{children:[r.map(a=>e.jsx(g.Route,{path:a.path,children:$(a)},a.path)),e.jsx(g.Route,{children:t??e.jsx("div",{className:"p-8 text-muted-foreground",children:"Not found"})})]});for(const{component:a}of o)i=e.jsx(a,{children:i});return e.jsxs("main",{className:"container mx-auto px-4 py-6",children:[n,i]})}const F=/^(https?:|data:|blob:|\/|\.\/|\.\.\/)/;function G(t,n){if(!t)return null;if(typeof t=="string")return F.test(t)?e.jsx("img",{src:t,alt:"",className:n}):e.jsx("span",{className:`${t} ${n}`,"aria-hidden":"true"});const r=t;return e.jsx(r,{className:n})}function R({title:t="Imaginarium",titleIcon:n,rightSlot:r}){const[o]=g.useLocation(),i=j.getNavItems();return e.jsx("nav",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 sticky top-0 z-50",children:e.jsxs("div",{className:"container mx-auto flex h-14 items-center px-4",children:[e.jsxs("div",{className:"mr-8 flex items-center gap-2 font-semibold text-lg",children:[G(n,"h-6 w-6"),e.jsx("span",{children:t})]}),e.jsx("div",{className:"flex items-center gap-1",children:i.map(({label:a,path:l,icon:u})=>{const p=o===l||o.startsWith(`${l}/`);return e.jsx(g.Link,{href:l,children:e.jsxs(s.Button,{variant:p?"secondary":"ghost",size:"sm",className:"gap-2",children:[u?e.jsx(u,{className:"h-4 w-4"}):null,a]})},l)})}),r?e.jsx("div",{className:"ml-auto flex items-center gap-2",children:r}):null]})})}const I=x.Provider,Q=x.Root,H=x.Trigger,k=m.forwardRef(({className:t,sideOffset:n=4,...r},o)=>e.jsx(x.Content,{ref:o,sideOffset:n,className:s.cn("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",t),...r}));k.displayName=x.Content.displayName;const q=c.Provider,w=m.forwardRef(({className:t,...n},r)=>e.jsx(c.Viewport,{ref:r,className:s.cn("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...n}));w.displayName=c.Viewport.displayName;const U=D.cva("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),N=m.forwardRef(({className:t,variant:n,...r},o)=>e.jsx(c.Root,{ref:o,className:s.cn(U({variant:n}),t),...r}));N.displayName=c.Root.displayName;const S=m.forwardRef(({className:t,...n},r)=>e.jsx(c.Action,{ref:r,className:s.cn("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",t),...n}));S.displayName=c.Action.displayName;const T=m.forwardRef(({className:t,...n},r)=>e.jsx(c.Close,{ref:r,className:s.cn("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100",t),"toast-close":"",...n,children:e.jsx(M.X,{className:"h-4 w-4"})}));T.displayName=c.Close.displayName;const C=m.forwardRef(({className:t,...n},r)=>e.jsx(c.Title,{ref:r,className:s.cn("text-sm font-semibold",t),...n}));C.displayName=c.Title.displayName;const A=m.forwardRef(({className:t,...n},r)=>e.jsx(c.Description,{ref:r,className:s.cn("text-sm opacity-90",t),...n}));A.displayName=c.Description.displayName;function z(){const{toasts:t}=s.useToast();return e.jsxs(q,{children:[t.map(({id:n,title:r,description:o,action:i,...a})=>e.jsxs(N,{...a,children:[e.jsxs("div",{className:"grid gap-1",children:[r&&e.jsx(C,{children:r}),o&&e.jsx(A,{children:o})]}),i,e.jsx(T,{})]},n)),e.jsx(w,{})]})}function W({className:t}){return e.jsxs("svg",{viewBox:"0 0 24 24",className:t,"aria-hidden":"true",children:[e.jsx("path",{fill:"#4285F4",d:"M23.49 12.27c0-.79-.07-1.54-.19-2.27H12v4.51h6.16c-.27 1.4-1.04 2.59-2.21 3.41v2.77h3.59c2.08-1.92 3.95-4.74 3.95-8.42z"}),e.jsx("path",{fill:"#34A853",d:"M12 24c2.97 0 5.46-.98 7.28-2.66l-3.59-2.77c-.98.66-2.23 1.06-3.69 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 21.53 7.7 24 12 24z"}),e.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),e.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]})}const J={auth_failed:"Sign-in failed. Please try again."};function K(){if(typeof window>"u")return;const t=new URLSearchParams(window.location.search).get("error");if(t)return J[t]??`Sign-in error: ${t}`}function E({loginPath:t,title:n="Sign in",subtitle:r,buttonLabel:o="Sign in with Google",backgroundUrl:i,errorMessage:a}){const l=a??K(),u=!!i;return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background bg-cover bg-center px-4",style:u?{backgroundImage:`url(${i})`}:void 0,children:e.jsxs(s.Card,{className:`w-full max-w-md ${u?"backdrop-blur-sm bg-card/90":""}`,children:[e.jsxs(s.CardHeader,{className:"text-center",children:[e.jsx(s.CardTitle,{children:n}),r&&e.jsx(s.CardDescription,{children:r})]}),e.jsxs(s.CardContent,{className:"space-y-4",children:[l&&e.jsx("div",{className:"rounded-md border border-destructive bg-destructive/10 px-4 py-2 text-sm text-destructive",children:l}),e.jsxs(s.Button,{className:"w-full",variant:"outline",onClick:()=>{window.location.href=t},children:[e.jsx(W,{className:"h-5 w-5 mr-2"}),o]})]})]})})}function _({children:t}){const{fetchJson:n}=s.useImaginariumApi(),r=d.Config.get("ImaginariumApp","userPath","/auth/user"),{isPending:o,isError:i}=b.useQuery({queryKey:["imaginarium","auth","user",r],queryFn:()=>n(r),retry:!1,refetchOnWindowFocus:!1});if(o)return e.jsx("div",{className:"p-8 text-muted-foreground",children:"Checking sign-in…"});if(i){const a=d.Config.get("ImaginariumApp","loginPage",E),l=d.Config.get("ImaginariumApp","loginTitle",void 0),u=d.Config.get("ImaginariumApp","loginSubtitle",void 0),p=d.Config.get("ImaginariumApp","loginButtonLabel",void 0),v=d.Config.get("ImaginariumApp","loginPath","/api/login"),h=d.Config.get("ImaginariumApp","loginBackgroundUrl",void 0),B=d.Config.get("ImaginariumApp","title","Imaginarium"),L=l??`Sign in to ${B}`;return f.createElement(a,{loginPath:v,title:L,subtitle:u,buttonLabel:p,backgroundUrl:h})}return e.jsx(e.Fragment,{children:t})}const X=new b.QueryClient({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function Y({title:t,titleIcon:n,navRightSlot:r,shellFallback:o,children:i}){return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(R,{title:t,titleIcon:n,rightSlot:r}),e.jsx(P,{fallback:o,children:i})]})}function Z({apiBaseUrl:t="/api",queryClient:n,title:r,titleIcon:o,navRightSlot:i,shellFallback:a,children:l}){const u=f.useMemo(()=>n??X,[n]),p=d.Config.get("ImaginariumApp","requireAuth",!0),v=o??d.Config.get("ImaginariumApp","titleIcon",void 0),h=e.jsx(Y,{title:r,titleIcon:v,navRightSlot:i,shellFallback:a,children:l});return e.jsx(b.QueryClientProvider,{client:u,children:e.jsx(I,{children:e.jsxs(s.ImaginariumApiProvider,{apiBaseUrl:t,children:[p?e.jsx(_,{children:h}):h,e.jsx(z,{})]})})})}exports.AppNav=R;exports.ImaginariumApp=Z;exports.LoginPage=E;exports.RequireAuth=_;exports.Shell=P;exports.Toast=N;exports.ToastAction=S;exports.ToastClose=T;exports.ToastDescription=A;exports.ToastProvider=q;exports.ToastTitle=C;exports.ToastViewport=w;exports.Toaster=z;exports.Tooltip=Q;exports.TooltipContent=k;exports.TooltipProvider=I;exports.TooltipTrigger=H;
|
|
2
|
+
//# sourceMappingURL=ImaginariumApp-DoCgiASz.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImaginariumApp-DoCgiASz.cjs","sources":["../src/shell/Shell.tsx","../src/shell/AppNav.tsx","../src/components/ui/Tooltip.tsx","../src/components/ui/Toast.tsx","../src/components/ui/Toaster.tsx","../src/auth/LoginPage.tsx","../src/auth/RequireAuth.tsx","../src/shell/ImaginariumApp.tsx"],"sourcesContent":["import { isValidElement, createElement, type ReactNode } from 'react'\nimport { Route, Switch } from 'wouter'\n\nimport { getPages, getProviders } from '../plugins/registry'\nimport type { PagePlugin } from '../plugins/types'\n\nfunction renderPageElement( plugin: PagePlugin ): ReactNode {\n const { element } = plugin\n if ( isValidElement( element ) ) { return element }\n if ( typeof element === 'function' ) {\n return createElement( element as React.ComponentType )\n }\n return element as ReactNode\n}\n\nexport interface ShellProps {\n fallback?: ReactNode\n children?: ReactNode\n}\n\nexport function Shell( { fallback, children }: ShellProps ) {\n const pages = getPages()\n const providers = getProviders()\n\n let tree: ReactNode = (\n <Switch>\n {pages.map( ( page ) => (\n <Route key={page.path} path={page.path}>\n {renderPageElement( page )}\n </Route>\n ) )}\n <Route>{fallback ?? <div className=\"p-8 text-muted-foreground\">Not found</div>}</Route>\n </Switch>\n )\n\n for ( const { component: Provider } of providers ) {\n tree = <Provider>{tree}</Provider>\n }\n\n return (\n <main className=\"container mx-auto px-4 py-6\">\n {children}\n {tree}\n </main>\n )\n}\n","import type { ComponentType } from 'react'\nimport { Link, useLocation } from 'wouter'\n\nimport { Button } from '../components/ui/Button'\nimport { getNavItems } from '../plugins/registry'\n\n/**\n * Accepted icon forms (anywhere we render an inline icon):\n * - React component: `Settings` from lucide-react\n * - URL string: `/logo.png`, `https://...`, `data:image/...`, `blob:...`\n * - CSS class string: `fa-solid fa-gear`, `material-icons` (rendered on a <span>)\n */\nexport type IconRef = ComponentType<{ className?: string }> | string\n\nexport interface AppNavProps {\n title?: string\n titleIcon?: IconRef\n rightSlot?: React.ReactNode\n}\n\nconst URL_RE = /^(https?:|data:|blob:|\\/|\\.\\/|\\.\\.\\/)/\n\nfunction renderIcon( icon: IconRef | undefined, className: string ) {\n if ( !icon ) { return null }\n if ( typeof icon === 'string' ) {\n if ( URL_RE.test( icon ) ) {\n return <img src={icon} alt=\"\" className={className} />\n }\n return <span className={`${icon} ${className}`} aria-hidden=\"true\" />\n }\n const Icon = icon\n return <Icon className={className} />\n}\n\nexport function AppNav( { title = 'Imaginarium', titleIcon, rightSlot }: AppNavProps ) {\n const [ location ] = useLocation()\n const items = getNavItems()\n\n return (\n <nav className=\"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 sticky top-0 z-50\">\n <div className=\"container mx-auto flex h-14 items-center px-4\">\n <div className=\"mr-8 flex items-center gap-2 font-semibold text-lg\">\n {renderIcon( titleIcon, 'h-6 w-6' )}\n <span>{title}</span>\n </div>\n <div className=\"flex items-center gap-1\">\n {items.map( ( { label, path, icon: Icon } ) => {\n const isActive = location === path || location.startsWith( `${path}/` )\n return (\n <Link key={path} href={path}>\n <Button variant={isActive ? 'secondary' : 'ghost'} size=\"sm\" className=\"gap-2\">\n {Icon ? <Icon className=\"h-4 w-4\" /> : null}\n {label}\n </Button>\n </Link>\n )\n } )}\n </div>\n {rightSlot ? <div className=\"ml-auto flex items-center gap-2\">{rightSlot}</div> : null}\n </div>\n </nav>\n )\n}\n","import * as React from 'react'\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip'\n\nimport { cn } from '../../lib/utils'\n\nconst TooltipProvider = TooltipPrimitive.Provider\nconst Tooltip = TooltipPrimitive.Root\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>( ( { className, sideOffset = 4, ...props }, ref ) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95',\n className,\n )}\n {...props}\n />\n) )\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n","import * as React from 'react'\nimport * as ToastPrimitives from '@radix-ui/react-toast'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { X } from 'lucide-react'\n\nimport { cn } from '../../lib/utils'\n\nconst ToastProvider = ToastPrimitives.Provider\n\nconst ToastViewport = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Viewport>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>\n>( ( { className, ...props }, ref ) => (\n <ToastPrimitives.Viewport\n ref={ref}\n className={cn(\n 'fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]',\n className,\n )}\n {...props}\n />\n) )\nToastViewport.displayName = ToastPrimitives.Viewport.displayName\n\nconst toastVariants = cva(\n 'group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full',\n {\n variants: {\n variant: {\n default: 'border bg-background text-foreground',\n destructive: 'destructive group border-destructive bg-destructive text-destructive-foreground',\n },\n },\n defaultVariants: { variant: 'default' },\n },\n)\n\nconst Toast = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> & VariantProps<typeof toastVariants>\n>( ( { className, variant, ...props }, ref ) => (\n <ToastPrimitives.Root ref={ref} className={cn( toastVariants( { variant } ), className )} {...props} />\n) )\nToast.displayName = ToastPrimitives.Root.displayName\n\nconst ToastAction = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Action>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>( ( { className, ...props }, ref ) => (\n <ToastPrimitives.Action\n ref={ref}\n className={cn(\n 'inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',\n className,\n )}\n {...props}\n />\n) )\nToastAction.displayName = ToastPrimitives.Action.displayName\n\nconst ToastClose = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Close>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>( ( { className, ...props }, ref ) => (\n <ToastPrimitives.Close\n ref={ref}\n className={cn(\n 'absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100',\n className,\n )}\n toast-close=\"\"\n {...props}\n >\n <X className=\"h-4 w-4\" />\n </ToastPrimitives.Close>\n) )\nToastClose.displayName = ToastPrimitives.Close.displayName\n\nconst ToastTitle = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Title>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>\n>( ( { className, ...props }, ref ) => (\n <ToastPrimitives.Title ref={ref} className={cn( 'text-sm font-semibold', className )} {...props} />\n) )\nToastTitle.displayName = ToastPrimitives.Title.displayName\n\nconst ToastDescription = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Description>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>\n>( ( { className, ...props }, ref ) => (\n <ToastPrimitives.Description ref={ref} className={cn( 'text-sm opacity-90', className )} {...props} />\n) )\nToastDescription.displayName = ToastPrimitives.Description.displayName\n\nexport type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>\nexport type ToastActionElement = React.ReactElement<typeof ToastAction>\n\nexport {\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\n}\n","import { useToast } from '../../hooks/useToast'\nimport {\n Toast,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n} from './Toast'\n\nexport function Toaster() {\n const { toasts } = useToast()\n\n return (\n <ToastProvider>\n {toasts.map( ( { id, title, description, action, ...props } ) => (\n <Toast key={id} {...props}>\n <div className=\"grid gap-1\">\n {title && <ToastTitle>{title}</ToastTitle>}\n {description && <ToastDescription>{description}</ToastDescription>}\n </div>\n {action}\n <ToastClose />\n </Toast>\n ) )}\n <ToastViewport />\n </ToastProvider>\n )\n}\n","import { Button } from '../components/ui/Button'\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from '../components/ui/Card'\n\nexport interface LoginPageProps {\n loginPath: string\n title?: string\n subtitle?: string\n buttonLabel?: string\n /** URL of an image to show behind the sign-in card. Empty/null skips it. */\n backgroundUrl?: string\n /** Optional message shown above the button (e.g. an error from a failed prior attempt). */\n errorMessage?: string\n}\n\nfunction GoogleGlyph( { className }: { className?: string } ) {\n return (\n <svg viewBox=\"0 0 24 24\" className={className} aria-hidden=\"true\">\n <path fill=\"#4285F4\" d=\"M23.49 12.27c0-.79-.07-1.54-.19-2.27H12v4.51h6.16c-.27 1.4-1.04 2.59-2.21 3.41v2.77h3.59c2.08-1.92 3.95-4.74 3.95-8.42z\" />\n <path fill=\"#34A853\" d=\"M12 24c2.97 0 5.46-.98 7.28-2.66l-3.59-2.77c-.98.66-2.23 1.06-3.69 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 21.53 7.7 24 12 24z\" />\n <path fill=\"#FBBC05\" d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\" />\n <path fill=\"#EA4335\" d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\" />\n </svg>\n )\n}\n\nconst ERROR_MESSAGES: Record<string, string> = {\n auth_failed : 'Sign-in failed. Please try again.',\n}\n\nfunction readUrlError(): string | undefined {\n if ( typeof window === 'undefined' ) { return undefined }\n const code = new URLSearchParams( window.location.search ).get( 'error' )\n if ( !code ) { return undefined }\n return ERROR_MESSAGES[code] ?? `Sign-in error: ${code}`\n}\n\nexport function LoginPage( {\n loginPath,\n title = 'Sign in',\n subtitle,\n buttonLabel = 'Sign in with Google',\n backgroundUrl,\n errorMessage,\n}: LoginPageProps ) {\n const message = errorMessage ?? readUrlError()\n const hasBackground = Boolean( backgroundUrl )\n\n return (\n <div\n className=\"min-h-screen flex items-center justify-center bg-background bg-cover bg-center px-4\"\n style={hasBackground ? { backgroundImage: `url(${backgroundUrl})` } : undefined}\n >\n <Card className={`w-full max-w-md ${hasBackground ? 'backdrop-blur-sm bg-card/90' : ''}`}>\n <CardHeader className=\"text-center\">\n <CardTitle>{title}</CardTitle>\n {subtitle && <CardDescription>{subtitle}</CardDescription>}\n </CardHeader>\n <CardContent className=\"space-y-4\">\n {message && (\n <div className=\"rounded-md border border-destructive bg-destructive/10 px-4 py-2 text-sm text-destructive\">\n {message}\n </div>\n )}\n <Button\n className=\"w-full\"\n variant=\"outline\"\n onClick={() => { window.location.href = loginPath }}\n >\n <GoogleGlyph className=\"h-5 w-5 mr-2\" />\n {buttonLabel}\n </Button>\n </CardContent>\n </Card>\n </div>\n )\n}\n\nexport default LoginPage\n","import { createElement, type ComponentType, type ReactNode } from 'react'\nimport { useQuery } from '@tanstack/react-query'\nimport { Config } from '@leverege/plugin'\n\nimport { useImaginariumApi } from '../api/ImaginariumApiContext'\nimport { LoginPage, type LoginPageProps } from './LoginPage'\n\nexport interface RequireAuthProps {\n children: ReactNode\n}\n\n/**\n * Wraps `children` with an authentication gate. On mount, fetches\n * `Config.get('ImaginariumApp', 'userPath', '/auth/user')` from the configured\n * API base URL. While loading, renders a small placeholder. On error, renders\n * the configured login component (defaults to the bundled `LoginPage`). On\n * success, renders `children`.\n *\n * Recognized config keys (under `'ImaginariumApp'`):\n * - `userPath` endpoint to check (default `/auth/user`)\n * - `loginPath` URL the login button navigates to (default `/api/login`)\n * - `loginPage` component to render when unauthenticated\n * - `loginTitle` default page heading\n * - `loginSubtitle` default page subtitle\n * - `loginButtonLabel` default button label\n * - `loginBackgroundUrl` URL of an image to show behind the sign-in card\n */\nexport function RequireAuth( { children }: RequireAuthProps ) {\n const { fetchJson } = useImaginariumApi()\n const userPath = Config.get<string>( 'ImaginariumApp', 'userPath', '/auth/user' )\n\n const { isPending, isError } = useQuery( {\n queryKey: [ 'imaginarium', 'auth', 'user', userPath ],\n queryFn: () => fetchJson( userPath ),\n retry: false,\n refetchOnWindowFocus: false,\n } )\n\n if ( isPending ) {\n return <div className=\"p-8 text-muted-foreground\">Checking sign-in…</div>\n }\n\n if ( isError ) {\n const LoginComponent = Config.get<ComponentType<LoginPageProps>>(\n 'ImaginariumApp', 'loginPage', LoginPage,\n )\n const title = Config.get<string | undefined>( 'ImaginariumApp', 'loginTitle', undefined )\n const subtitle = Config.get<string | undefined>( 'ImaginariumApp', 'loginSubtitle', undefined )\n const buttonLabel = Config.get<string | undefined>(\n 'ImaginariumApp', 'loginButtonLabel', undefined,\n )\n const loginPath = Config.get<string>( 'ImaginariumApp', 'loginPath', '/api/login' )\n const backgroundUrl = Config.get<string | undefined>(\n 'ImaginariumApp', 'loginBackgroundUrl', undefined,\n )\n\n const appTitle = Config.get<string>( 'ImaginariumApp', 'title', 'Imaginarium' )\n const resolvedTitle = title ?? `Sign in to ${appTitle}`\n\n return createElement( LoginComponent, {\n loginPath,\n title: resolvedTitle,\n subtitle,\n buttonLabel,\n backgroundUrl,\n } )\n }\n\n return <>{children}</>\n}\n\nexport default RequireAuth\n","import { useMemo, type ReactNode } from 'react'\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query'\nimport { Config } from '@leverege/plugin'\n\nimport { TooltipProvider } from '../components/ui/Tooltip'\nimport { Toaster } from '../components/ui/Toaster'\nimport { ImaginariumApiProvider } from '../api/ImaginariumApiContext'\nimport { RequireAuth } from '../auth/RequireAuth'\nimport { AppNav, type AppNavProps, type IconRef } from './AppNav'\nimport { Shell, type ShellProps } from './Shell'\n\nexport interface ImaginariumAppProps {\n apiBaseUrl?: string\n queryClient?: QueryClient\n title?: string\n titleIcon?: IconRef\n navRightSlot?: AppNavProps['rightSlot']\n shellFallback?: ShellProps['fallback']\n children?: ReactNode\n}\n\nconst defaultQueryClient = new QueryClient( {\n defaultOptions: {\n queries: { retry: false, refetchOnWindowFocus: false },\n },\n} )\n\nfunction GatedShell( { title, titleIcon, navRightSlot, shellFallback, children }: {\n title?: string\n titleIcon?: IconRef\n navRightSlot?: AppNavProps['rightSlot']\n shellFallback?: ShellProps['fallback']\n children?: ReactNode\n} ) {\n return (\n <div className=\"min-h-screen bg-background text-foreground\">\n <AppNav title={title} titleIcon={titleIcon} rightSlot={navRightSlot} />\n <Shell fallback={shellFallback}>{children}</Shell>\n </div>\n )\n}\n\nexport function ImaginariumApp( {\n apiBaseUrl = '/api',\n queryClient,\n title,\n titleIcon,\n navRightSlot,\n shellFallback,\n children,\n}: ImaginariumAppProps ) {\n const qc = useMemo( () => queryClient ?? defaultQueryClient, [ queryClient ] )\n const requireAuth = Config.get<boolean>( 'ImaginariumApp', 'requireAuth', true )\n const resolvedTitleIcon = titleIcon\n ?? Config.get<IconRef | undefined>( 'ImaginariumApp', 'titleIcon', undefined )\n\n const gated = (\n <GatedShell\n title={title}\n titleIcon={resolvedTitleIcon}\n navRightSlot={navRightSlot}\n shellFallback={shellFallback}\n >\n {children}\n </GatedShell>\n )\n\n return (\n <QueryClientProvider client={qc}>\n <TooltipProvider>\n <ImaginariumApiProvider apiBaseUrl={apiBaseUrl}>\n {requireAuth ? <RequireAuth>{gated}</RequireAuth> : gated}\n <Toaster />\n </ImaginariumApiProvider>\n </TooltipProvider>\n </QueryClientProvider>\n )\n}\n"],"names":["renderPageElement","plugin","element","isValidElement","createElement","Shell","fallback","children","pages","getPages","providers","getProviders","tree","Switch","page","jsx","Route","Provider","jsxs","URL_RE","renderIcon","icon","className","Icon","AppNav","title","titleIcon","rightSlot","location","useLocation","items","getNavItems","label","path","isActive","Link","Button","TooltipProvider","TooltipPrimitive","Tooltip","TooltipTrigger","TooltipContent","React","sideOffset","props","ref","cn","ToastProvider","ToastPrimitives","ToastViewport","toastVariants","cva","Toast","variant","ToastAction","ToastClose","X","ToastTitle","ToastDescription","Toaster","toasts","useToast","id","description","action","GoogleGlyph","ERROR_MESSAGES","readUrlError","code","LoginPage","loginPath","subtitle","buttonLabel","backgroundUrl","errorMessage","message","hasBackground","Card","CardHeader","CardTitle","CardDescription","CardContent","RequireAuth","fetchJson","useImaginariumApi","userPath","Config","isPending","isError","useQuery","LoginComponent","appTitle","resolvedTitle","defaultQueryClient","QueryClient","GatedShell","navRightSlot","shellFallback","ImaginariumApp","apiBaseUrl","queryClient","qc","useMemo","requireAuth","resolvedTitleIcon","gated","QueryClientProvider","Imagin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ACb,SAAA,CAAAH,EAAAA,IAACS,EAAA,CAAO,MAAAC,EAAc,UAAAC,EAAsB,UAAWsE,EAAc,EACrEjF,EAAAA,IAACV,EAAA,CAAM,SAAU4F,EAAgB,SAAA1F,CAAA,CAAS,CAAA,EAC5C,CAEJ,CAEO,SAAS2F,EAAgB,CAC9B,WAAAC,EAAa,OACb,YAAAC,EACA,MAAA3E,EACA,UAAAC,EACA,aAAAsE,EACA,cAAAC,EACA,SAAA1F,CACF,EAAyB,CACvB,MAAM8F,EAAKC,EAAAA,QAAS,IAAMF,GAAeP,EAAoB,CAAEO,CAAY,CAAE,EACvEG,EAAcjB,EAAAA,OAAO,IAAc,iBAAkB,cAAe,EAAK,EACzEkB,EAAoB9E,GACrB4D,EAAAA,OAAO,IAA0B,iBAAkB,YAAa,MAAU,EAEzEmB,EACJ1F,EAAAA,IAACgF,EAAA,CACC,MAAAtE,EACA,UAAW+E,EACX,aAAAR,EACA,cAAAC,EAEC,SAAA1F,CAAA,CAAA,EAIL,OACEQ,EAAAA,IAAC2F,EAAAA,qBAAoB,OAAQL,EAC3B,eAAChE,EAAA,CACC,SAAAnB,EAAAA,KAACyF,EAAAA,wBAAuB,WAAAR,EACrB,SAAA,CAAAI,EAAcxF,EAAAA,IAACmE,EAAA,CAAa,SAAAuB,CAAA,CAAM,EAAiBA,QACnD9C,EAAA,CAAA,CAAQ,CAAA,CAAA,CACX,EACF,EACF,CAEJ"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
type Mutator = (type: string, plugin: unknown) => unknown | null;
|
|
2
|
+
export interface ImaginariumUIConfig {
|
|
3
|
+
/** Plugin ids that should be filtered out at registration time. */
|
|
4
|
+
excludes?: string[];
|
|
5
|
+
/** Mutator functions appended to `Plugins.addMutator` after the excludes wrapper. */
|
|
6
|
+
mutators?: Mutator[];
|
|
7
|
+
/**
|
|
8
|
+
* Resource → key/value map that is bulk-loaded into `@leverege/plugin`'s
|
|
9
|
+
* `Config` before any plugins install. Each `cfg.config[resource][key]`
|
|
10
|
+
* becomes `Config.set( resource, key, value )`.
|
|
11
|
+
*/
|
|
12
|
+
config?: Record<string, Record<string, unknown>>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Public bootstrap surface for an Imaginarium UI consumer.
|
|
16
|
+
*
|
|
17
|
+
* import { ImaginariumUI } from '@leverege/imaginarium-ui'
|
|
18
|
+
* import Config from './Config'
|
|
19
|
+
* import PluginSetup from './PluginSetup'
|
|
20
|
+
*
|
|
21
|
+
* ImaginariumUI.init( Config.create( opts ), PluginSetup )
|
|
22
|
+
* ImaginariumUI.create()
|
|
23
|
+
*/
|
|
24
|
+
export declare const ImaginariumUI: {
|
|
25
|
+
/**
|
|
26
|
+
* Loads Config values, registers excludes + mutators, then installs the
|
|
27
|
+
* built-in plugin setups followed by the consumer's `userPluginSetup`.
|
|
28
|
+
* Order is fixed: Config → excludes → mutators → built-ins → user setup.
|
|
29
|
+
*/
|
|
30
|
+
init(cfg: ImaginariumUIConfig | undefined | null, userPluginSetup: any): void;
|
|
31
|
+
/**
|
|
32
|
+
* Mounts `<ImaginariumApp />` into the DOM. Reads:
|
|
33
|
+
* - `ImaginariumApp.rootElement` (default `'#root'`) — selector or HTMLElement
|
|
34
|
+
* - `ImaginariumApp.apiBaseUrl` (default `'/api'`)
|
|
35
|
+
* - `ImaginariumApp.title` (default `'Imaginarium'`)
|
|
36
|
+
*/
|
|
37
|
+
create(): void;
|
|
38
|
+
};
|
|
39
|
+
export default ImaginariumUI;
|
|
40
|
+
//# sourceMappingURL=ImaginariumUI.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImaginariumUI.d.ts","sourceRoot":"","sources":["../src/ImaginariumUI.tsx"],"names":[],"mappings":"AAMA,KAAK,OAAO,GAAG,CAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAM,OAAO,GAAG,IAAI,CAAA;AAElE,MAAM,WAAW,mBAAmB;IAClC,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;IACpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACjD;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa;IAExB;;;;OAIG;cACQ,mBAAmB,GAAG,SAAS,GAAG,IAAI;IAqCjD;;;;;OAKG;;CAeJ,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const j=require("@leverege/plugin"),K=require("./PluginTypes-DOX3G1ip.cjs"),e=require("react/jsx-runtime"),I=require("react"),f=require("@tanstack/react-query"),p=require("lucide-react"),n=require("./Card-Z-6q-k3a.cjs"),te=require("@radix-ui/react-dialog"),se=require("@radix-ui/react-label"),ae=require("class-variance-authority");function F(s){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const o in s)if(o!=="default"){const c=Object.getOwnPropertyDescriptor(s,o);Object.defineProperty(i,o,c.get?c:{enumerable:!0,get:()=>s[o]})}}return i.default=s,Object.freeze(i)}const h=F(I),r=F(te),B=F(se),_=r.Root,ie=r.Trigger,z=r.Portal,ne=r.Close,A=h.forwardRef(({className:s,...i},o)=>e.jsx(r.Overlay,{ref:o,className:n.cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...i}));A.displayName=r.Overlay.displayName;const R=h.forwardRef(({className:s,children:i,...o},c)=>e.jsxs(z,{children:[e.jsx(A,{}),e.jsxs(r.Content,{ref:c,className:n.cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",s),...o,children:[i,e.jsxs(r.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(p.X,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));R.displayName=r.Content.displayName;const E=({className:s,...i})=>e.jsx("div",{className:n.cn("flex flex-col space-y-1.5 text-center sm:text-left",s),...i});E.displayName="DialogHeader";const L=({className:s,...i})=>e.jsx("div",{className:n.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...i});L.displayName="DialogFooter";const q=h.forwardRef(({className:s,...i},o)=>e.jsx(r.Title,{ref:o,className:n.cn("text-lg font-semibold leading-none tracking-tight",s),...i}));q.displayName=r.Title.displayName;const M=h.forwardRef(({className:s,...i},o)=>e.jsx(r.Description,{ref:o,className:n.cn("text-sm text-muted-foreground",s),...i}));M.displayName=r.Description.displayName;const m=h.forwardRef(({className:s,type:i,...o},c)=>e.jsx("input",{type:i,className:n.cn("flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),ref:c,...o}));m.displayName="Input";const oe=ae.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=h.forwardRef(({className:s,...i},o)=>e.jsx(B.Root,{ref:o,className:n.cn(oe(),s),...i}));d.displayName=B.Root.displayName;const U={displayName:"",apiKey:"",secret:"",projectId:"",systemId:"",baseUrl:"",audience:"",type:"",metadata:""};function Q({apiPath:s,title:i="Imagine Systems",subtitle:o="Manage Imagine API configurations for different systems",dialogDescription:c="Configure your Imagine API credentials."}={}){const g=s??j.Config.get("ImagineSystemConfig","apiPath","/configs"),{toast:u}=n.useToast(),{fetchJson:v}=n.useImaginariumApi(),C=f.useQueryClient(),[H,N]=I.useState(!1),[x,P]=I.useState(null),[a,l]=I.useState(U),b=["imaginarium","system-configs",g],{data:D,isLoading:V}=f.useQuery({queryKey:b,queryFn:async()=>{const t=await v(g);return Array.isArray(t)?t:(t==null?void 0:t.items)??[]}}),w=f.useMutation({mutationFn:t=>v(g,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{C.invalidateQueries({queryKey:b}),u({title:"Success",description:"System Configuration created successfully"}),T()},onError:t=>{u({title:"Error",description:t.message,variant:"destructive"})}}),O=f.useMutation({mutationFn:({id:t,data:k})=>v(`${g}/${t}`,{method:"PATCH",body:JSON.stringify(k)}),onSuccess:()=>{C.invalidateQueries({queryKey:b}),u({title:"Success",description:"System Configuration updated successfully"}),T()},onError:t=>{u({title:"Error",description:t.message,variant:"destructive"})}}),$=f.useMutation({mutationFn:t=>v(`${g}/${t}`,{method:"DELETE"}),onSuccess:()=>{C.invalidateQueries({queryKey:b}),u({title:"Success",description:"System Configuration deleted successfully"})},onError:t=>{u({title:"Error",description:t.message,variant:"destructive"})}}),J=()=>{P(null),l(U),N(!0)},W=t=>{P(t),l({displayName:t.displayName,apiKey:t.apiKey,secret:"",projectId:t.projectId,systemId:t.systemId,baseUrl:t.baseUrl,audience:t.audience??"",type:t.type??"",metadata:t.metadata?JSON.stringify(t.metadata,null,2):""}),N(!0)},T=()=>{N(!1),P(null)},X=()=>{const{metadata:t,type:k,...ee}=a;return{...ee,type:k.trim()||null,metadata:t.trim()?JSON.parse(t):null}},Y=()=>{let t;try{t=X()}catch{u({title:"Invalid metadata",description:"Metadata must be valid JSON",variant:"destructive"});return}x?(a.secret.trim()||delete t.secret,O.mutate({id:x.id,data:t})):w.mutate(t)},G=t=>{window.confirm("Are you sure you want to delete this system configuration?")&&$.mutate(t)},Z=!!(a.displayName.trim()&&a.apiKey.trim()&&(x||a.secret.trim())&&a.projectId.trim()&&a.systemId.trim()&&a.baseUrl.trim());return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-semibold",children:i}),e.jsx("p",{className:"text-sm text-muted-foreground",children:o})]}),e.jsxs(n.Button,{onClick:J,children:[e.jsx(p.Plus,{className:"w-4 h-4 mr-2"}),"Add System"]})]}),V?e.jsx("div",{className:"text-center text-muted-foreground",children:"Loading system configurations..."}):D&&D.length>0?e.jsx("div",{className:"grid gap-4",children:D.map(t=>e.jsxs(n.Card,{children:[e.jsx(n.CardHeader,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(n.CardTitle,{children:t.displayName}),e.jsxs(n.CardDescription,{children:["Project: ",t.projectId," | System: ",t.systemId]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(n.Button,{variant:"ghost",size:"icon",onClick:()=>W(t),children:e.jsx(p.Pencil,{className:"w-4 h-4"})}),e.jsx(n.Button,{variant:"ghost",size:"icon",onClick:()=>G(t.id),children:e.jsx(p.Trash2,{className:"w-4 h-4"})})]})]})}),e.jsx(n.CardContent,{className:"space-y-2",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Base URL:"}),e.jsx("div",{className:"font-mono text-xs mt-1",children:t.baseUrl})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"API Key:"}),e.jsx("div",{className:"font-mono text-xs mt-1",children:t.apiKey})]}),t.audience&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Audience:"}),e.jsx("div",{className:"font-mono text-xs mt-1",children:t.audience})]}),t.type&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Type:"}),e.jsx("div",{className:"font-mono text-xs mt-1",children:t.type})]}),t.metadata&&e.jsxs("div",{className:"col-span-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"Metadata:"}),e.jsx("pre",{className:"font-mono text-xs mt-1 whitespace-pre-wrap",children:JSON.stringify(t.metadata,null,2)})]})]})})]},t.id))}):e.jsx(n.Card,{children:e.jsxs(n.CardContent,{className:"py-12 text-center",children:[e.jsx("p",{className:"text-muted-foreground mb-4",children:"No systems yet"}),e.jsxs(n.Button,{onClick:J,children:[e.jsx(p.Plus,{className:"w-4 h-4 mr-2"}),"Add Your First System"]})]})}),e.jsx(_,{open:H,onOpenChange:N,children:e.jsxs(R,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(E,{children:[e.jsx(q,{children:x?"Edit System":"New System"}),e.jsx(M,{children:c})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"display-name",children:"Display Name"}),e.jsx(m,{id:"display-name",value:a.displayName,onChange:t=>l({...a,displayName:t.target.value}),placeholder:"Production - Customer Name"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"base-url",children:"Base URL"}),e.jsx(m,{id:"base-url",type:"url",value:a.baseUrl,onChange:t=>l({...a,baseUrl:t.target.value}),placeholder:"https://prd-customer-imagine-api.leverege.com",className:"font-mono"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"project-id",children:"Project ID"}),e.jsx(m,{id:"project-id",value:a.projectId,onChange:t=>l({...a,projectId:t.target.value}),placeholder:"proj123",className:"font-mono"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"system-id",children:"System ID"}),e.jsx(m,{id:"system-id",value:a.systemId,onChange:t=>l({...a,systemId:t.target.value}),placeholder:"sys456",className:"font-mono"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"api-key",children:"API Key"}),e.jsx(m,{id:"api-key",value:a.apiKey,onChange:t=>l({...a,apiKey:t.target.value}),placeholder:"Enter API key (JWT issuer)",className:"font-mono"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This will be used as the JWT issuer (iss claim)"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"secret",children:"API Secret"}),e.jsx(m,{id:"secret",type:"password",value:a.secret,onChange:t=>l({...a,secret:t.target.value}),placeholder:x?"Leave blank to keep current secret":"Enter API secret",className:"font-mono"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["The Imagine API secret. It will be encrypted before storage.",x&&" Leave blank to keep the existing secret."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"audience",children:"Audience (Optional)"}),e.jsx(m,{id:"audience",value:a.audience,onChange:t=>l({...a,audience:t.target.value}),placeholder:"Auto-extracted from base URL if not provided",className:"font-mono"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"type",children:"Type (Optional)"}),e.jsx(m,{id:"type",value:a.type,onChange:t=>l({...a,type:t.target.value}),placeholder:"imagine",className:"font-mono"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"metadata",children:"Metadata (Optional)"}),e.jsx("textarea",{id:"metadata",value:a.metadata,onChange:t=>l({...a,metadata:t.target.value}),placeholder:'{ "region": "us-central1" }',rows:5,className:"flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm font-mono ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"JSON object stored alongside the config. Leave empty to clear."})]})]}),e.jsxs(L,{children:[e.jsxs(n.Button,{variant:"outline",onClick:T,children:[e.jsx(p.X,{className:"w-4 h-4 mr-2"}),"Cancel"]}),e.jsxs(n.Button,{onClick:Y,disabled:!Z||w.isPending||O.isPending,children:[e.jsx(p.Save,{className:"w-4 h-4 mr-2"}),w.isPending||O.isPending?"Saving...":"Save System"]})]})]})})]})}const S={id:"imaginarium.ImagineSystemPage",path:"/system-config",element:Q},y={id:"imaginarium.ImagineSystemNavItem",path:"/system-config",label:"Imagine Systems",sort:100,icon:p.Settings},re=S.id,le=y.id,de={install(s){const i=j.Config.get("ImagineSystemConfig","path",S.path),o=j.Config.get("ImagineSystemConfig","navLabel",y.label),c=j.Config.get("ImagineSystemConfig","navSort",y.sort),g=j.Config.get("ImagineSystemConfig","navIcon",y.icon),u=g===null?void 0:g;s.addPlugin(K.PageType,{...S,path:i}),s.addPlugin(K.NavItemType,{...y,path:i,label:o,sort:c,icon:u})}};exports.Dialog=_;exports.DialogClose=ne;exports.DialogContent=R;exports.DialogDescription=M;exports.DialogFooter=L;exports.DialogHeader=E;exports.DialogOverlay=A;exports.DialogPortal=z;exports.DialogTitle=q;exports.DialogTrigger=ie;exports.ImagineSystemNavItem=y;exports.ImagineSystemNavItemId=le;exports.ImagineSystemPage=S;exports.ImagineSystemPageId=re;exports.ImagineSystemView=Q;exports.Input=m;exports.Label=d;exports.SystemPluginSetup=de;
|
|
2
|
+
//# sourceMappingURL=PluginSetup-Cauc3iMv.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginSetup-Cauc3iMv.cjs","sources":["../src/components/ui/Dialog.tsx","../src/components/ui/Input.tsx","../src/components/ui/Label.tsx","../src/system/ImagineSystemView.tsx","../src/system/ImagineSystemPage.tsx","../src/system/ImagineSystemNavItem.ts","../src/system/PluginSetup.ts"],"sourcesContent":["import * as React from 'react'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\nimport { X } from 'lucide-react'\n\nimport { cn } from '../../lib/utils'\n\nconst Dialog = DialogPrimitive.Root\nconst DialogTrigger = DialogPrimitive.Trigger\nconst DialogPortal = DialogPrimitive.Portal\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>( ( { className, ...props }, ref ) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n className,\n )}\n {...props}\n />\n) )\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>( ( { className, children, ...props }, ref ) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg',\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n) )\nDialogContent.displayName = DialogPrimitive.Content.displayName\n\nconst DialogHeader = ( { className, ...props }: React.HTMLAttributes<HTMLDivElement> ) => (\n <div\n className={cn( 'flex flex-col space-y-1.5 text-center sm:text-left', className )}\n {...props}\n />\n)\nDialogHeader.displayName = 'DialogHeader'\n\nconst DialogFooter = ( { className, ...props }: React.HTMLAttributes<HTMLDivElement> ) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',\n className,\n )}\n {...props}\n />\n)\nDialogFooter.displayName = 'DialogFooter'\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>( ( { className, ...props }, ref ) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn( 'text-lg font-semibold leading-none tracking-tight', className )}\n {...props}\n />\n) )\nDialogTitle.displayName = DialogPrimitive.Title.displayName\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>( ( { className, ...props }, ref ) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn( 'text-sm text-muted-foreground', className )}\n {...props}\n />\n) )\nDialogDescription.displayName = DialogPrimitive.Description.displayName\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n}\n","import * as React from 'react'\n\nimport { cn } from '../../lib/utils'\n\nconst Input = React.forwardRef<HTMLInputElement, React.ComponentProps<'input'>>(\n ( { className, type, ...props }, ref ) => {\n return (\n <input\n type={type}\n className={cn(\n 'flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n className,\n )}\n ref={ref}\n {...props}\n />\n )\n },\n)\nInput.displayName = 'Input'\n\nexport { Input }\n","import * as React from 'react'\nimport * as LabelPrimitive from '@radix-ui/react-label'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../../lib/utils'\n\nconst labelVariants = cva(\n 'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n)\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>\n>( ( { className, ...props }, ref ) => (\n <LabelPrimitive.Root ref={ref} className={cn( labelVariants(), className )} {...props} />\n) )\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n","import { useState } from 'react'\nimport { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'\nimport { Plus, Pencil, Trash2, Save, X } from 'lucide-react'\nimport { Config } from '@leverege/plugin'\n\nimport { Button } from '../components/ui/Button'\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from '../components/ui/Card'\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from '../components/ui/Dialog'\nimport { Input } from '../components/ui/Input'\nimport { Label } from '../components/ui/Label'\nimport { useToast } from '../hooks/useToast'\nimport { useImaginariumApi } from '../api/ImaginariumApiContext'\nimport type {\n ImagineSystemConfig,\n ImagineSystemConfigListResponse,\n} from './types'\n\ninterface ConfigFormData {\n displayName: string\n apiKey: string\n secret: string\n projectId: string\n systemId: string\n baseUrl: string\n audience: string\n type: string\n metadata: string\n}\n\nconst EMPTY_FORM: ConfigFormData = {\n displayName: '',\n apiKey: '',\n secret: '',\n projectId: '',\n systemId: '',\n baseUrl: '',\n audience: '',\n type: '',\n metadata: '',\n}\n\nexport interface ImagineSystemViewProps {\n /**\n * API path (relative to apiBaseUrl). When omitted, falls back to\n * `Config.get('ImagineSystemConfig', 'apiPath', '/configs')`.\n */\n apiPath?: string\n title?: string\n subtitle?: string\n dialogDescription?: string\n}\n\nexport default function ImagineSystemView( {\n apiPath: apiPathProp,\n title = 'Imagine Systems',\n subtitle = 'Manage Imagine API configurations for different systems',\n dialogDescription = 'Configure your Imagine API credentials.',\n}: ImagineSystemViewProps = {} ) {\n const apiPath = apiPathProp\n ?? Config.get<string>( 'ImagineSystemConfig', 'apiPath', '/configs' )\n const { toast } = useToast()\n const { fetchJson } = useImaginariumApi()\n const queryClient = useQueryClient()\n const [ isDialogOpen, setIsDialogOpen ] = useState( false )\n const [ editingConfig, setEditingConfig ] = useState<ImagineSystemConfig | null>( null )\n const [ formData, setFormData ] = useState<ConfigFormData>( EMPTY_FORM )\n\n const queryKey = [ 'imaginarium', 'system-configs', apiPath ] as const\n\n const { data: configs, isLoading } = useQuery<ImagineSystemConfig[]>( {\n queryKey,\n queryFn: async () => {\n const res = await fetchJson<ImagineSystemConfigListResponse | ImagineSystemConfig[]>( apiPath )\n return Array.isArray( res ) ? res : ( res?.items ?? [] )\n },\n } )\n\n const createMutation = useMutation( {\n mutationFn: ( data: Record<string, unknown> ) =>\n fetchJson( apiPath, { method: 'POST', body: JSON.stringify( data ) } ),\n onSuccess: () => {\n queryClient.invalidateQueries( { queryKey } )\n toast( { title: 'Success', description: 'System Configuration created successfully' } )\n closeDialog()\n },\n onError: ( error: Error ) => {\n toast( { title: 'Error', description: error.message, variant: 'destructive' } )\n },\n } )\n\n const updateMutation = useMutation( {\n mutationFn: ( { id, data }: { id: number; data: Record<string, unknown> } ) =>\n fetchJson( `${apiPath}/${id}`, { method: 'PATCH', body: JSON.stringify( data ) } ),\n onSuccess: () => {\n queryClient.invalidateQueries( { queryKey } )\n toast( { title: 'Success', description: 'System Configuration updated successfully' } )\n closeDialog()\n },\n onError: ( error: Error ) => {\n toast( { title: 'Error', description: error.message, variant: 'destructive' } )\n },\n } )\n\n const deleteMutation = useMutation( {\n mutationFn: ( id: number ) => fetchJson( `${apiPath}/${id}`, { method: 'DELETE' } ),\n onSuccess: () => {\n queryClient.invalidateQueries( { queryKey } )\n toast( { title: 'Success', description: 'System Configuration deleted successfully' } )\n },\n onError: ( error: Error ) => {\n toast( { title: 'Error', description: error.message, variant: 'destructive' } )\n },\n } )\n\n const openCreateDialog = () => {\n setEditingConfig( null )\n setFormData( EMPTY_FORM )\n setIsDialogOpen( true )\n }\n\n const openEditDialog = ( config: ImagineSystemConfig ) => {\n setEditingConfig( config )\n setFormData( {\n displayName: config.displayName,\n apiKey: config.apiKey,\n secret: '',\n projectId: config.projectId,\n systemId: config.systemId,\n baseUrl: config.baseUrl,\n audience: config.audience ?? '',\n type: config.type ?? '',\n metadata: config.metadata ? JSON.stringify( config.metadata, null, 2 ) : '',\n } )\n setIsDialogOpen( true )\n }\n\n const closeDialog = () => {\n setIsDialogOpen( false )\n setEditingConfig( null )\n }\n\n const buildPayload = (): Record<string, unknown> => {\n const { metadata, type, ...rest } = formData\n return {\n ...rest,\n type: type.trim() || null,\n metadata: metadata.trim() ? JSON.parse( metadata ) : null,\n }\n }\n\n const handleSubmit = () => {\n let payload: Record<string, unknown>\n try {\n payload = buildPayload()\n } catch {\n toast( {\n title: 'Invalid metadata',\n description: 'Metadata must be valid JSON',\n variant: 'destructive',\n } )\n return\n }\n if ( editingConfig ) {\n if ( !formData.secret.trim() ) { delete payload.secret }\n updateMutation.mutate( { id: editingConfig.id, data: payload } )\n } else {\n createMutation.mutate( payload )\n }\n }\n\n const handleDelete = ( id: number ) => {\n if ( window.confirm( 'Are you sure you want to delete this system configuration?' ) ) {\n deleteMutation.mutate( id )\n }\n }\n\n const isFormValid = Boolean(\n formData.displayName.trim()\n && formData.apiKey.trim()\n && ( editingConfig || formData.secret.trim() )\n && formData.projectId.trim()\n && formData.systemId.trim()\n && formData.baseUrl.trim(),\n )\n\n return (\n <div className=\"space-y-6\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h2 className=\"text-2xl font-semibold\">{title}</h2>\n <p className=\"text-sm text-muted-foreground\">{subtitle}</p>\n </div>\n <Button onClick={openCreateDialog}>\n <Plus className=\"w-4 h-4 mr-2\" />\n Add System\n </Button>\n </div>\n\n {isLoading ? (\n <div className=\"text-center text-muted-foreground\">Loading system configurations...</div>\n ) : configs && configs.length > 0 ? (\n <div className=\"grid gap-4\">\n {configs.map( ( config ) => (\n <Card key={config.id}>\n <CardHeader>\n <div className=\"flex items-center justify-between\">\n <div>\n <CardTitle>{config.displayName}</CardTitle>\n <CardDescription>\n Project: {config.projectId} | System: {config.systemId}\n </CardDescription>\n </div>\n <div className=\"flex gap-2\">\n <Button variant=\"ghost\" size=\"icon\" onClick={() => openEditDialog( config )}>\n <Pencil className=\"w-4 h-4\" />\n </Button>\n <Button variant=\"ghost\" size=\"icon\" onClick={() => handleDelete( config.id )}>\n <Trash2 className=\"w-4 h-4\" />\n </Button>\n </div>\n </div>\n </CardHeader>\n <CardContent className=\"space-y-2\">\n <div className=\"grid grid-cols-2 gap-4 text-sm\">\n <div>\n <span className=\"text-muted-foreground\">Base URL:</span>\n <div className=\"font-mono text-xs mt-1\">{config.baseUrl}</div>\n </div>\n <div>\n <span className=\"text-muted-foreground\">API Key:</span>\n <div className=\"font-mono text-xs mt-1\">{config.apiKey}</div>\n </div>\n {config.audience && (\n <div>\n <span className=\"text-muted-foreground\">Audience:</span>\n <div className=\"font-mono text-xs mt-1\">{config.audience}</div>\n </div>\n )}\n {config.type && (\n <div>\n <span className=\"text-muted-foreground\">Type:</span>\n <div className=\"font-mono text-xs mt-1\">{config.type}</div>\n </div>\n )}\n {config.metadata && (\n <div className=\"col-span-2\">\n <span className=\"text-muted-foreground\">Metadata:</span>\n <pre className=\"font-mono text-xs mt-1 whitespace-pre-wrap\">\n {JSON.stringify( config.metadata, null, 2 )}\n </pre>\n </div>\n )}\n </div>\n </CardContent>\n </Card>\n ) )}\n </div>\n ) : (\n <Card>\n <CardContent className=\"py-12 text-center\">\n <p className=\"text-muted-foreground mb-4\">No systems yet</p>\n <Button onClick={openCreateDialog}>\n <Plus className=\"w-4 h-4 mr-2\" />\n Add Your First System\n </Button>\n </CardContent>\n </Card>\n )}\n\n <Dialog open={isDialogOpen} onOpenChange={setIsDialogOpen}>\n <DialogContent className=\"max-w-2xl max-h-[90vh] overflow-y-auto\">\n <DialogHeader>\n <DialogTitle>\n {editingConfig ? 'Edit System' : 'New System'}\n </DialogTitle>\n <DialogDescription>{dialogDescription}</DialogDescription>\n </DialogHeader>\n\n <div className=\"space-y-4 py-4\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"display-name\">Display Name</Label>\n <Input\n id=\"display-name\"\n value={formData.displayName}\n onChange={( e ) => setFormData( { ...formData, displayName: e.target.value } )}\n placeholder=\"Production - Customer Name\"\n />\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"base-url\">Base URL</Label>\n <Input\n id=\"base-url\"\n type=\"url\"\n value={formData.baseUrl}\n onChange={( e ) => setFormData( { ...formData, baseUrl: e.target.value } )}\n placeholder=\"https://prd-customer-imagine-api.leverege.com\"\n className=\"font-mono\"\n />\n </div>\n\n <div className=\"grid grid-cols-2 gap-4\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"project-id\">Project ID</Label>\n <Input\n id=\"project-id\"\n value={formData.projectId}\n onChange={( e ) => setFormData( { ...formData, projectId: e.target.value } )}\n placeholder=\"proj123\"\n className=\"font-mono\"\n />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"system-id\">System ID</Label>\n <Input\n id=\"system-id\"\n value={formData.systemId}\n onChange={( e ) => setFormData( { ...formData, systemId: e.target.value } )}\n placeholder=\"sys456\"\n className=\"font-mono\"\n />\n </div>\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"api-key\">API Key</Label>\n <Input\n id=\"api-key\"\n value={formData.apiKey}\n onChange={( e ) => setFormData( { ...formData, apiKey: e.target.value } )}\n placeholder=\"Enter API key (JWT issuer)\"\n className=\"font-mono\"\n />\n <p className=\"text-xs text-muted-foreground\">\n This will be used as the JWT issuer (iss claim)\n </p>\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"secret\">API Secret</Label>\n <Input\n id=\"secret\"\n type=\"password\"\n value={formData.secret}\n onChange={( e ) => setFormData( { ...formData, secret: e.target.value } )}\n placeholder={editingConfig ? 'Leave blank to keep current secret' : 'Enter API secret'}\n className=\"font-mono\"\n />\n <p className=\"text-xs text-muted-foreground\">\n The Imagine API secret. It will be encrypted before storage.\n {editingConfig && ' Leave blank to keep the existing secret.'}\n </p>\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"audience\">Audience (Optional)</Label>\n <Input\n id=\"audience\"\n value={formData.audience}\n onChange={( e ) => setFormData( { ...formData, audience: e.target.value } )}\n placeholder=\"Auto-extracted from base URL if not provided\"\n className=\"font-mono\"\n />\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"type\">Type (Optional)</Label>\n <Input\n id=\"type\"\n value={formData.type}\n onChange={( e ) => setFormData( { ...formData, type: e.target.value } )}\n placeholder=\"imagine\"\n className=\"font-mono\"\n />\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"metadata\">Metadata (Optional)</Label>\n <textarea\n id=\"metadata\"\n value={formData.metadata}\n onChange={( e ) => setFormData( { ...formData, metadata: e.target.value } )}\n placeholder='{ \"region\": \"us-central1\" }'\n rows={5}\n className=\"flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm font-mono ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\"\n />\n <p className=\"text-xs text-muted-foreground\">\n JSON object stored alongside the config. Leave empty to clear.\n </p>\n </div>\n </div>\n\n <DialogFooter>\n <Button variant=\"outline\" onClick={closeDialog}>\n <X className=\"w-4 h-4 mr-2\" />\n Cancel\n </Button>\n <Button\n onClick={handleSubmit}\n disabled={!isFormValid || createMutation.isPending || updateMutation.isPending}\n >\n <Save className=\"w-4 h-4 mr-2\" />\n {createMutation.isPending || updateMutation.isPending ? 'Saving...' : 'Save System'}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n </div>\n )\n}\n","import ImagineSystemView from './ImagineSystemView'\n\nexport default {\n id : 'imaginarium.ImagineSystemPage',\n path : '/system-config',\n element : ImagineSystemView,\n}\n","import { Settings } from 'lucide-react'\n\nexport default {\n id : 'imaginarium.ImagineSystemNavItem',\n path : '/system-config',\n label : 'Imagine Systems',\n sort : 100,\n icon : Settings,\n}\n","import { Config } from '@leverege/plugin'\n\nimport { NavItemType, PageType } from '../plugins/PluginTypes'\nimport ImagineSystemPage from './ImagineSystemPage'\nimport ImagineSystemNavItem from './ImagineSystemNavItem'\n\nexport const ImagineSystemPageId = ImagineSystemPage.id\nexport const ImagineSystemNavItemId = ImagineSystemNavItem.id\n\ninterface RegistryLike {\n addPlugin( type: string, plugin: unknown ): unknown\n}\n\n/**\n * Self-installs the ImagineSystem CRUD page + nav item, layering in any values\n * set under the `'ImagineSystemConfig'` Config resource on top of the static\n * defaults declared in `ImagineSystemPage` and `ImagineSystemNavItem`.\n *\n * Recognized config keys:\n * - `path` route path for the page (default `/system-config`)\n * - `apiPath` API path the view hits (default `/configs`; consumed by the view)\n * - `navLabel` nav button label (default `'Imagine Systems'`)\n * - `navSort` nav ordering (default `100`)\n * - `navIcon` lucide-react icon component (default `Settings`); set to\n * `null` to render no icon\n */\nexport const SystemPluginSetup = {\n install( plg: RegistryLike ) {\n const path = Config.get<string>(\n 'ImagineSystemConfig', 'path', ImagineSystemPage.path,\n )\n const label = Config.get<string>(\n 'ImagineSystemConfig', 'navLabel', ImagineSystemNavItem.label,\n )\n const sort = Config.get<number>(\n 'ImagineSystemConfig', 'navSort', ImagineSystemNavItem.sort,\n )\n const iconSetting = Config.get<typeof ImagineSystemNavItem.icon | null>(\n 'ImagineSystemConfig', 'navIcon', ImagineSystemNavItem.icon,\n )\n const icon = iconSetting === null ? undefined : iconSetting\n\n plg.addPlugin( PageType, {\n ...ImagineSystemPage,\n path,\n } )\n plg.addPlugin( NavItemType, {\n ...ImagineSystemNavItem,\n path,\n label,\n sort,\n icon,\n } )\n },\n}\n\nexport default SystemPluginSetup\n"],"names":["Dialog","DialogPrimitive","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","React","className","props","ref","jsx","cn","DialogContent","children","jsxs","X","DialogHeader","DialogFooter","DialogTitle","DialogDescription","Input","type","labelVariants","cva","Label","LabelPrimitive","EMPTY_FORM","ImagineSystemView","apiPathProp","title","subtitle","dialogDescription","apiPath","Config","toast","useToast","fetchJson","useImaginariumApi","queryClient","useQueryClient","isDialogOpen","setIsDialogOpen","useState","editingConfig","setEditingConfig","formData","setFormData","queryKey","configs","isLoading","useQuery","res","createMutation","useMutation","data","closeDialog","error","updateMutation","id","deleteMutation","openCreateDialog","openEditDialog","config","buildPayload","metadata","rest","handleSubmit","payload","handleDelete","isFormValid","Button","Plus","Card","CardHeader","CardTitle","CardDescription","Pencil","Trash2","CardContent","e","Save","ImagineSystemPage","ImagineSystemNavItem","Settings","ImagineSystemPageId","ImagineSystemNavItemId","SystemPluginSetup","plg","path","label","sort","iconSetting","icon","PageType","NavItemType"],"mappings":"moBAMMA,EAASC,EAAgB,KACzBC,GAAgBD,EAAgB,QAChCE,EAAeF,EAAgB,OAC/BG,GAAcH,EAAgB,MAE9BI,EAAgBC,EAAM,WAGzB,CAAE,CAAE,UAAAC,EAAW,GAAGC,CAAA,EAASC,IAC5BC,EAAAA,IAACT,EAAgB,QAAhB,CACC,IAAAQ,EACA,UAAWE,EAAAA,GACT,yJACAJ,CAAA,EAED,GAAGC,CAAA,CACN,CACA,EACFH,EAAc,YAAcJ,EAAgB,QAAQ,YAEpD,MAAMW,EAAgBN,EAAM,WAGzB,CAAE,CAAE,UAAAC,EAAW,SAAAM,EAAU,GAAGL,CAAA,EAASC,IACtCK,EAAAA,KAACX,EAAA,CACC,SAAA,CAAAO,EAAAA,IAACL,EAAA,EAAc,EACfS,EAAAA,KAACb,EAAgB,QAAhB,CACC,IAAAQ,EACA,UAAWE,EAAAA,GACT,sVACAJ,CAAA,EAED,GAAGC,EAEH,SAAA,CAAAK,EACDC,EAAAA,KAACb,EAAgB,MAAhB,CAAsB,UAAU,gRAC/B,SAAA,CAAAS,EAAAA,I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