@leverege/imaginarium-ui 1.1.0 → 1.2.0
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/lib/ImaginariumApp-B7Vlrxfd.cjs +2 -0
- package/lib/ImaginariumApp-B7Vlrxfd.cjs.map +1 -0
- package/lib/{ImaginariumApp-DEMR2myC.js → ImaginariumApp-DJ0f2GWB.js} +106 -123
- package/lib/ImaginariumApp-DJ0f2GWB.js.map +1 -0
- package/lib/PluginSetup-3m6kjRze.cjs +2 -0
- package/lib/PluginSetup-3m6kjRze.cjs.map +1 -0
- package/lib/{PluginSetup-DeyrRyw0.cjs → PluginSetup-CQPpS_Js.cjs} +2 -2
- package/lib/{PluginSetup-DeyrRyw0.cjs.map → PluginSetup-CQPpS_Js.cjs.map} +1 -1
- package/lib/PluginSetup-Co-WnS3V.js.map +1 -1
- package/lib/PluginSetup-NL8jYfpN.js +429 -0
- package/lib/PluginSetup-NL8jYfpN.js.map +1 -0
- package/lib/PluginSetup-RmtTRKtb.js +2143 -0
- package/lib/PluginSetup-RmtTRKtb.js.map +1 -0
- package/lib/PluginSetup-TAIbWrod.cjs +5 -0
- package/lib/PluginSetup-TAIbWrod.cjs.map +1 -0
- package/lib/PluginSetup.d.ts.map +1 -1
- package/lib/SystemConfigsContext-D0hXRSH-.js +128 -0
- package/lib/SystemConfigsContext-D0hXRSH-.js.map +1 -0
- package/lib/SystemConfigsContext-yOuS10VO.cjs +2 -0
- package/lib/SystemConfigsContext-yOuS10VO.cjs.map +1 -0
- package/lib/Tooltip-CIwKmgzA.js +24 -0
- package/lib/Tooltip-CIwKmgzA.js.map +1 -0
- package/lib/Tooltip-DQn1fHhM.cjs +2 -0
- package/lib/Tooltip-DQn1fHhM.cjs.map +1 -0
- package/lib/imp/PluginSetup.d.ts +7 -0
- package/lib/imp/PluginSetup.d.ts.map +1 -0
- package/lib/imp/release/ClusterSelect.d.ts +13 -0
- package/lib/imp/release/ClusterSelect.d.ts.map +1 -0
- package/lib/imp/release/CreateReleaseModal.d.ts +8 -0
- package/lib/imp/release/CreateReleaseModal.d.ts.map +1 -0
- package/lib/imp/release/DiffColumn.d.ts +9 -0
- package/lib/imp/release/DiffColumn.d.ts.map +1 -0
- package/lib/imp/release/DiffPanel.d.ts +11 -0
- package/lib/imp/release/DiffPanel.d.ts.map +1 -0
- package/lib/imp/release/EntityTag.d.ts +5 -0
- package/lib/imp/release/EntityTag.d.ts.map +1 -0
- package/lib/imp/release/IgnoreButton.d.ts +19 -0
- package/lib/imp/release/IgnoreButton.d.ts.map +1 -0
- package/lib/imp/release/IgnoredPill.d.ts +10 -0
- package/lib/imp/release/IgnoredPill.d.ts.map +1 -0
- package/lib/imp/release/IgnoredTab.d.ts +11 -0
- package/lib/imp/release/IgnoredTab.d.ts.map +1 -0
- package/lib/imp/release/PluginSetup.d.ts +7 -0
- package/lib/imp/release/PluginSetup.d.ts.map +1 -0
- package/lib/imp/release/PreviouslySkippedBadge.d.ts +12 -0
- package/lib/imp/release/PreviouslySkippedBadge.d.ts.map +1 -0
- package/lib/imp/release/PushButton.d.ts +15 -0
- package/lib/imp/release/PushButton.d.ts.map +1 -0
- package/lib/imp/release/PushDialog.d.ts +21 -0
- package/lib/imp/release/PushDialog.d.ts.map +1 -0
- package/lib/imp/release/ReleaseDetail.d.ts +6 -0
- package/lib/imp/release/ReleaseDetail.d.ts.map +1 -0
- package/lib/imp/release/ReleaseDiffPanel.d.ts +53 -0
- package/lib/imp/release/ReleaseDiffPanel.d.ts.map +1 -0
- package/lib/imp/release/ReleaseList.d.ts +5 -0
- package/lib/imp/release/ReleaseList.d.ts.map +1 -0
- package/lib/imp/release/ReleaseNavItem.d.ts +9 -0
- package/lib/imp/release/ReleaseNavItem.d.ts.map +1 -0
- package/lib/imp/release/ReleasePage.d.ts +8 -0
- package/lib/imp/release/ReleasePage.d.ts.map +1 -0
- package/lib/imp/release/ReleaseView.d.ts +2 -0
- package/lib/imp/release/ReleaseView.d.ts.map +1 -0
- package/lib/imp/release/ResetExclusionsButton.d.ts +15 -0
- package/lib/imp/release/ResetExclusionsButton.d.ts.map +1 -0
- package/lib/imp/release/RuleVersionSelect.d.ts +23 -0
- package/lib/imp/release/RuleVersionSelect.d.ts.map +1 -0
- package/lib/imp/release/StatusBadge.d.ts +6 -0
- package/lib/imp/release/StatusBadge.d.ts.map +1 -0
- package/lib/imp/release/StatusMatrix.d.ts +7 -0
- package/lib/imp/release/StatusMatrix.d.ts.map +1 -0
- package/lib/imp/release/Toggle.d.ts +7 -0
- package/lib/imp/release/Toggle.d.ts.map +1 -0
- package/lib/imp/release/TranslationsTab.d.ts +9 -0
- package/lib/imp/release/TranslationsTab.d.ts.map +1 -0
- package/lib/imp/release/dependencies.d.ts +29 -0
- package/lib/imp/release/dependencies.d.ts.map +1 -0
- package/lib/imp/release/exclusionSummary.d.ts +15 -0
- package/lib/imp/release/exclusionSummary.d.ts.map +1 -0
- package/lib/imp/release/index.d.ts +47 -0
- package/lib/imp/release/index.d.ts.map +1 -0
- package/lib/imp/release/itemFilters.d.ts +15 -0
- package/lib/imp/release/itemFilters.d.ts.map +1 -0
- package/lib/imp/release/itemTree.d.ts +38 -0
- package/lib/imp/release/itemTree.d.ts.map +1 -0
- package/lib/imp/release/jsonLineDiff.d.ts +22 -0
- package/lib/imp/release/jsonLineDiff.d.ts.map +1 -0
- package/lib/imp/release/pushResults.d.ts +21 -0
- package/lib/imp/release/pushResults.d.ts.map +1 -0
- package/lib/imp/release/typeOrder.d.ts +5 -0
- package/lib/imp/release/typeOrder.d.ts.map +1 -0
- package/lib/imp/release/types.d.ts +139 -0
- package/lib/imp/release/types.d.ts.map +1 -0
- package/lib/index.cjs +1 -1
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +132 -124
- package/lib/index.js.map +1 -1
- package/lib/release.cjs +2 -0
- package/lib/release.cjs.map +1 -0
- package/lib/release.js +87 -0
- package/lib/release.js.map +1 -0
- package/lib/secret/PluginSetup.d.ts +2 -2
- package/lib/secret/PluginSetup.d.ts.map +1 -1
- package/lib/secret/index.d.ts +1 -1
- package/lib/secret/index.d.ts.map +1 -1
- package/lib/secret.cjs +1 -1
- package/lib/secret.js +1 -1
- package/lib/shell.cjs +1 -1
- package/lib/shell.js +1 -1
- package/lib/system/PluginSetup.d.ts +2 -2
- package/lib/system/PluginSetup.d.ts.map +1 -1
- package/lib/system/index.d.ts +2 -2
- package/lib/system/index.d.ts.map +1 -1
- package/lib/system.cjs +1 -1
- package/lib/system.js +7 -6
- package/lib/system.js.map +1 -1
- package/lib/theme/tailwind-preset.cjs +1 -1
- package/lib/theme/tailwind-preset.cjs.map +1 -1
- package/lib/theme/tailwind-preset.d.ts.map +1 -1
- package/lib/theme/tailwind-preset.js +6 -2
- package/lib/theme/tailwind-preset.js.map +1 -1
- package/package.json +6 -1
- package/src/PluginSetup.ts +6 -4
- package/src/imp/PluginSetup.ts +9 -0
- package/src/imp/release/ClusterSelect.tsx +33 -0
- package/src/imp/release/CreateReleaseModal.tsx +197 -0
- package/src/imp/release/DiffColumn.tsx +34 -0
- package/src/imp/release/DiffPanel.tsx +44 -0
- package/src/imp/release/EntityTag.tsx +37 -0
- package/src/imp/release/IgnoreButton.tsx +125 -0
- package/src/imp/release/IgnoredPill.tsx +24 -0
- package/src/imp/release/IgnoredTab.tsx +138 -0
- package/src/imp/release/PluginSetup.ts +13 -0
- package/src/imp/release/PreviouslySkippedBadge.tsx +43 -0
- package/src/imp/release/PushButton.tsx +92 -0
- package/src/imp/release/PushDialog.tsx +244 -0
- package/src/imp/release/ReleaseDetail.tsx +833 -0
- package/src/imp/release/ReleaseDiffPanel.tsx +261 -0
- package/src/imp/release/ReleaseList.tsx +139 -0
- package/src/imp/release/ReleaseNavItem.ts +9 -0
- package/src/imp/release/ReleasePage.tsx +7 -0
- package/src/imp/release/ReleaseView.tsx +129 -0
- package/src/imp/release/ResetExclusionsButton.tsx +60 -0
- package/src/imp/release/RuleVersionSelect.tsx +52 -0
- package/src/imp/release/StatusBadge.tsx +18 -0
- package/src/imp/release/StatusMatrix.tsx +409 -0
- package/src/imp/release/Toggle.tsx +28 -0
- package/src/imp/release/TranslationsTab.tsx +293 -0
- package/src/imp/release/dependencies.ts +77 -0
- package/src/imp/release/exclusionSummary.ts +34 -0
- package/src/imp/release/index.ts +62 -0
- package/src/imp/release/itemFilters.ts +31 -0
- package/src/imp/release/itemTree.ts +154 -0
- package/src/imp/release/jsonLineDiff.ts +66 -0
- package/src/imp/release/pushResults.ts +53 -0
- package/src/imp/release/typeOrder.ts +20 -0
- package/src/imp/release/types.ts +148 -0
- package/src/index.ts +1 -1
- package/src/secret/PluginSetup.ts +2 -2
- package/src/secret/index.ts +1 -1
- package/src/system/PluginSetup.ts +2 -2
- package/src/system/index.ts +2 -2
- package/src/theme/tailwind-preset.ts +4 -0
- package/lib/ImaginariumApp-DEMR2myC.js.map +0 -1
- package/lib/ImaginariumApp-QhW4atF3.cjs +0 -2
- package/lib/ImaginariumApp-QhW4atF3.cjs.map +0 -1
- package/lib/PluginSetup-4wfp3och.js +0 -548
- package/lib/PluginSetup-4wfp3och.js.map +0 -1
- package/lib/PluginSetup-C__oYc79.cjs +0 -2
- package/lib/PluginSetup-C__oYc79.cjs.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),m=require("react"),A=require("@tanstack/react-query"),f=require("@leverege/plugin"),F=require("./Tooltip-DQn1fHhM.cjs"),i=require("./Card-CHVaz_7u.cjs"),Q=require("@radix-ui/react-toast"),H=require("class-variance-authority"),C=require("lucide-react"),y=require("./registry-CHzOVHAg.cjs"),h=require("wouter");function O(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const v=O(m),d=O(Q);function U(t){const{element:r}=t;return m.isValidElement(r)?r:typeof r=="function"?m.createElement(r):r}function L({fallback:t,children:r}){const n=y.getPages();return e.jsxs("main",{className:"flex-1 overflow-y-auto px-6 py-6",children:[r,e.jsxs(h.Switch,{children:[n.map(o=>e.jsx(h.Route,{path:o.path,children:U(o)},o.path)),e.jsx(h.Route,{children:t??e.jsx("div",{className:"p-8 text-muted-foreground",children:"Not found"})})]})]})}function W(t){const r=[],n=new Map;for(const s of t){if(!s.section){r.push(s);continue}n.has(s.section)||n.set(s.section,{label:s.section,sectionSort:s.sectionSort??s.sort??0,items:[]}),n.get(s.section).items.push(s)}r.sort((s,c)=>(s.sort??0)-(c.sort??0));const o=Array.from(n.values());for(const s of o)s.items.sort((c,l)=>(c.sort??0)-(l.sort??0));return o.sort((s,c)=>{const l=s.sectionSort-c.sectionSort;return l!==0?l:s.label.localeCompare(c.label)}),{ungrouped:r,sections:o}}const E="imaginarium.ui.sidebar.collapsed",B="imaginarium.ui.sidebar.sections";function J(t,r){try{const n=localStorage.getItem(t);return n===null?r:n==="true"}catch{return r}}function K(){try{const t=localStorage.getItem(B);if(!t)return new Set;const r=JSON.parse(t);return new Set(Array.isArray(r)?r:[])}catch{return new Set}}const X=/^(https?:|data:|blob:|\/|\.\/|\.\.\/)/;function Y(t,r){if(!t)return null;if(typeof t=="string")return X.test(t)?e.jsx("img",{src:t,alt:"",className:r}):e.jsx("span",{className:`${t} ${r}`,"aria-hidden":"true"});const n=t;return e.jsx(n,{className:r})}function _({title:t="Imaginarium",titleIcon:r,rightSlot:n}){const[o]=h.useLocation(),[s,c]=m.useState(()=>J(E,!1)),[l,g]=m.useState(K);m.useEffect(()=>{try{localStorage.setItem(E,String(s))}catch{}},[s]),m.useEffect(()=>{try{localStorage.setItem(B,JSON.stringify(Array.from(l)))}catch{}},[l]);const j=m.useCallback(()=>c(a=>!a),[]),b=m.useCallback(a=>{g(p=>{const u=new Set(p);return u.has(a)?u.delete(a):u.add(a),u})},[]),{ungrouped:x,sections:N}=W(y.getNavItems()),S=y.getTopBarItems();return e.jsxs("aside",{className:i.cn("flex flex-col flex-shrink-0 border-r bg-background transition-[width] duration-200 ease-in-out overflow-hidden",s?"w-[52px]":"w-[220px]"),children:[e.jsxs("div",{className:"flex h-[52px] flex-shrink-0 items-center border-b px-2.5 gap-2",children:[!s&&Y(r,"h-6 w-6"),!s&&e.jsx("span",{className:"flex-1 truncate text-sm font-semibold",children:t}),e.jsx("button",{onClick:j,"aria-label":s?"Expand sidebar":"Collapse sidebar",className:i.cn("flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md border text-muted-foreground","hover:bg-accent hover:text-accent-foreground transition-colors",s&&"mx-auto border-transparent"),children:e.jsx(C.ChevronLeft,{className:i.cn("h-4 w-4 transition-transform duration-200",s&&"rotate-180")})})]}),e.jsxs("nav",{className:"flex flex-1 flex-col gap-0.5 overflow-y-auto overflow-x-hidden p-1.5",children:[x.map(({path:a,label:p,icon:u})=>{const w=o===a||o.startsWith(`${a}/`);return e.jsxs(h.Link,{href:a,title:s?p:void 0,className:i.cn("relative flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground","hover:bg-accent hover:text-accent-foreground transition-colors whitespace-nowrap",w&&"bg-accent/50 text-accent-foreground font-medium",s&&"justify-center px-2"),children:[u&&e.jsx(u,{className:"h-4 w-4 flex-shrink-0"}),!s&&e.jsx("span",{children:p})]},a)}),N.map(a=>{const p=!s&&l.has(a.label);return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"my-1.5 h-px bg-border"}),!s&&e.jsxs("button",{onClick:()=>b(a.label),className:i.cn("flex items-center justify-between px-2 pb-1 pt-2.5","text-[10px] font-semibold uppercase tracking-widest text-muted-foreground","hover:text-foreground transition-colors cursor-pointer rounded-sm"),children:[a.label,e.jsx(C.ChevronDown,{className:i.cn("h-3 w-3 transition-transform duration-200",p&&"-rotate-90")})]}),e.jsx("div",{className:i.cn("flex flex-col gap-0.5 overflow-hidden transition-all duration-200",p?"max-h-0 opacity-0":"max-h-screen opacity-100"),children:a.items.map(({path:u,label:w,icon:q})=>{const z=o===u||o.startsWith(`${u}/`);return e.jsxs(h.Link,{href:u,title:s?w:void 0,className:i.cn("relative flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground","hover:bg-accent hover:text-accent-foreground transition-colors whitespace-nowrap",z&&"bg-accent/50 text-accent-foreground font-medium",s&&"justify-center px-2"),children:[q&&e.jsx(q,{className:"h-4 w-4 flex-shrink-0"}),!s&&e.jsx("span",{children:w})]},u)})})]},a.label)})]}),e.jsxs("div",{className:i.cn("flex flex-shrink-0 items-center border-t p-1.5",s?"flex-col gap-1":"flex-row justify-end gap-0.5"),children:[!s&&n,S.map(a=>{const p=a.component;return e.jsx(p,{},a.id)})]})]})}const D=d.Provider,T=v.forwardRef(({className:t,...r},n)=>e.jsx(d.Viewport,{ref:n,className:i.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),...r}));T.displayName=d.Viewport.displayName;const Z=H.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"}}),I=v.forwardRef(({className:t,variant:r,...n},o)=>e.jsx(d.Root,{ref:o,className:i.cn(Z({variant:r}),t),...n}));I.displayName=d.Root.displayName;const M=v.forwardRef(({className:t,...r},n)=>e.jsx(d.Action,{ref:n,className:i.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),...r}));M.displayName=d.Action.displayName;const k=v.forwardRef(({className:t,...r},n)=>e.jsx(d.Close,{ref:n,className:i.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":"",...r,children:e.jsx(C.X,{className:"h-4 w-4"})}));k.displayName=d.Close.displayName;const P=v.forwardRef(({className:t,...r},n)=>e.jsx(d.Title,{ref:n,className:i.cn("text-sm font-semibold",t),...r}));P.displayName=d.Title.displayName;const R=v.forwardRef(({className:t,...r},n)=>e.jsx(d.Description,{ref:n,className:i.cn("text-sm opacity-90",t),...r}));R.displayName=d.Description.displayName;function V(){const{toasts:t}=i.useToast();return e.jsxs(D,{children:[t.map(({id:r,title:n,description:o,action:s,...c})=>e.jsxs(I,{...c,children:[e.jsxs("div",{className:"grid gap-1",children:[n&&e.jsx(P,{children:n}),o&&e.jsx(R,{children:o})]}),s,e.jsx(k,{})]},r)),e.jsx(T,{})]})}function ee({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 te={auth_failed:"Sign-in failed. Please try again."};function re(){if(typeof window>"u")return;const t=new URLSearchParams(window.location.search).get("error");if(t)return te[t]??`Sign-in error: ${t}`}function $({loginPath:t,title:r="Sign in",subtitle:n,buttonLabel:o="Sign in with Google",backgroundUrl:s,errorMessage:c}){const l=c??re(),g=!!s;return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background bg-cover bg-center px-4",style:g?{backgroundImage:`url(${s})`}:void 0,children:e.jsxs(i.Card,{className:`w-full max-w-md ${g?"backdrop-blur-sm bg-card/90":""}`,children:[e.jsxs(i.CardHeader,{className:"text-center",children:[e.jsx(i.CardTitle,{children:r}),n&&e.jsx(i.CardDescription,{children:n})]}),e.jsxs(i.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(i.Button,{className:"w-full",variant:"outline",onClick:()=>{window.location.href=t},children:[e.jsx(ee,{className:"h-5 w-5 mr-2"}),o]})]})]})})}function G({children:t}){const{fetchJson:r}=i.useImaginariumApi(),n=f.Config.get("ImaginariumApp","userPath","/auth/user"),{isPending:o,isError:s}=A.useQuery({queryKey:["imaginarium","auth","user",n],queryFn:()=>r(n),retry:!1,refetchOnWindowFocus:!1});if(o)return e.jsx("div",{className:"p-8 text-muted-foreground",children:"Checking sign-in…"});if(s){const c=f.Config.get("ImaginariumApp","loginPage",$),l=f.Config.get("ImaginariumApp","loginTitle",void 0),g=f.Config.get("ImaginariumApp","loginSubtitle",void 0),j=f.Config.get("ImaginariumApp","loginButtonLabel",void 0),b=f.Config.get("ImaginariumApp","loginPath","/api/login"),x=f.Config.get("ImaginariumApp","loginBackgroundUrl",void 0),N=f.Config.get("ImaginariumApp","title","Imaginarium"),S=l??`Sign in to ${N}`;return m.createElement(c,{loginPath:b,title:S,subtitle:g,buttonLabel:j,backgroundUrl:x})}return e.jsx(e.Fragment,{children:t})}function ne(t){const r=y.getProviders();let n=t;for(const{component:o}of r)n=e.jsx(o,{children:n});return n}const se=new A.QueryClient({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function oe({title:t,titleIcon:r,navRightSlot:n,shellFallback:o,children:s}){return ne(e.jsxs("div",{className:"flex min-h-screen bg-background text-foreground",children:[e.jsx(_,{title:t,titleIcon:r,rightSlot:n}),e.jsx(L,{fallback:o,children:s})]}))}function ie({apiBaseUrl:t="/api",queryClient:r,title:n,titleIcon:o,navRightSlot:s,shellFallback:c,children:l}){const g=m.useMemo(()=>r??se,[r]),j=f.Config.get("ImaginariumApp","requireAuth",!0),b=o??f.Config.get("ImaginariumApp","titleIcon",void 0),x=e.jsx(oe,{title:n,titleIcon:b,navRightSlot:s,shellFallback:c,children:l});return e.jsx(A.QueryClientProvider,{client:g,children:e.jsx(F.TooltipProvider,{children:e.jsxs(i.ImaginariumApiProvider,{apiBaseUrl:t,children:[j?e.jsx(G,{children:x}):x,e.jsx(V,{})]})})})}exports.AppSidebar=_;exports.ImaginariumApp=ie;exports.LoginPage=$;exports.RequireAuth=G;exports.Shell=L;exports.Toast=I;exports.ToastAction=M;exports.ToastClose=k;exports.ToastDescription=R;exports.ToastProvider=D;exports.ToastTitle=P;exports.ToastViewport=T;exports.Toaster=V;
|
|
2
|
+
//# sourceMappingURL=ImaginariumApp-B7Vlrxfd.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImaginariumApp-B7Vlrxfd.cjs","sources":["../src/shell/Shell.tsx","../src/shell/groupNavItems.ts","../src/shell/AppSidebar.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 } 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\n return (\n <main className=\"flex-1 overflow-y-auto px-6 py-6\">\n {children}\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 </main>\n )\n}\n","import type { NavItemPlugin } from '../plugins/types'\n\nexport interface NavSection {\n label: string\n sectionSort: number\n items: NavItemPlugin[]\n}\n\nexport interface GroupedNav {\n ungrouped: NavItemPlugin[]\n sections: NavSection[]\n}\n\nexport function groupNavItems( items: NavItemPlugin[] ): GroupedNav {\n const ungrouped: NavItemPlugin[] = []\n const sectionMap = new Map<string, NavSection>()\n\n for ( const item of items ) {\n if ( !item.section ) {\n ungrouped.push( item )\n continue\n }\n if ( !sectionMap.has( item.section ) ) {\n sectionMap.set( item.section, {\n label : item.section,\n sectionSort : item.sectionSort ?? item.sort ?? 0,\n items : [],\n } )\n }\n sectionMap.get( item.section )!.items.push( item )\n }\n\n ungrouped.sort( ( a, b ) => ( a.sort ?? 0 ) - ( b.sort ?? 0 ) )\n\n const sections = Array.from( sectionMap.values() )\n for ( const s of sections ) {\n s.items.sort( ( a, b ) => ( a.sort ?? 0 ) - ( b.sort ?? 0 ) )\n }\n sections.sort( ( a, b ) => {\n const d = a.sectionSort - b.sectionSort\n return d !== 0 ? d : a.label.localeCompare( b.label )\n } )\n\n return { ungrouped, sections }\n}\n","import { useState, useEffect, useCallback } from 'react'\nimport { Link, useLocation } from 'wouter'\nimport { ChevronLeft, ChevronDown } from 'lucide-react'\nimport { cn } from '../lib/utils'\nimport { getNavItems, getTopBarItems } from '../plugins/registry'\nimport { groupNavItems } from './groupNavItems'\nimport type { ComponentType } from 'react'\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\nconst STORAGE_COLLAPSED = 'imaginarium.ui.sidebar.collapsed'\nconst STORAGE_SECTIONS = 'imaginarium.ui.sidebar.sections'\n\nfunction readBool( key: string, fallback: boolean ): boolean {\n try {\n const v = localStorage.getItem( key )\n return v === null ? fallback : v === 'true'\n } catch { return fallback }\n}\n\nfunction readSections(): Set<string> {\n try {\n const v = localStorage.getItem( STORAGE_SECTIONS )\n if ( !v ) { return new Set() }\n const parsed = JSON.parse( v )\n return new Set( Array.isArray( parsed ) ? parsed as string[] : [] )\n } catch { return new Set() }\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 ) ) { return <img src={icon} alt=\"\" className={className} /> }\n return <span className={`${icon} ${className}`} aria-hidden=\"true\" />\n }\n const Icon = icon\n return <Icon className={className} />\n}\n\nexport interface AppSidebarProps {\n title?: string\n titleIcon?: IconRef\n rightSlot?: React.ReactNode\n}\n\nexport function AppSidebar( { title = 'Imaginarium', titleIcon, rightSlot }: AppSidebarProps ) {\n const [ location ] = useLocation()\n const [ collapsed, setCollapsed ] = useState( () => readBool( STORAGE_COLLAPSED, false ) )\n const [ collapsedSections, setCollapsedSections ] = useState<Set<string>>( readSections )\n\n useEffect( () => {\n try { localStorage.setItem( STORAGE_COLLAPSED, String( collapsed ) ) } catch { /* ignore */ }\n }, [ collapsed ] )\n\n useEffect( () => {\n try {\n localStorage.setItem( STORAGE_SECTIONS, JSON.stringify( Array.from( collapsedSections ) ) )\n } catch { /* ignore */ }\n }, [ collapsedSections ] )\n\n const toggleSidebar = useCallback( () => setCollapsed( v => !v ), [] )\n\n const toggleSection = useCallback( ( label: string ) => {\n setCollapsedSections( prev => {\n const next = new Set( prev )\n next.has( label ) ? next.delete( label ) : next.add( label )\n return next\n } )\n }, [] )\n\n const { ungrouped, sections } = groupNavItems( getNavItems() )\n const topBarItems = getTopBarItems()\n\n return (\n <aside\n className={cn(\n 'flex flex-col flex-shrink-0 border-r bg-background transition-[width] duration-200 ease-in-out overflow-hidden',\n collapsed ? 'w-[52px]' : 'w-[220px]',\n )}\n >\n {/* Header */}\n <div className=\"flex h-[52px] flex-shrink-0 items-center border-b px-2.5 gap-2\">\n {!collapsed && renderIcon( titleIcon, 'h-6 w-6' )}\n {!collapsed && (\n <span className=\"flex-1 truncate text-sm font-semibold\">{title}</span>\n )}\n <button\n onClick={toggleSidebar}\n aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}\n className={cn(\n 'flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md border text-muted-foreground',\n 'hover:bg-accent hover:text-accent-foreground transition-colors',\n collapsed && 'mx-auto border-transparent',\n )}\n >\n <ChevronLeft\n className={cn( 'h-4 w-4 transition-transform duration-200', collapsed && 'rotate-180' )}\n />\n </button>\n </div>\n\n {/* Nav */}\n <nav className=\"flex flex-1 flex-col gap-0.5 overflow-y-auto overflow-x-hidden p-1.5\">\n {/* Ungrouped items */}\n {ungrouped.map( ( { path, label, icon: Icon } ) => {\n const isActive = location === path || location.startsWith( `${path}/` )\n return (\n <Link\n key={path}\n href={path}\n title={collapsed ? label : undefined}\n className={cn(\n 'relative flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground',\n 'hover:bg-accent hover:text-accent-foreground transition-colors whitespace-nowrap',\n isActive && 'bg-accent/50 text-accent-foreground font-medium',\n collapsed && 'justify-center px-2',\n )}\n >\n {Icon && <Icon className=\"h-4 w-4 flex-shrink-0\" />}\n {!collapsed && <span>{label}</span>}\n </Link>\n )\n } )}\n\n {/* Sections */}\n {sections.map( ( section ) => {\n const isSectionCollapsed = !collapsed && collapsedSections.has( section.label )\n return (\n <div key={section.label} className=\"flex flex-col\">\n {/* Section divider + header */}\n <div className=\"my-1.5 h-px bg-border\" />\n {!collapsed && (\n <button\n onClick={() => toggleSection( section.label )}\n className={cn(\n 'flex items-center justify-between px-2 pb-1 pt-2.5',\n 'text-[10px] font-semibold uppercase tracking-widest text-muted-foreground',\n 'hover:text-foreground transition-colors cursor-pointer rounded-sm',\n )}\n >\n {section.label}\n <ChevronDown\n className={cn(\n 'h-3 w-3 transition-transform duration-200',\n isSectionCollapsed && '-rotate-90',\n )}\n />\n </button>\n )}\n\n {/* Section items */}\n <div\n className={cn(\n 'flex flex-col gap-0.5 overflow-hidden transition-all duration-200',\n isSectionCollapsed ? 'max-h-0 opacity-0' : 'max-h-screen opacity-100',\n )}\n >\n {section.items.map( ( { path, label, icon: Icon } ) => {\n const isActive = location === path || location.startsWith( `${path}/` )\n return (\n <Link\n key={path}\n href={path}\n title={collapsed ? label : undefined}\n className={cn(\n 'relative flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground',\n 'hover:bg-accent hover:text-accent-foreground transition-colors whitespace-nowrap',\n isActive && 'bg-accent/50 text-accent-foreground font-medium',\n collapsed && 'justify-center px-2',\n )}\n >\n {Icon && <Icon className=\"h-4 w-4 flex-shrink-0\" />}\n {!collapsed && <span>{label}</span>}\n </Link>\n )\n } )}\n </div>\n </div>\n )\n } )}\n </nav>\n\n {/* Footer: rightSlot + TopBarItems */}\n <div className={cn(\n 'flex flex-shrink-0 items-center border-t p-1.5',\n collapsed ? 'flex-col gap-1' : 'flex-row justify-end gap-0.5',\n )}>\n {!collapsed && rightSlot}\n {topBarItems.map( ( item ) => {\n const C = item.component\n return <C key={item.id} />\n } )}\n </div>\n </aside>\n )\n}\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' ) { \n return undefined \n }\n const code = new URLSearchParams( window.location.search ).get( 'error' )\n if ( !code ) { \n return undefined \n }\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 { getProviders } from '../plugins/registry'\nimport { AppSidebar, type AppSidebarProps, type IconRef } from './AppSidebar'\nimport { Shell, type ShellProps } from './Shell'\n\nfunction withProviders( tree: ReactNode ): ReactNode {\n const providers = getProviders()\n let wrapped = tree\n for ( const { component: Provider } of providers ) {\n wrapped = <Provider>{wrapped}</Provider>\n }\n return wrapped\n}\n\nexport interface ImaginariumAppProps {\n apiBaseUrl?: string\n queryClient?: QueryClient\n title?: string\n titleIcon?: IconRef\n navRightSlot?: AppSidebarProps['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?: AppSidebarProps['rightSlot']\n shellFallback?: ShellProps['fallback']\n children?: ReactNode\n} ) {\n return withProviders(\n <div className=\"flex min-h-screen bg-background text-foreground\">\n <AppSidebar 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","jsxs","Switch","page","jsx","Route","groupNavItems","items","ungrouped","sectionMap","item","a","b","sections","d","STORAGE_COLLAPSED","STORAGE_SECTIONS","readBool","key","v","readSections","parsed","URL_RE","renderIcon","icon","className","Icon","AppSidebar","title","titleIcon","rightSlot","location","useLocation","collapsed","setCollapsed","useState","collapsedSections","setCollapsedSections","useEffect","toggleSidebar","useCallback","toggleSection","label","prev","next","getNavItems","topBarItems","getTopBarItems","cn","ChevronLeft","path","isActive","Link","section","isSectionCollapsed","ChevronDown","C","ToastProvider","ToastPrimitives","ToastViewport","React","props","ref","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","Button","RequireAuth","fetchJson","useImaginariumApi","userPath","Config","isPending","isError","useQuery","LoginComponent","appTitle","resolvedTitle","withProviders","tree","providers","getProviders","wrapped","Provider","defaultQueryClient","QueryClient","GatedShell","navRightSlot","shellFallback","ImaginariumApp","apiBaseUrl","queryClient","qc","useMemo","requireAuth","resolvedTitleIcon","gated","Que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wH,GAAgB,CAC9B,WAAAC,EAAa,OACb,YAAAC,EACA,MAAA5F,EACA,UAAAC,EACA,aAAAuF,EACA,cAAAC,EACA,SAAAvH,CACF,EAAyB,CACvB,MAAM2H,EAAKC,EAAAA,QAAS,IAAMF,GAAeP,GAAoB,CAAEO,CAAY,CAAE,EACvEG,EAAcvB,EAAAA,OAAO,IAAc,iBAAkB,cAAe,EAAK,EACzEwB,EAAoB/F,GACrBuE,EAAAA,OAAO,IAA0B,iBAAkB,YAAa,MAAU,EAEzEyB,EACJzH,EAAAA,IAAC+G,GAAA,CACC,MAAAvF,EACA,UAAWgG,EACX,aAAAR,EACA,cAAAC,EAEC,SAAAvH,CAAA,CAAA,EAIL,OACEM,EAAAA,IAAC0H,EAAAA,qBAAoB,OAAQL,EAC3B,eAACM,EAAAA,gBAAA,CACC,SAAA9H,EAAAA,KAAC+H,EAAAA,wBAAuB,WAAAT,EACrB,SAAA,CAAAI,EAAcvH,EAAAA,IAAC4F,EAAA,CAAa,SAAA6B,CAAA,CAAM,EAAiBA,QACnDrD,EAAA,CAAA,CAAQ,CAAA,CAAA,CACX,EACF,EACF,CAEJ"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { jsxs as i, jsx as r, Fragment as G } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { isValidElement as V, createElement as
|
|
4
|
-
import { useQuery as D, QueryClient as F, QueryClientProvider as
|
|
2
|
+
import * as x from "react";
|
|
3
|
+
import { isValidElement as V, createElement as R, useState as A, useEffect as C, useCallback as I, useMemo as q } from "react";
|
|
4
|
+
import { useQuery as D, QueryClient as F, QueryClientProvider as z } from "@tanstack/react-query";
|
|
5
5
|
import { Config as f } from "@leverege/plugin";
|
|
6
|
-
import
|
|
7
|
-
import { c as
|
|
6
|
+
import { b as _ } from "./Tooltip-CIwKmgzA.js";
|
|
7
|
+
import { c as d, u as H, C as Q, b as U, d as W, e as J, f as K, B as X, a as Y, I as Z } from "./Card-D2LdIJwJ.js";
|
|
8
8
|
import * as u from "@radix-ui/react-toast";
|
|
9
9
|
import { cva as ee } from "class-variance-authority";
|
|
10
10
|
import { ChevronLeft as te, ChevronDown as re, X as oe } from "lucide-react";
|
|
11
11
|
import { d as ne, g as ae, f as ie, e as se } from "./registry-8kQ494RA.js";
|
|
12
|
-
import { Switch as ce, Route as
|
|
12
|
+
import { Switch as ce, Route as T, useLocation as le, Link as k } from "wouter";
|
|
13
13
|
function de(e) {
|
|
14
14
|
const { element: t } = e;
|
|
15
|
-
return V(t) ? t : typeof t == "function" ?
|
|
15
|
+
return V(t) ? t : typeof t == "function" ? R(t) : t;
|
|
16
16
|
}
|
|
17
17
|
function ue({ fallback: e, children: t }) {
|
|
18
18
|
const n = ne();
|
|
19
19
|
return /* @__PURE__ */ i("main", { className: "flex-1 overflow-y-auto px-6 py-6", children: [
|
|
20
20
|
t,
|
|
21
21
|
/* @__PURE__ */ i(ce, { children: [
|
|
22
|
-
n.map((a) => /* @__PURE__ */ r(
|
|
23
|
-
/* @__PURE__ */ r(
|
|
22
|
+
n.map((a) => /* @__PURE__ */ r(T, { path: a.path, children: de(a) }, a.path)),
|
|
23
|
+
/* @__PURE__ */ r(T, { children: e ?? /* @__PURE__ */ r("div", { className: "p-8 text-muted-foreground", children: "Not found" }) })
|
|
24
24
|
] })
|
|
25
25
|
] });
|
|
26
26
|
}
|
|
@@ -40,13 +40,13 @@ function me(e) {
|
|
|
40
40
|
t.sort((o, c) => (o.sort ?? 0) - (c.sort ?? 0));
|
|
41
41
|
const a = Array.from(n.values());
|
|
42
42
|
for (const o of a)
|
|
43
|
-
o.items.sort((c,
|
|
43
|
+
o.items.sort((c, l) => (c.sort ?? 0) - (l.sort ?? 0));
|
|
44
44
|
return a.sort((o, c) => {
|
|
45
|
-
const
|
|
46
|
-
return
|
|
45
|
+
const l = o.sectionSort - c.sectionSort;
|
|
46
|
+
return l !== 0 ? l : o.label.localeCompare(c.label);
|
|
47
47
|
}), { ungrouped: t, sections: a };
|
|
48
48
|
}
|
|
49
|
-
const
|
|
49
|
+
const P = "imaginarium.ui.sidebar.collapsed", E = "imaginarium.ui.sidebar.sections";
|
|
50
50
|
function fe(e, t) {
|
|
51
51
|
try {
|
|
52
52
|
const n = localStorage.getItem(e);
|
|
@@ -57,7 +57,7 @@ function fe(e, t) {
|
|
|
57
57
|
}
|
|
58
58
|
function pe() {
|
|
59
59
|
try {
|
|
60
|
-
const e = localStorage.getItem(
|
|
60
|
+
const e = localStorage.getItem(E);
|
|
61
61
|
if (!e)
|
|
62
62
|
return /* @__PURE__ */ new Set();
|
|
63
63
|
const t = JSON.parse(e);
|
|
@@ -71,28 +71,28 @@ function he(e, t) {
|
|
|
71
71
|
return e ? typeof e == "string" ? ge.test(e) ? /* @__PURE__ */ r("img", { src: e, alt: "", className: t }) : /* @__PURE__ */ r("span", { className: `${e} ${t}`, "aria-hidden": "true" }) : /* @__PURE__ */ r(e, { className: t }) : null;
|
|
72
72
|
}
|
|
73
73
|
function xe({ title: e = "Imaginarium", titleIcon: t, rightSlot: n }) {
|
|
74
|
-
const [a] = le(), [o, c] = A(() => fe(
|
|
75
|
-
|
|
74
|
+
const [a] = le(), [o, c] = A(() => fe(P, !1)), [l, g] = A(pe);
|
|
75
|
+
C(() => {
|
|
76
76
|
try {
|
|
77
|
-
localStorage.setItem(
|
|
77
|
+
localStorage.setItem(P, String(o));
|
|
78
78
|
} catch {
|
|
79
79
|
}
|
|
80
|
-
}, [o]),
|
|
80
|
+
}, [o]), C(() => {
|
|
81
81
|
try {
|
|
82
|
-
localStorage.setItem(
|
|
82
|
+
localStorage.setItem(E, JSON.stringify(Array.from(l)));
|
|
83
83
|
} catch {
|
|
84
84
|
}
|
|
85
|
-
}, [
|
|
86
|
-
const v =
|
|
85
|
+
}, [l]);
|
|
86
|
+
const v = I(() => c((s) => !s), []), b = I((s) => {
|
|
87
87
|
g((p) => {
|
|
88
88
|
const m = new Set(p);
|
|
89
89
|
return m.has(s) ? m.delete(s) : m.add(s), m;
|
|
90
90
|
});
|
|
91
|
-
}, []), { ungrouped:
|
|
91
|
+
}, []), { ungrouped: h, sections: y } = me(ae()), N = ie();
|
|
92
92
|
return /* @__PURE__ */ i(
|
|
93
93
|
"aside",
|
|
94
94
|
{
|
|
95
|
-
className:
|
|
95
|
+
className: d(
|
|
96
96
|
"flex flex-col flex-shrink-0 border-r bg-background transition-[width] duration-200 ease-in-out overflow-hidden",
|
|
97
97
|
o ? "w-[52px]" : "w-[220px]"
|
|
98
98
|
),
|
|
@@ -105,7 +105,7 @@ function xe({ title: e = "Imaginarium", titleIcon: t, rightSlot: n }) {
|
|
|
105
105
|
{
|
|
106
106
|
onClick: v,
|
|
107
107
|
"aria-label": o ? "Expand sidebar" : "Collapse sidebar",
|
|
108
|
-
className:
|
|
108
|
+
className: d(
|
|
109
109
|
"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md border text-muted-foreground",
|
|
110
110
|
"hover:bg-accent hover:text-accent-foreground transition-colors",
|
|
111
111
|
o && "mx-auto border-transparent"
|
|
@@ -113,24 +113,24 @@ function xe({ title: e = "Imaginarium", titleIcon: t, rightSlot: n }) {
|
|
|
113
113
|
children: /* @__PURE__ */ r(
|
|
114
114
|
te,
|
|
115
115
|
{
|
|
116
|
-
className:
|
|
116
|
+
className: d("h-4 w-4 transition-transform duration-200", o && "rotate-180")
|
|
117
117
|
}
|
|
118
118
|
)
|
|
119
119
|
}
|
|
120
120
|
)
|
|
121
121
|
] }),
|
|
122
122
|
/* @__PURE__ */ i("nav", { className: "flex flex-1 flex-col gap-0.5 overflow-y-auto overflow-x-hidden p-1.5", children: [
|
|
123
|
-
|
|
124
|
-
const
|
|
123
|
+
h.map(({ path: s, label: p, icon: m }) => {
|
|
124
|
+
const w = a === s || a.startsWith(`${s}/`);
|
|
125
125
|
return /* @__PURE__ */ i(
|
|
126
|
-
|
|
126
|
+
k,
|
|
127
127
|
{
|
|
128
128
|
href: s,
|
|
129
129
|
title: o ? p : void 0,
|
|
130
|
-
className:
|
|
130
|
+
className: d(
|
|
131
131
|
"relative flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground",
|
|
132
132
|
"hover:bg-accent hover:text-accent-foreground transition-colors whitespace-nowrap",
|
|
133
|
-
|
|
133
|
+
w && "bg-accent/50 text-accent-foreground font-medium",
|
|
134
134
|
o && "justify-center px-2"
|
|
135
135
|
),
|
|
136
136
|
children: [
|
|
@@ -141,15 +141,15 @@ function xe({ title: e = "Imaginarium", titleIcon: t, rightSlot: n }) {
|
|
|
141
141
|
s
|
|
142
142
|
);
|
|
143
143
|
}),
|
|
144
|
-
|
|
145
|
-
const p = !o &&
|
|
144
|
+
y.map((s) => {
|
|
145
|
+
const p = !o && l.has(s.label);
|
|
146
146
|
return /* @__PURE__ */ i("div", { className: "flex flex-col", children: [
|
|
147
147
|
/* @__PURE__ */ r("div", { className: "my-1.5 h-px bg-border" }),
|
|
148
148
|
!o && /* @__PURE__ */ i(
|
|
149
149
|
"button",
|
|
150
150
|
{
|
|
151
|
-
onClick: () =>
|
|
152
|
-
className:
|
|
151
|
+
onClick: () => b(s.label),
|
|
152
|
+
className: d(
|
|
153
153
|
"flex items-center justify-between px-2 pb-1 pt-2.5",
|
|
154
154
|
"text-[10px] font-semibold uppercase tracking-widest text-muted-foreground",
|
|
155
155
|
"hover:text-foreground transition-colors cursor-pointer rounded-sm"
|
|
@@ -159,7 +159,7 @@ function xe({ title: e = "Imaginarium", titleIcon: t, rightSlot: n }) {
|
|
|
159
159
|
/* @__PURE__ */ r(
|
|
160
160
|
re,
|
|
161
161
|
{
|
|
162
|
-
className:
|
|
162
|
+
className: d(
|
|
163
163
|
"h-3 w-3 transition-transform duration-200",
|
|
164
164
|
p && "-rotate-90"
|
|
165
165
|
)
|
|
@@ -171,26 +171,26 @@ function xe({ title: e = "Imaginarium", titleIcon: t, rightSlot: n }) {
|
|
|
171
171
|
/* @__PURE__ */ r(
|
|
172
172
|
"div",
|
|
173
173
|
{
|
|
174
|
-
className:
|
|
174
|
+
className: d(
|
|
175
175
|
"flex flex-col gap-0.5 overflow-hidden transition-all duration-200",
|
|
176
176
|
p ? "max-h-0 opacity-0" : "max-h-screen opacity-100"
|
|
177
177
|
),
|
|
178
|
-
children: s.items.map(({ path: m, label:
|
|
178
|
+
children: s.items.map(({ path: m, label: w, icon: S }) => {
|
|
179
179
|
const $ = a === m || a.startsWith(`${m}/`);
|
|
180
180
|
return /* @__PURE__ */ i(
|
|
181
|
-
|
|
181
|
+
k,
|
|
182
182
|
{
|
|
183
183
|
href: m,
|
|
184
|
-
title: o ?
|
|
185
|
-
className:
|
|
184
|
+
title: o ? w : void 0,
|
|
185
|
+
className: d(
|
|
186
186
|
"relative flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground",
|
|
187
187
|
"hover:bg-accent hover:text-accent-foreground transition-colors whitespace-nowrap",
|
|
188
188
|
$ && "bg-accent/50 text-accent-foreground font-medium",
|
|
189
189
|
o && "justify-center px-2"
|
|
190
190
|
),
|
|
191
191
|
children: [
|
|
192
|
-
|
|
193
|
-
!o && /* @__PURE__ */ r("span", { children:
|
|
192
|
+
S && /* @__PURE__ */ r(S, { className: "h-4 w-4 flex-shrink-0" }),
|
|
193
|
+
!o && /* @__PURE__ */ r("span", { children: w })
|
|
194
194
|
]
|
|
195
195
|
},
|
|
196
196
|
m
|
|
@@ -201,12 +201,12 @@ function xe({ title: e = "Imaginarium", titleIcon: t, rightSlot: n }) {
|
|
|
201
201
|
] }, s.label);
|
|
202
202
|
})
|
|
203
203
|
] }),
|
|
204
|
-
/* @__PURE__ */ i("div", { className:
|
|
204
|
+
/* @__PURE__ */ i("div", { className: d(
|
|
205
205
|
"flex flex-shrink-0 items-center border-t p-1.5",
|
|
206
206
|
o ? "flex-col gap-1" : "flex-row justify-end gap-0.5"
|
|
207
207
|
), children: [
|
|
208
208
|
!o && n,
|
|
209
|
-
|
|
209
|
+
N.map((s) => {
|
|
210
210
|
const p = s.component;
|
|
211
211
|
return /* @__PURE__ */ r(p, {}, s.id);
|
|
212
212
|
})
|
|
@@ -215,32 +215,19 @@ function xe({ title: e = "Imaginarium", titleIcon: t, rightSlot: n }) {
|
|
|
215
215
|
}
|
|
216
216
|
);
|
|
217
217
|
}
|
|
218
|
-
const ve =
|
|
219
|
-
b.Content,
|
|
220
|
-
{
|
|
221
|
-
ref: a,
|
|
222
|
-
sideOffset: t,
|
|
223
|
-
className: l(
|
|
224
|
-
"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",
|
|
225
|
-
e
|
|
226
|
-
),
|
|
227
|
-
...n
|
|
228
|
-
}
|
|
229
|
-
));
|
|
230
|
-
we.displayName = b.Content.displayName;
|
|
231
|
-
const be = u.Provider, L = h.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
218
|
+
const ve = u.Provider, B = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
232
219
|
u.Viewport,
|
|
233
220
|
{
|
|
234
221
|
ref: n,
|
|
235
|
-
className:
|
|
222
|
+
className: d(
|
|
236
223
|
"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]",
|
|
237
224
|
e
|
|
238
225
|
),
|
|
239
226
|
...t
|
|
240
227
|
}
|
|
241
228
|
));
|
|
242
|
-
|
|
243
|
-
const
|
|
229
|
+
B.displayName = u.Viewport.displayName;
|
|
230
|
+
const be = ee(
|
|
244
231
|
"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",
|
|
245
232
|
{
|
|
246
233
|
variants: {
|
|
@@ -251,25 +238,25 @@ const ye = ee(
|
|
|
251
238
|
},
|
|
252
239
|
defaultVariants: { variant: "default" }
|
|
253
240
|
}
|
|
254
|
-
),
|
|
255
|
-
|
|
256
|
-
const
|
|
241
|
+
), L = x.forwardRef(({ className: e, variant: t, ...n }, a) => /* @__PURE__ */ r(u.Root, { ref: a, className: d(be({ variant: t }), e), ...n }));
|
|
242
|
+
L.displayName = u.Root.displayName;
|
|
243
|
+
const we = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
257
244
|
u.Action,
|
|
258
245
|
{
|
|
259
246
|
ref: n,
|
|
260
|
-
className:
|
|
247
|
+
className: d(
|
|
261
248
|
"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",
|
|
262
249
|
e
|
|
263
250
|
),
|
|
264
251
|
...t
|
|
265
252
|
}
|
|
266
253
|
));
|
|
267
|
-
|
|
268
|
-
const
|
|
254
|
+
we.displayName = u.Action.displayName;
|
|
255
|
+
const j = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
269
256
|
u.Close,
|
|
270
257
|
{
|
|
271
258
|
ref: n,
|
|
272
|
-
className:
|
|
259
|
+
className: d(
|
|
273
260
|
"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",
|
|
274
261
|
e
|
|
275
262
|
),
|
|
@@ -278,26 +265,26 @@ const O = h.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
|
|
|
278
265
|
children: /* @__PURE__ */ r(oe, { className: "h-4 w-4" })
|
|
279
266
|
}
|
|
280
267
|
));
|
|
281
|
-
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
const M =
|
|
268
|
+
j.displayName = u.Close.displayName;
|
|
269
|
+
const O = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(u.Title, { ref: n, className: d("text-sm font-semibold", e), ...t }));
|
|
270
|
+
O.displayName = u.Title.displayName;
|
|
271
|
+
const M = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(u.Description, { ref: n, className: d("text-sm opacity-90", e), ...t }));
|
|
285
272
|
M.displayName = u.Description.displayName;
|
|
286
|
-
function
|
|
273
|
+
function ye() {
|
|
287
274
|
const { toasts: e } = H();
|
|
288
|
-
return /* @__PURE__ */ i(
|
|
289
|
-
e.map(({ id: t, title: n, description: a, action: o, ...c }) => /* @__PURE__ */ i(
|
|
275
|
+
return /* @__PURE__ */ i(ve, { children: [
|
|
276
|
+
e.map(({ id: t, title: n, description: a, action: o, ...c }) => /* @__PURE__ */ i(L, { ...c, children: [
|
|
290
277
|
/* @__PURE__ */ i("div", { className: "grid gap-1", children: [
|
|
291
|
-
n && /* @__PURE__ */ r(
|
|
278
|
+
n && /* @__PURE__ */ r(O, { children: n }),
|
|
292
279
|
a && /* @__PURE__ */ r(M, { children: a })
|
|
293
280
|
] }),
|
|
294
281
|
o,
|
|
295
|
-
/* @__PURE__ */ r(
|
|
282
|
+
/* @__PURE__ */ r(j, {})
|
|
296
283
|
] }, t)),
|
|
297
|
-
/* @__PURE__ */ r(
|
|
284
|
+
/* @__PURE__ */ r(B, {})
|
|
298
285
|
] });
|
|
299
286
|
}
|
|
300
|
-
function
|
|
287
|
+
function Ne({ className: e }) {
|
|
301
288
|
return /* @__PURE__ */ i("svg", { viewBox: "0 0 24 24", className: e, "aria-hidden": "true", children: [
|
|
302
289
|
/* @__PURE__ */ r("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" }),
|
|
303
290
|
/* @__PURE__ */ r("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" }),
|
|
@@ -305,17 +292,17 @@ function Ce({ className: e }) {
|
|
|
305
292
|
/* @__PURE__ */ r("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" })
|
|
306
293
|
] });
|
|
307
294
|
}
|
|
308
|
-
const
|
|
295
|
+
const Se = {
|
|
309
296
|
auth_failed: "Sign-in failed. Please try again."
|
|
310
297
|
};
|
|
311
|
-
function
|
|
298
|
+
function Ae() {
|
|
312
299
|
if (typeof window > "u")
|
|
313
300
|
return;
|
|
314
301
|
const e = new URLSearchParams(window.location.search).get("error");
|
|
315
302
|
if (e)
|
|
316
|
-
return
|
|
303
|
+
return Se[e] ?? `Sign-in error: ${e}`;
|
|
317
304
|
}
|
|
318
|
-
function
|
|
305
|
+
function Ce({
|
|
319
306
|
loginPath: e,
|
|
320
307
|
title: t = "Sign in",
|
|
321
308
|
subtitle: n,
|
|
@@ -323,7 +310,7 @@ function Te({
|
|
|
323
310
|
backgroundUrl: o,
|
|
324
311
|
errorMessage: c
|
|
325
312
|
}) {
|
|
326
|
-
const
|
|
313
|
+
const l = c ?? Ae(), g = !!o;
|
|
327
314
|
return /* @__PURE__ */ r(
|
|
328
315
|
"div",
|
|
329
316
|
{
|
|
@@ -335,7 +322,7 @@ function Te({
|
|
|
335
322
|
n && /* @__PURE__ */ r(J, { children: n })
|
|
336
323
|
] }),
|
|
337
324
|
/* @__PURE__ */ i(K, { className: "space-y-4", children: [
|
|
338
|
-
|
|
325
|
+
l && /* @__PURE__ */ r("div", { className: "rounded-md border border-destructive bg-destructive/10 px-4 py-2 text-sm text-destructive", children: l }),
|
|
339
326
|
/* @__PURE__ */ i(
|
|
340
327
|
X,
|
|
341
328
|
{
|
|
@@ -345,7 +332,7 @@ function Te({
|
|
|
345
332
|
window.location.href = e;
|
|
346
333
|
},
|
|
347
334
|
children: [
|
|
348
|
-
/* @__PURE__ */ r(
|
|
335
|
+
/* @__PURE__ */ r(Ne, { className: "h-5 w-5 mr-2" }),
|
|
349
336
|
a
|
|
350
337
|
]
|
|
351
338
|
}
|
|
@@ -355,7 +342,7 @@ function Te({
|
|
|
355
342
|
}
|
|
356
343
|
);
|
|
357
344
|
}
|
|
358
|
-
function
|
|
345
|
+
function Ie({ children: e }) {
|
|
359
346
|
const { fetchJson: t } = Y(), n = f.get("ImaginariumApp", "userPath", "/auth/user"), { isPending: a, isError: o } = D({
|
|
360
347
|
queryKey: ["imaginarium", "auth", "user", n],
|
|
361
348
|
queryFn: () => t(n),
|
|
@@ -368,87 +355,83 @@ function ke({ children: e }) {
|
|
|
368
355
|
const c = f.get(
|
|
369
356
|
"ImaginariumApp",
|
|
370
357
|
"loginPage",
|
|
371
|
-
|
|
372
|
-
),
|
|
358
|
+
Ce
|
|
359
|
+
), l = f.get("ImaginariumApp", "loginTitle", void 0), g = f.get("ImaginariumApp", "loginSubtitle", void 0), v = f.get(
|
|
373
360
|
"ImaginariumApp",
|
|
374
361
|
"loginButtonLabel",
|
|
375
362
|
void 0
|
|
376
|
-
),
|
|
363
|
+
), b = f.get("ImaginariumApp", "loginPath", "/api/login"), h = f.get(
|
|
377
364
|
"ImaginariumApp",
|
|
378
365
|
"loginBackgroundUrl",
|
|
379
366
|
void 0
|
|
380
|
-
),
|
|
381
|
-
return
|
|
382
|
-
loginPath:
|
|
383
|
-
title:
|
|
367
|
+
), y = f.get("ImaginariumApp", "title", "Imaginarium"), N = l ?? `Sign in to ${y}`;
|
|
368
|
+
return R(c, {
|
|
369
|
+
loginPath: b,
|
|
370
|
+
title: N,
|
|
384
371
|
subtitle: g,
|
|
385
372
|
buttonLabel: v,
|
|
386
|
-
backgroundUrl:
|
|
373
|
+
backgroundUrl: h
|
|
387
374
|
});
|
|
388
375
|
}
|
|
389
376
|
return /* @__PURE__ */ r(G, { children: e });
|
|
390
377
|
}
|
|
391
|
-
function
|
|
378
|
+
function Te(e) {
|
|
392
379
|
const t = se();
|
|
393
380
|
let n = e;
|
|
394
381
|
for (const { component: a } of t)
|
|
395
382
|
n = /* @__PURE__ */ r(a, { children: n });
|
|
396
383
|
return n;
|
|
397
384
|
}
|
|
398
|
-
const
|
|
385
|
+
const ke = new F({
|
|
399
386
|
defaultOptions: {
|
|
400
387
|
queries: { retry: !1, refetchOnWindowFocus: !1 }
|
|
401
388
|
}
|
|
402
389
|
});
|
|
403
|
-
function
|
|
404
|
-
return
|
|
390
|
+
function Pe({ title: e, titleIcon: t, navRightSlot: n, shellFallback: a, children: o }) {
|
|
391
|
+
return Te(
|
|
405
392
|
/* @__PURE__ */ i("div", { className: "flex min-h-screen bg-background text-foreground", children: [
|
|
406
393
|
/* @__PURE__ */ r(xe, { title: e, titleIcon: t, rightSlot: n }),
|
|
407
394
|
/* @__PURE__ */ r(ue, { fallback: a, children: o })
|
|
408
395
|
] })
|
|
409
396
|
);
|
|
410
397
|
}
|
|
411
|
-
function
|
|
398
|
+
function qe({
|
|
412
399
|
apiBaseUrl: e = "/api",
|
|
413
400
|
queryClient: t,
|
|
414
401
|
title: n,
|
|
415
402
|
titleIcon: a,
|
|
416
403
|
navRightSlot: o,
|
|
417
404
|
shellFallback: c,
|
|
418
|
-
children:
|
|
405
|
+
children: l
|
|
419
406
|
}) {
|
|
420
|
-
const g = q(() => t ??
|
|
421
|
-
|
|
407
|
+
const g = q(() => t ?? ke, [t]), v = f.get("ImaginariumApp", "requireAuth", !0), b = a ?? f.get("ImaginariumApp", "titleIcon", void 0), h = /* @__PURE__ */ r(
|
|
408
|
+
Pe,
|
|
422
409
|
{
|
|
423
410
|
title: n,
|
|
424
|
-
titleIcon:
|
|
411
|
+
titleIcon: b,
|
|
425
412
|
navRightSlot: o,
|
|
426
413
|
shellFallback: c,
|
|
427
|
-
children:
|
|
414
|
+
children: l
|
|
428
415
|
}
|
|
429
416
|
);
|
|
430
|
-
return /* @__PURE__ */ r(
|
|
431
|
-
v ? /* @__PURE__ */ r(
|
|
432
|
-
/* @__PURE__ */ r(
|
|
417
|
+
return /* @__PURE__ */ r(z, { client: g, children: /* @__PURE__ */ r(_, { children: /* @__PURE__ */ i(Z, { apiBaseUrl: e, children: [
|
|
418
|
+
v ? /* @__PURE__ */ r(Ie, { children: h }) : h,
|
|
419
|
+
/* @__PURE__ */ r(ye, {})
|
|
433
420
|
] }) }) });
|
|
434
421
|
}
|
|
435
422
|
export {
|
|
436
423
|
xe as A,
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
424
|
+
qe as I,
|
|
425
|
+
Ce as L,
|
|
426
|
+
Ie as R,
|
|
440
427
|
ue as S,
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
428
|
+
L as T,
|
|
429
|
+
we as a,
|
|
430
|
+
j as b,
|
|
444
431
|
M as c,
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
qe as h,
|
|
450
|
-
we as i,
|
|
451
|
-
ve as j,
|
|
452
|
-
De as k
|
|
432
|
+
ve as d,
|
|
433
|
+
O as e,
|
|
434
|
+
B as f,
|
|
435
|
+
ye as g
|
|
453
436
|
};
|
|
454
|
-
//# sourceMappingURL=ImaginariumApp-
|
|
437
|
+
//# sourceMappingURL=ImaginariumApp-DJ0f2GWB.js.map
|