@leverege/imaginarium-ui 1.6.0 → 1.7.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/index.cjs +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +48 -47
- package/package.json +2 -2
- package/src/index.ts +1 -0
package/lib/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./PluginTypes-BmYA5_B9.cjs"),w=require("./registry-Bq42i86Q.cjs"),s=require("./ImaginariumApp-DeLr4nad.cjs"),p=require("./PluginSetup-BsMKEyLI.cjs"),g=require("./MarkdownPageDoc-BrPfBSvd.cjs"),t=require("react/jsx-runtime"),z=require("react-dom/client"),u=require("@leverege/plugin"),S=require("lucide-react"),i=require("./Card-CHVaz_7u.cjs"),I=require("react"),U=require("@radix-ui/react-dropdown-menu"),x=require("./PluginSetup-B1eP6a5H.cjs"),V=require("./PluginSetup-6y-Q93AW.cjs"),l=require("./Label-BhnvyUcc.cjs"),P=require("./Tooltip-DQn1fHhM.cjs");function j(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(o,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return o.default=e,Object.freeze(o)}const h=j(I),a=j(U);function G(){if(!u.Config.get("ImaginariumApp","requireAuth",!0))return null;const o=u.Config.get("ImaginariumApp","logoutPath","/api/logout");return t.jsx(i.Button,{variant:"ghost",size:"sm","aria-label":"Sign out",onClick:()=>{window.location.href=o},children:t.jsx(S.LogOut,{className:"h-4 w-4"})})}const N={id:"imaginarium.ui.LogoutItem",sort:100,component:G},M="imaginarium.ui.theme";function H(){if(typeof window>"u")return"light";const e=window.localStorage.getItem(M);return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function _(){const[e,o]=I.useState(H);I.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem(M,e)},[e]);const n=e==="dark"?"light":"dark";return t.jsx(i.Button,{variant:"ghost",size:"sm","aria-label":`Switch to ${n} mode`,onClick:()=>o(n),children:e==="dark"?t.jsx(S.Sun,{className:"h-4 w-4"}):t.jsx(S.Moon,{className:"h-4 w-4"})})}const k={id:"imaginarium.ui.UIModeItem",sort:90,component:_},R=a.Root,A=a.Trigger,E=a.Group,$=a.Portal,K=a.Sub,Y=a.RadioGroup,F=h.forwardRef(({className:e,inset:o,children:n,...r},f)=>t.jsxs(a.SubTrigger,{ref:f,className:i.cn("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",o&&"pl-8",e),...r,children:[n,t.jsx(S.ChevronRight,{className:"ml-auto h-4 w-4"})]}));F.displayName=a.SubTrigger.displayName;const q=h.forwardRef(({className:e,...o},n)=>t.jsx(a.SubContent,{ref:n,className:i.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",e),...o}));q.displayName=a.SubContent.displayName;const b=h.forwardRef(({className:e,sideOffset:o=4,...n},r)=>t.jsx(a.Portal,{children:t.jsx(a.Content,{ref:r,sideOffset:o,className:i.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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",e),...n})}));b.displayName=a.Content.displayName;const v=h.forwardRef(({className:e,inset:o,...n},r)=>t.jsx(a.Item,{ref:r,className:i.cn("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o&&"pl-8",e),...n}));v.displayName=a.Item.displayName;const T=h.forwardRef(({className:e,children:o,checked:n,...r},f)=>t.jsxs(a.CheckboxItem,{ref:f,className:i.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(a.ItemIndicator,{children:t.jsx(S.Check,{className:"h-4 w-4"})})}),o]}));T.displayName=a.CheckboxItem.displayName;const B=h.forwardRef(({className:e,children:o,...n},r)=>t.jsxs(a.RadioItem,{ref:r,className:i.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(a.ItemIndicator,{children:t.jsx(S.Circle,{className:"h-2 w-2 fill-current"})})}),o]}));B.displayName=a.RadioItem.displayName;const D=h.forwardRef(({className:e,inset:o,...n},r)=>t.jsx(a.Label,{ref:r,className:i.cn("px-2 py-1.5 text-sm font-semibold",o&&"pl-8",e),...n}));D.displayName=a.Label.displayName;const C=h.forwardRef(({className:e,...o},n)=>t.jsx(a.Separator,{ref:n,className:i.cn("-mx-1 my-1 h-px bg-muted",e),...o}));C.displayName=a.Separator.displayName;const O=({className:e,...o})=>t.jsx("span",{className:i.cn("ml-auto text-xs tracking-widest opacity-60",e),...o});O.displayName="DropdownMenuShortcut";function J(){const e=g.useFilters(),o=new Set(e.hiddenSystemConfigTypes),n=new Set(e.hiddenSystemConfigTags),r=e.knownSystemConfigTypes.length>0,f=e.knownSystemConfigTags.length>0,y=e.hiddenSystemConfigTypes.length+e.hiddenSystemConfigTags.length,m=!e.showDev||y>0;return t.jsxs(R,{children:[t.jsx(A,{asChild:!0,children:t.jsxs(i.Button,{variant:m?"secondary":"ghost",size:"sm","aria-label":e.filteredOutCount>0?`Filter (${e.filteredOutCount} hidden)`:"Filter",children:[t.jsx(S.Filter,{className:"h-4 w-4"}),e.filteredOutCount>0?t.jsx("span",{className:"ml-1 inline-flex min-w-4 items-center justify-center rounded-full bg-primary px-1 py-0 text-[0.625rem] font-medium leading-4 text-primary-foreground",children:e.filteredOutCount}):null]})}),t.jsxs(b,{align:"end",className:"min-w-48",children:[t.jsx(T,{checked:e.showDev,onCheckedChange:e.setShowDev,children:"Show Development"}),r?t.jsxs(I.Fragment,{children:[t.jsx(C,{}),t.jsx(D,{children:"Types"}),e.knownSystemConfigTypes.map(d=>t.jsx(T,{checked:!o.has(d),onCheckedChange:()=>e.toggleSystemConfigType(d),children:d},d))]}):null,f?t.jsxs(I.Fragment,{children:[t.jsx(C,{}),t.jsx(D,{children:"Tags"}),e.knownSystemConfigTags.map(d=>t.jsx(T,{checked:!n.has(d),onCheckedChange:()=>e.toggleSystemConfigTag(d),children:d},d))]}):null,y>0?t.jsxs(I.Fragment,{children:[t.jsx(C,{}),t.jsx(v,{onClick:e.clearHidden,children:"Clear filters"})]}):null]})]})}const L={id:"imaginarium.ui.SystemConfigFilterItem",sort:80,component:J},Q={install(e){V.ReleaseSetup.install(e)}},W={install(e){p.SystemSetup.install(e),x.SecretSetup.install(e),Q.install(e),e.addPlugin(c.ProviderType,{id:"imaginarium.ui.FilterProvider",sort:50,component:g.FilterProvider}),e.addPlugin(c.ProviderType,{id:"imaginarium.ui.SystemConfigsProvider",sort:40,component:g.SystemConfigsProvider}),e.addPlugin(c.TopBarItemType,L),e.addPlugin(c.TopBarItemType,k),e.addPlugin(c.TopBarItemType,N),console.log("Installing built-in plugin setup!!"),e.addPlugin(c.PageType,{id:"imaginarium.RootRedirect",path:"/",element:()=>(console.log("Redirecting from / to /system-config"),window.location.replace(u.Config.get("ImaginariumApp","rootRedirect","/system-config")),null)})}},X={init(e,o){const n=e??{},r=n.config??{};for(const y of Object.keys(r)){const m=r[y];if(m)for(const d of Object.keys(m))u.Config.set(y,d,m[d])}const f=new Set(n.excludes??[]);f.size>0&&u.Plugins.addMutator((y,m)=>m&&typeof m=="object"&&f.has(m.id??"")?null:m);for(const y of n.mutators??[])u.Plugins.addMutator(y);console.log("Installing built-in plugin setup..."),W.install(u.Plugins),o.install(u.Plugins)},create(){const e=u.Config.get("ImaginariumApp","rootElement","#root"),o=u.Config.get("ImaginariumApp","apiBaseUrl","/api"),n=u.Config.get("ImaginariumApp","title","Imaginarium"),r=typeof e=="string"?document.querySelector(e):e;if(!r)throw new Error(`ImaginariumUI.create: root element not found (${String(e)})`);z.createRoot(r).render(t.jsx(s.ImaginariumApp,{apiBaseUrl:o,title:n}))}};exports.NavItemType=c.NavItemType;exports.PageDocsType=c.PageDocsType;exports.PageType=c.PageType;exports.ProviderType=c.ProviderType;exports.TopBarItemType=c.TopBarItemType;exports.addNavItem=w.addNavItem;exports.addPage=w.addPage;exports.addPageDocs=w.addPageDocs;exports.addProvider=w.addProvider;exports.getNavItems=w.getNavItems;exports.getPages=w.getPages;exports.getProviders=w.getProviders;exports.AppSidebar=s.AppSidebar;exports.ImaginariumApp=s.ImaginariumApp;exports.LoginPage=s.LoginPage;exports.RequireAuth=s.RequireAuth;exports.Shell=s.Shell;exports.Toast=s.Toast;exports.ToastAction=s.ToastAction;exports.ToastClose=s.ToastClose;exports.ToastDescription=s.ToastDescription;exports.ToastProvider=s.ToastProvider;exports.ToastTitle=s.ToastTitle;exports.ToastViewport=s.ToastViewport;exports.Toaster=s.Toaster;exports.useRegisterTabDocs=s.useRegisterTabDocs;exports.ImagineSystemNavItem=p.ImagineSystemNavItem;exports.ImagineSystemNavItemId=p.ImagineSystemNavItemId;exports.ImagineSystemPage=p.ImagineSystemPage;exports.ImagineSystemPageId=p.ImagineSystemPageId;exports.ImagineSystemView=p.ImagineSystemView;exports.SystemSetup=p.SystemSetup;exports.SystemSetupDefault=p.SystemSetup;exports.TagInput=p.TagInput;exports.FilterProvider=g.FilterProvider;exports.SystemConfigsProvider=g.SystemConfigsProvider;exports.applyConfigFilters=g.applyConfigFilters;exports.isDevConfig=g.isDevConfig;exports.useFilters=g.useFilters;exports.useSystemConfigs=g.useSystemConfigs;exports.Button=i.Button;exports.Card=i.Card;exports.CardContent=i.CardContent;exports.CardDescription=i.CardDescription;exports.CardFooter=i.CardFooter;exports.CardHeader=i.CardHeader;exports.CardTitle=i.CardTitle;exports.ImaginariumApiProvider=i.ImaginariumApiProvider;exports.buttonVariants=i.buttonVariants;exports.cn=i.cn;exports.toast=i.toast;exports.useImaginariumApi=i.useImaginariumApi;exports.useToast=i.useToast;exports.SecretNavItem=x.SecretNavItem;exports.SecretPage=x.SecretPage;exports.SecretSetup=x.SecretSetup;exports.SecretView=x.SecretView;exports.Dialog=l.Dialog;exports.DialogClose=l.DialogClose;exports.DialogContent=l.DialogContent;exports.DialogDescription=l.DialogDescription;exports.DialogFooter=l.DialogFooter;exports.DialogHeader=l.DialogHeader;exports.DialogOverlay=l.DialogOverlay;exports.DialogPortal=l.DialogPortal;exports.DialogTitle=l.DialogTitle;exports.DialogTrigger=l.DialogTrigger;exports.Input=l.Input;exports.Label=l.Label;exports.Tooltip=P.Tooltip;exports.TooltipContent=P.TooltipContent;exports.TooltipProvider=P.TooltipProvider;exports.TooltipTrigger=P.TooltipTrigger;exports.DropdownMenu=R;exports.DropdownMenuCheckboxItem=T;exports.DropdownMenuContent=b;exports.DropdownMenuGroup=E;exports.DropdownMenuItem=v;exports.DropdownMenuLabel=D;exports.DropdownMenuPortal=$;exports.DropdownMenuRadioGroup=Y;exports.DropdownMenuRadioItem=B;exports.DropdownMenuSeparator=C;exports.DropdownMenuShortcut=O;exports.DropdownMenuSub=K;exports.DropdownMenuSubContent=q;exports.DropdownMenuSubTrigger=F;exports.DropdownMenuTrigger=A;exports.ImaginariumUI=X;exports.LogoutItem=N;exports.SystemConfigFilterItem=L;exports.UIModeItem=k;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./PluginTypes-BmYA5_B9.cjs"),w=require("./registry-Bq42i86Q.cjs"),s=require("./ImaginariumApp-DeLr4nad.cjs"),p=require("./PluginSetup-BsMKEyLI.cjs"),g=require("./MarkdownPageDoc-BrPfBSvd.cjs"),t=require("react/jsx-runtime"),z=require("react-dom/client"),u=require("@leverege/plugin"),S=require("lucide-react"),i=require("./Card-CHVaz_7u.cjs"),I=require("react"),U=require("@radix-ui/react-dropdown-menu"),D=require("./PluginSetup-B1eP6a5H.cjs"),V=require("./PluginSetup-6y-Q93AW.cjs"),l=require("./Label-BhnvyUcc.cjs"),P=require("./Tooltip-DQn1fHhM.cjs");function j(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(o,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return o.default=e,Object.freeze(o)}const h=j(I),a=j(U);function G(){if(!u.Config.get("ImaginariumApp","requireAuth",!0))return null;const o=u.Config.get("ImaginariumApp","logoutPath","/api/logout");return t.jsx(i.Button,{variant:"ghost",size:"sm","aria-label":"Sign out",onClick:()=>{window.location.href=o},children:t.jsx(S.LogOut,{className:"h-4 w-4"})})}const N={id:"imaginarium.ui.LogoutItem",sort:100,component:G},M="imaginarium.ui.theme";function H(){if(typeof window>"u")return"light";const e=window.localStorage.getItem(M);return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function _(){const[e,o]=I.useState(H);I.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem(M,e)},[e]);const n=e==="dark"?"light":"dark";return t.jsx(i.Button,{variant:"ghost",size:"sm","aria-label":`Switch to ${n} mode`,onClick:()=>o(n),children:e==="dark"?t.jsx(S.Sun,{className:"h-4 w-4"}):t.jsx(S.Moon,{className:"h-4 w-4"})})}const k={id:"imaginarium.ui.UIModeItem",sort:90,component:_},R=a.Root,A=a.Trigger,E=a.Group,$=a.Portal,K=a.Sub,Y=a.RadioGroup,F=h.forwardRef(({className:e,inset:o,children:n,...r},f)=>t.jsxs(a.SubTrigger,{ref:f,className:i.cn("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",o&&"pl-8",e),...r,children:[n,t.jsx(S.ChevronRight,{className:"ml-auto h-4 w-4"})]}));F.displayName=a.SubTrigger.displayName;const q=h.forwardRef(({className:e,...o},n)=>t.jsx(a.SubContent,{ref:n,className:i.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",e),...o}));q.displayName=a.SubContent.displayName;const b=h.forwardRef(({className:e,sideOffset:o=4,...n},r)=>t.jsx(a.Portal,{children:t.jsx(a.Content,{ref:r,sideOffset:o,className:i.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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",e),...n})}));b.displayName=a.Content.displayName;const v=h.forwardRef(({className:e,inset:o,...n},r)=>t.jsx(a.Item,{ref:r,className:i.cn("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o&&"pl-8",e),...n}));v.displayName=a.Item.displayName;const T=h.forwardRef(({className:e,children:o,checked:n,...r},f)=>t.jsxs(a.CheckboxItem,{ref:f,className:i.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(a.ItemIndicator,{children:t.jsx(S.Check,{className:"h-4 w-4"})})}),o]}));T.displayName=a.CheckboxItem.displayName;const B=h.forwardRef(({className:e,children:o,...n},r)=>t.jsxs(a.RadioItem,{ref:r,className:i.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(a.ItemIndicator,{children:t.jsx(S.Circle,{className:"h-2 w-2 fill-current"})})}),o]}));B.displayName=a.RadioItem.displayName;const x=h.forwardRef(({className:e,inset:o,...n},r)=>t.jsx(a.Label,{ref:r,className:i.cn("px-2 py-1.5 text-sm font-semibold",o&&"pl-8",e),...n}));x.displayName=a.Label.displayName;const C=h.forwardRef(({className:e,...o},n)=>t.jsx(a.Separator,{ref:n,className:i.cn("-mx-1 my-1 h-px bg-muted",e),...o}));C.displayName=a.Separator.displayName;const O=({className:e,...o})=>t.jsx("span",{className:i.cn("ml-auto text-xs tracking-widest opacity-60",e),...o});O.displayName="DropdownMenuShortcut";function J(){const e=g.useFilters(),o=new Set(e.hiddenSystemConfigTypes),n=new Set(e.hiddenSystemConfigTags),r=e.knownSystemConfigTypes.length>0,f=e.knownSystemConfigTags.length>0,y=e.hiddenSystemConfigTypes.length+e.hiddenSystemConfigTags.length,m=!e.showDev||y>0;return t.jsxs(R,{children:[t.jsx(A,{asChild:!0,children:t.jsxs(i.Button,{variant:m?"secondary":"ghost",size:"sm","aria-label":e.filteredOutCount>0?`Filter (${e.filteredOutCount} hidden)`:"Filter",children:[t.jsx(S.Filter,{className:"h-4 w-4"}),e.filteredOutCount>0?t.jsx("span",{className:"ml-1 inline-flex min-w-4 items-center justify-center rounded-full bg-primary px-1 py-0 text-[0.625rem] font-medium leading-4 text-primary-foreground",children:e.filteredOutCount}):null]})}),t.jsxs(b,{align:"end",className:"min-w-48",children:[t.jsx(T,{checked:e.showDev,onCheckedChange:e.setShowDev,children:"Show Development"}),r?t.jsxs(I.Fragment,{children:[t.jsx(C,{}),t.jsx(x,{children:"Types"}),e.knownSystemConfigTypes.map(d=>t.jsx(T,{checked:!o.has(d),onCheckedChange:()=>e.toggleSystemConfigType(d),children:d},d))]}):null,f?t.jsxs(I.Fragment,{children:[t.jsx(C,{}),t.jsx(x,{children:"Tags"}),e.knownSystemConfigTags.map(d=>t.jsx(T,{checked:!n.has(d),onCheckedChange:()=>e.toggleSystemConfigTag(d),children:d},d))]}):null,y>0?t.jsxs(I.Fragment,{children:[t.jsx(C,{}),t.jsx(v,{onClick:e.clearHidden,children:"Clear filters"})]}):null]})]})}const L={id:"imaginarium.ui.SystemConfigFilterItem",sort:80,component:J},Q={install(e){V.ReleaseSetup.install(e)}},W={install(e){p.SystemSetup.install(e),D.SecretSetup.install(e),Q.install(e),e.addPlugin(c.ProviderType,{id:"imaginarium.ui.FilterProvider",sort:50,component:g.FilterProvider}),e.addPlugin(c.ProviderType,{id:"imaginarium.ui.SystemConfigsProvider",sort:40,component:g.SystemConfigsProvider}),e.addPlugin(c.TopBarItemType,L),e.addPlugin(c.TopBarItemType,k),e.addPlugin(c.TopBarItemType,N),console.log("Installing built-in plugin setup!!"),e.addPlugin(c.PageType,{id:"imaginarium.RootRedirect",path:"/",element:()=>(console.log("Redirecting from / to /system-config"),window.location.replace(u.Config.get("ImaginariumApp","rootRedirect","/system-config")),null)})}},X={init(e,o){const n=e??{},r=n.config??{};for(const y of Object.keys(r)){const m=r[y];if(m)for(const d of Object.keys(m))u.Config.set(y,d,m[d])}const f=new Set(n.excludes??[]);f.size>0&&u.Plugins.addMutator((y,m)=>m&&typeof m=="object"&&f.has(m.id??"")?null:m);for(const y of n.mutators??[])u.Plugins.addMutator(y);console.log("Installing built-in plugin setup..."),W.install(u.Plugins),o.install(u.Plugins)},create(){const e=u.Config.get("ImaginariumApp","rootElement","#root"),o=u.Config.get("ImaginariumApp","apiBaseUrl","/api"),n=u.Config.get("ImaginariumApp","title","Imaginarium"),r=typeof e=="string"?document.querySelector(e):e;if(!r)throw new Error(`ImaginariumUI.create: root element not found (${String(e)})`);z.createRoot(r).render(t.jsx(s.ImaginariumApp,{apiBaseUrl:o,title:n}))}};exports.NavItemType=c.NavItemType;exports.PageDocsType=c.PageDocsType;exports.PageType=c.PageType;exports.ProviderType=c.ProviderType;exports.TopBarItemType=c.TopBarItemType;exports.addNavItem=w.addNavItem;exports.addPage=w.addPage;exports.addPageDocs=w.addPageDocs;exports.addProvider=w.addProvider;exports.getNavItems=w.getNavItems;exports.getPages=w.getPages;exports.getProviders=w.getProviders;exports.AppSidebar=s.AppSidebar;exports.ImaginariumApp=s.ImaginariumApp;exports.LoginPage=s.LoginPage;exports.RequireAuth=s.RequireAuth;exports.Shell=s.Shell;exports.Toast=s.Toast;exports.ToastAction=s.ToastAction;exports.ToastClose=s.ToastClose;exports.ToastDescription=s.ToastDescription;exports.ToastProvider=s.ToastProvider;exports.ToastTitle=s.ToastTitle;exports.ToastViewport=s.ToastViewport;exports.Toaster=s.Toaster;exports.useRegisterTabDocs=s.useRegisterTabDocs;exports.ImagineSystemNavItem=p.ImagineSystemNavItem;exports.ImagineSystemNavItemId=p.ImagineSystemNavItemId;exports.ImagineSystemPage=p.ImagineSystemPage;exports.ImagineSystemPageId=p.ImagineSystemPageId;exports.ImagineSystemView=p.ImagineSystemView;exports.SystemSetup=p.SystemSetup;exports.SystemSetupDefault=p.SystemSetup;exports.TagInput=p.TagInput;exports.FilterProvider=g.FilterProvider;exports.MarkdownPageDoc=g.MarkdownPageDoc;exports.SystemConfigsProvider=g.SystemConfigsProvider;exports.applyConfigFilters=g.applyConfigFilters;exports.isDevConfig=g.isDevConfig;exports.useFilters=g.useFilters;exports.useSystemConfigs=g.useSystemConfigs;exports.Button=i.Button;exports.Card=i.Card;exports.CardContent=i.CardContent;exports.CardDescription=i.CardDescription;exports.CardFooter=i.CardFooter;exports.CardHeader=i.CardHeader;exports.CardTitle=i.CardTitle;exports.ImaginariumApiProvider=i.ImaginariumApiProvider;exports.buttonVariants=i.buttonVariants;exports.cn=i.cn;exports.toast=i.toast;exports.useImaginariumApi=i.useImaginariumApi;exports.useToast=i.useToast;exports.SecretNavItem=D.SecretNavItem;exports.SecretPage=D.SecretPage;exports.SecretSetup=D.SecretSetup;exports.SecretView=D.SecretView;exports.Dialog=l.Dialog;exports.DialogClose=l.DialogClose;exports.DialogContent=l.DialogContent;exports.DialogDescription=l.DialogDescription;exports.DialogFooter=l.DialogFooter;exports.DialogHeader=l.DialogHeader;exports.DialogOverlay=l.DialogOverlay;exports.DialogPortal=l.DialogPortal;exports.DialogTitle=l.DialogTitle;exports.DialogTrigger=l.DialogTrigger;exports.Input=l.Input;exports.Label=l.Label;exports.Tooltip=P.Tooltip;exports.TooltipContent=P.TooltipContent;exports.TooltipProvider=P.TooltipProvider;exports.TooltipTrigger=P.TooltipTrigger;exports.DropdownMenu=R;exports.DropdownMenuCheckboxItem=T;exports.DropdownMenuContent=b;exports.DropdownMenuGroup=E;exports.DropdownMenuItem=v;exports.DropdownMenuLabel=x;exports.DropdownMenuPortal=$;exports.DropdownMenuRadioGroup=Y;exports.DropdownMenuRadioItem=B;exports.DropdownMenuSeparator=C;exports.DropdownMenuShortcut=O;exports.DropdownMenuSub=K;exports.DropdownMenuSubContent=q;exports.DropdownMenuSubTrigger=F;exports.DropdownMenuTrigger=A;exports.ImaginariumUI=X;exports.LogoutItem=N;exports.SystemConfigFilterItem=L;exports.UIModeItem=k;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/lib/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { PageType, NavItemType, ProviderType, TopBarItemType, PageDocsType, } fr
|
|
|
8
8
|
export { addPageDocs } from './plugins/registry';
|
|
9
9
|
export type { PageDocsPlugin } from './plugins/types';
|
|
10
10
|
export { useRegisterTabDocs } from './docs/PageDocsContext';
|
|
11
|
+
export { MarkdownPageDoc } from './docs/MarkdownPageDoc';
|
|
11
12
|
export { LogoutItem, UIModeItem, SystemConfigFilterItem, } from './shell/items';
|
|
12
13
|
export { SystemConfigsProvider, useSystemConfigs, type SystemConfigsContextValue, } from './system/SystemConfigsContext';
|
|
13
14
|
export { default as ImagineSystemView, type ImagineSystemViewProps, } from './system/ImagineSystemView';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAEzE,OAAO,EACL,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,cAAc,EACd,YAAY,GACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/lib/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { a as C, T as y, P as N } from "./PluginTypes-mZ4TjxPV.js";
|
|
2
2
|
import { N as Te, b as xe } from "./PluginTypes-mZ4TjxPV.js";
|
|
3
|
-
import { a as
|
|
4
|
-
import { I as
|
|
3
|
+
import { a as De, b as ve, f as Pe, c as ke, g as Me, d as Re, e as Ae } from "./registry-CMZCG8pH.js";
|
|
4
|
+
import { I as D } from "./ImaginariumApp-D7jCl_VH.js";
|
|
5
5
|
import { A as Le, L as ze, R as Be, S as Oe, T as je, a as Ue, b as Ee, c as qe, d as Ge, e as He, f as Ve, g as $e, u as _e } from "./ImaginariumApp-D7jCl_VH.js";
|
|
6
|
-
import { S as
|
|
6
|
+
import { S as v } from "./PluginSetup-bkVVFe8I.js";
|
|
7
7
|
import { I as Ye, a as Je, b as Qe, c as We, d as Xe, T as Ze } from "./PluginSetup-bkVVFe8I.js";
|
|
8
8
|
import { a as P, F as k, S as M } from "./MarkdownPageDoc-xK0hMx2S.js";
|
|
9
|
-
import {
|
|
9
|
+
import { M as tt, b as ot, i as at, u as nt } from "./MarkdownPageDoc-xK0hMx2S.js";
|
|
10
10
|
import { jsx as t, jsxs as d } from "react/jsx-runtime";
|
|
11
11
|
import { createRoot as R } from "react-dom/client";
|
|
12
12
|
import { Config as p, Plugins as g } from "@leverege/plugin";
|
|
13
13
|
import { LogOut as A, Sun as F, Moon as L, ChevronRight as z, Check as B, Circle as O, Filter as j } from "lucide-react";
|
|
14
14
|
import { B as I, c as l } from "./Card-D2LdIJwJ.js";
|
|
15
|
-
import { C as
|
|
15
|
+
import { C as it, f as rt, e as dt, g as lt, b as mt, d as ct, I as ut, h as pt, t as gt, a as ft, u as ht } from "./Card-D2LdIJwJ.js";
|
|
16
16
|
import * as u from "react";
|
|
17
17
|
import { useState as U, useEffect as E, Fragment as w } from "react";
|
|
18
18
|
import * as n from "@radix-ui/react-dropdown-menu";
|
|
19
19
|
import { b as q } from "./PluginSetup-CuSRbqiM.js";
|
|
20
|
-
import { S as
|
|
20
|
+
import { S as wt, a as St, c as It } from "./PluginSetup-CuSRbqiM.js";
|
|
21
21
|
import { g as G } from "./PluginSetup-IjHkViiY.js";
|
|
22
|
-
import { D as
|
|
23
|
-
import { T as
|
|
22
|
+
import { D as bt, f as Tt, a as xt, d as Nt, e as Dt, b as vt, g as Pt, h as kt, c as Mt, i as Rt, I as At, L as Ft } from "./Label-v0wUXs4O.js";
|
|
23
|
+
import { T as zt, a as Bt, b as Ot, c as jt } from "./Tooltip-CIwKmgzA.js";
|
|
24
24
|
function H() {
|
|
25
25
|
if (!p.get("ImaginariumApp", "requireAuth", !0))
|
|
26
26
|
return null;
|
|
@@ -251,7 +251,7 @@ const te = {
|
|
|
251
251
|
}
|
|
252
252
|
}, ae = {
|
|
253
253
|
install(e) {
|
|
254
|
-
|
|
254
|
+
v.install(e), q.install(e), oe.install(e), e.addPlugin(C, {
|
|
255
255
|
id: "imaginarium.ui.FilterProvider",
|
|
256
256
|
sort: 50,
|
|
257
257
|
component: k
|
|
@@ -296,29 +296,29 @@ const te = {
|
|
|
296
296
|
if (!s)
|
|
297
297
|
throw new Error(`ImaginariumUI.create: root element not found (${String(e)})`);
|
|
298
298
|
R(s).render(
|
|
299
|
-
/* @__PURE__ */ t(
|
|
299
|
+
/* @__PURE__ */ t(D, { apiBaseUrl: o, title: a })
|
|
300
300
|
);
|
|
301
301
|
}
|
|
302
302
|
};
|
|
303
303
|
export {
|
|
304
304
|
Le as AppSidebar,
|
|
305
305
|
I as Button,
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
306
|
+
it as Card,
|
|
307
|
+
rt as CardContent,
|
|
308
|
+
dt as CardDescription,
|
|
309
|
+
lt as CardFooter,
|
|
310
|
+
mt as CardHeader,
|
|
311
|
+
ct as CardTitle,
|
|
312
|
+
bt as Dialog,
|
|
313
|
+
Tt as DialogClose,
|
|
314
|
+
xt as DialogContent,
|
|
315
|
+
Nt as DialogDescription,
|
|
316
|
+
Dt as DialogFooter,
|
|
317
317
|
vt as DialogHeader,
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
318
|
+
Pt as DialogOverlay,
|
|
319
|
+
kt as DialogPortal,
|
|
320
|
+
Mt as DialogTitle,
|
|
321
|
+
Rt as DialogTrigger,
|
|
322
322
|
Y as DropdownMenu,
|
|
323
323
|
f as DropdownMenuCheckboxItem,
|
|
324
324
|
T as DropdownMenuContent,
|
|
@@ -335,32 +335,33 @@ export {
|
|
|
335
335
|
Q as DropdownMenuSubTrigger,
|
|
336
336
|
J as DropdownMenuTrigger,
|
|
337
337
|
k as FilterProvider,
|
|
338
|
-
|
|
339
|
-
|
|
338
|
+
ut as ImaginariumApiProvider,
|
|
339
|
+
D as ImaginariumApp,
|
|
340
340
|
Ie as ImaginariumUI,
|
|
341
341
|
Ye as ImagineSystemNavItem,
|
|
342
342
|
Je as ImagineSystemNavItemId,
|
|
343
343
|
Qe as ImagineSystemPage,
|
|
344
344
|
We as ImagineSystemPageId,
|
|
345
345
|
Xe as ImagineSystemView,
|
|
346
|
-
|
|
347
|
-
|
|
346
|
+
At as Input,
|
|
347
|
+
Ft as Label,
|
|
348
348
|
ze as LoginPage,
|
|
349
349
|
V as LogoutItem,
|
|
350
|
+
tt as MarkdownPageDoc,
|
|
350
351
|
Te as NavItemType,
|
|
351
352
|
xe as PageDocsType,
|
|
352
353
|
N as PageType,
|
|
353
354
|
C as ProviderType,
|
|
354
355
|
Be as RequireAuth,
|
|
355
|
-
|
|
356
|
-
|
|
356
|
+
wt as SecretNavItem,
|
|
357
|
+
St as SecretPage,
|
|
357
358
|
q as SecretSetup,
|
|
358
|
-
|
|
359
|
+
It as SecretView,
|
|
359
360
|
Oe as Shell,
|
|
360
361
|
te as SystemConfigFilterItem,
|
|
361
362
|
M as SystemConfigsProvider,
|
|
362
|
-
|
|
363
|
-
|
|
363
|
+
v as SystemSetup,
|
|
364
|
+
v as SystemSetupDefault,
|
|
364
365
|
Ze as TagInput,
|
|
365
366
|
je as Toast,
|
|
366
367
|
Ue as ToastAction,
|
|
@@ -370,28 +371,28 @@ export {
|
|
|
370
371
|
He as ToastTitle,
|
|
371
372
|
Ve as ToastViewport,
|
|
372
373
|
$e as Toaster,
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
374
|
+
zt as Tooltip,
|
|
375
|
+
Bt as TooltipContent,
|
|
376
|
+
Ot as TooltipProvider,
|
|
377
|
+
jt as TooltipTrigger,
|
|
377
378
|
y as TopBarItemType,
|
|
378
379
|
K as UIModeItem,
|
|
379
|
-
|
|
380
|
-
|
|
380
|
+
De as addNavItem,
|
|
381
|
+
ve as addPage,
|
|
381
382
|
Pe as addPageDocs,
|
|
382
383
|
ke as addProvider,
|
|
383
|
-
|
|
384
|
-
|
|
384
|
+
ot as applyConfigFilters,
|
|
385
|
+
pt as buttonVariants,
|
|
385
386
|
l as cn,
|
|
386
387
|
Me as getNavItems,
|
|
387
388
|
Re as getPages,
|
|
388
389
|
Ae as getProviders,
|
|
389
|
-
|
|
390
|
-
|
|
390
|
+
at as isDevConfig,
|
|
391
|
+
gt as toast,
|
|
391
392
|
P as useFilters,
|
|
392
|
-
|
|
393
|
+
ft as useImaginariumApi,
|
|
393
394
|
_e as useRegisterTabDocs,
|
|
394
|
-
|
|
395
|
-
|
|
395
|
+
nt as useSystemConfigs,
|
|
396
|
+
ht as useToast
|
|
396
397
|
};
|
|
397
398
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/imaginarium-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Reusable UI library and plugin framework for Imaginarium apps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.cjs",
|
|
@@ -94,4 +94,4 @@
|
|
|
94
94
|
"vitest": "^2.1.0",
|
|
95
95
|
"wouter": "^3.3.5"
|
|
96
96
|
}
|
|
97
|
-
}
|
|
97
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ export {
|
|
|
16
16
|
export { addPageDocs } from './plugins/registry'
|
|
17
17
|
export type { PageDocsPlugin } from './plugins/types'
|
|
18
18
|
export { useRegisterTabDocs } from './docs/PageDocsContext'
|
|
19
|
+
export { MarkdownPageDoc } from './docs/MarkdownPageDoc'
|
|
19
20
|
|
|
20
21
|
export {
|
|
21
22
|
LogoutItem,
|