@coreframe/dashboard 0.4.0-next.3 → 0.4.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.
Files changed (52) hide show
  1. package/README.md +152 -21
  2. package/dist/package/access.d.ts +7 -0
  3. package/dist/package/access.js +30 -0
  4. package/dist/package/app/root.js +1 -1
  5. package/dist/package/app/sculpted-runtime.js +1 -0
  6. package/dist/package/app/shell.js +1 -1
  7. package/dist/package/app-client.d.ts +5 -4
  8. package/dist/package/app-client.js +1 -1
  9. package/dist/package/build.js +2 -2
  10. package/dist/package/config.d.ts +19 -2
  11. package/dist/package/index.d.ts +3 -3
  12. package/dist/package/node-fetch-adapter.js +1 -1
  13. package/dist/package/server.d.ts +8 -2
  14. package/dist/package/server.js +1 -1
  15. package/dist/package/types.d.ts +1 -17
  16. package/dist/package/web/styled-system/css/conditions.js +1 -1
  17. package/dist/package/web/styled-system/helpers.js +1 -1
  18. package/dist/package/web/styled-system/recipes/dashboard-button.js +1 -1
  19. package/dist/package/web/styled-system/recipes/dashboard-status.js +1 -1
  20. package/dist/package/web/styled-system/recipes/runtime.js +1 -1
  21. package/dist/package/web/ui/index.d.ts +1 -1
  22. package/dist/package/web/ui/styles.js +1 -1
  23. package/dist/package/web-shell/index.d.ts +2 -1
  24. package/dist/package/web-shell/index.js +1 -1
  25. package/dist/package/web-shell/menu.d.ts +19 -0
  26. package/dist/package/web-shell/menu.js +1 -0
  27. package/dist/package/web-shell/shell.d.ts +7 -6
  28. package/dist/package/web-shell/shell.js +6 -1
  29. package/dist/package/worker.d.ts +3 -3
  30. package/dist/package/worker.js +1 -1
  31. package/package.json +16 -33
  32. package/dist/package/plugins/diagnostics/api/contract.d.ts +0 -10
  33. package/dist/package/plugins/diagnostics/api/contract.js +0 -1
  34. package/dist/package/plugins/diagnostics/api/local.d.ts +0 -10
  35. package/dist/package/plugins/diagnostics/api/local.js +0 -1
  36. package/dist/package/plugins/diagnostics/api/worker.d.ts +0 -8
  37. package/dist/package/plugins/diagnostics/api/worker.js +0 -1
  38. package/dist/package/plugins/diagnostics/index.d.ts +0 -30
  39. package/dist/package/plugins/diagnostics/index.js +0 -1
  40. package/dist/package/plugins/diagnostics/web/queries.js +0 -1
  41. package/dist/package/plugins/diagnostics/web.d.ts +0 -4
  42. package/dist/package/plugins/diagnostics/web.js +0 -1
  43. package/dist/package/shell.css +0 -390
  44. package/dist/package/styled-css.js +0 -1
  45. package/dist/package/web/dashboard/dashboard-page.js +0 -1
  46. package/dist/package/web/dashboard/dashboard-section.js +0 -1
  47. package/dist/package/web/dashboard/dashboard.style.js +0 -1
  48. package/dist/package/web/dashboard/deployed-dashboard-page.js +0 -1
  49. package/dist/package/web/dashboard/findings.js +0 -1
  50. package/dist/package/web/dashboard/worker-environment.js +0 -1
  51. package/dist/package/web/root.style.js +0 -1
  52. package/dist/package/web/styled-system/css/css.js +0 -1
@@ -1 +1 @@
1
- import{createRecipe as e}from"./runtime.js";const t=e({name:`dashboardButton`,className:`dashboard-button`,defaultVariants:{size:`md`,tone:`accent`,variant:`solid`},compoundVariants:[{tone:`neutral`,variant:`solid`,className:`dashboard-button--compound__tone_neutral__variant_solid`},{tone:`accent`,variant:`solid`,className:`dashboard-button--compound__tone_accent__variant_solid`},{tone:`danger`,variant:`solid`,className:`dashboard-button--compound__tone_danger__variant_solid`},{tone:`accent`,variant:`outline`,className:`dashboard-button--compound__tone_accent__variant_outline`},{tone:`danger`,variant:`outline`,className:`dashboard-button--compound__tone_danger__variant_outline`},{tone:`accent`,variant:`quiet`,className:`dashboard-button--compound__tone_accent__variant_quiet`},{tone:`danger`,variant:`quiet`,className:`dashboard-button--compound__tone_danger__variant_quiet`}],variantMap:{size:[`lg`,`md`,`sm`],tone:[`accent`,`danger`,`neutral`],variant:[`outline`,`quiet`,`solid`]}});export{t as dashboardButton};
1
+ import{createRecipe as e}from"./runtime.js";const t=e({name:`dashboardButton`,className:`dashboard-button`,defaultVariants:{size:`md`,tone:`accent`,variant:`solid`},compoundVariants:[{tone:`neutral`,variant:`solid`,className:`dashboard-button--compound__tone_neutral__variant_solid`},{tone:`accent`,variant:`solid`,className:`dashboard-button--compound__tone_accent__variant_solid`},{tone:`danger`,variant:`solid`,className:`dashboard-button--compound__tone_danger__variant_solid`},{tone:`accent`,variant:`outline`,className:`dashboard-button--compound__tone_accent__variant_outline`},{tone:`danger`,variant:`outline`,className:`dashboard-button--compound__tone_danger__variant_outline`},{tone:`accent`,variant:`quiet`,className:`dashboard-button--compound__tone_accent__variant_quiet`},{tone:`danger`,variant:`quiet`,className:`dashboard-button--compound__tone_danger__variant_quiet`}],variantMap:{variant:[`solid`,`outline`,`quiet`],tone:[`neutral`,`accent`,`danger`],size:[`sm`,`md`,`lg`]}});export{t as dashboardButton};
@@ -1 +1 @@
1
- import{createRecipe as e}from"./runtime.js";const t=e({name:`dashboardStatus`,className:`dashboard-status`,defaultVariants:{tone:`neutral`},variantMap:{tone:[`danger`,`info`,`neutral`,`success`,`warning`]}});export{t as dashboardStatus};
1
+ import{createRecipe as e}from"./runtime.js";const t=e({name:`dashboardStatus`,className:`dashboard-status`,defaultVariants:{tone:`neutral`},variantMap:{tone:[`neutral`,`info`,`success`,`warning`,`danger`]}});export{t as dashboardStatus};
@@ -1 +1 @@
1
- import{createCssRuntime as e,getCompoundVariantClassNames as t,getSlotCompoundVariant as n,memo as r,splitProps as i,toHash as a,uniq as o,withDefaults as s,withoutSpace as c}from"../helpers.js";import{breakpointKeys as l,finalizeConditions as u,sortConditions as d}from"../css/conditions.js";import{cx as f}from"../css/cx.js";function p(e){let t=e.variantMap??{};return{name:e.name,className:e.className??e.name,slots:e.slots??[],variantMap:t,variantKeys:Object.keys(t),defaults:e.defaultVariants??{},compounds:e.compoundVariants??[]}}function m(n){let{name:i,className:o,variantMap:m,variantKeys:h,defaults:v,compounds:y}=p(n),{serializeCss:b}=e({hash:!1,conditions:{shift:d,finalize:u,breakpoints:{keys:l}},utility:{prefix:null,toHash:a,transform(e,t){return{className:t===`__ignore__`?o:`${o}--${e}_${c(t)}`}}}}),x=e=>e;function S(e={}){return{[o]:`__ignore__`,...s(v,e)}}function C(e){if(y.length!==0)for(let t of h){let n=e[t];if(typeof n==`object`&&n)throw Error(`[recipe:${o}:${t}] Conditions are not supported when using compound variants.`)}}function w(e){return t(y,S(e),x)}let T=_(r(function(e={},t=!0){C(e);let n=b(S(e));return t?f(n,w(e)):n}),i,h,m,S);return T.__recipe__=!0,T.__getCompoundVariantClasses__=w,T.merge=function(e){return g(T,e)},T}function h(e){let{name:t,className:i,slots:a,variantMap:o,variantKeys:c,defaults:l,compounds:u}=p(e),d=a.map(function(e){return[e,m({name:t,className:`${i}__${e}`,variantMap:o,defaultVariants:l,compoundVariants:n(u,e)})]}),f=r(function(e={}){let t={};for(let[n,r]of d)t[n]=r(e);return t});return _(f,t,c,o,function(e={}){return s(l,e)}),f.__recipe__=!1,f.classNameMap={},f}function g(e,t){if(e&&!t)return e;if(!e&&t)return t;function n(...n){let r=e(...n),i=t(...n);return r&&i?`${r} ${i}`:r||i}let r=o(e.variantKeys,t.variantKeys),i={};for(let n of r)i[n]=o(e.variantMap[n],t.variantMap[n]);return _(n,`${e.__name__} ${t.__name__}`,r,i,function(e){return e}),n.__recipe__=!0,n}function _(e,t,n,r,a){return e.__name__=t,e.raw=function(e){return e},e.variantKeys=n,e.variantMap=r,e.splitVariantProps=function(e){return i(e,n)},e.getVariantProps=a,e}export{m as createRecipe,h as createSlotRecipe};
1
+ import{createSerializeCss as e,getCompoundVariantClassNames as t,getSlotCompoundVariant as n,memo as r,splitProps as i,uniq as a,withDefaults as o,withoutSpace as s}from"../helpers.js";import{breakpointKeys as c,finalizeConditions as l,sortConditions as u}from"../css/conditions.js";import{cx as d}from"../css/cx.js";function f(e){let t=e.variantMap??{};return{name:e.name,className:e.className??e.name,slots:e.slots??[],variantMap:t,variantKeys:Object.keys(t),defaults:e.defaultVariants??{},compounds:e.compoundVariants??[]}}function p(n){let{name:i,className:a,variantMap:p,variantKeys:m,defaults:_,compounds:v}=f(n),y=e({hash:!1,conditions:{shift:u,finalize:l,breakpoints:{keys:c}},utility:{prefix:null,toHash(e,t){return t(e.join(`:`))},transform(e,t){return{className:t===`__ignore__`?a:`${a}--${e}_${s(t)}`}}}}),b=e=>e;function x(e={}){return{[a]:`__ignore__`,...o(_,e)}}function S(e){if(v.length!==0)for(let t of m){let n=e[t];if(typeof n==`object`&&n)throw Error(`[recipe:${a}:${t}] Conditions are not supported when using compound variants.`)}}function C(e){return t(v,x(e),b)}let w=g(r(function(e={},t=!0){S(e);let n=y(x(e));return t?d(n,C(e)):n}),i,m,p,x);return w.__recipe__=!0,w.__getCompoundVariantClasses__=C,w.merge=function(e){return h(w,e)},w}function m(e){let{name:t,className:i,slots:a,variantMap:s,variantKeys:c,defaults:l,compounds:u}=f(e),d=a.map(function(e){return[e,p({name:t,className:`${i}__${e}`,variantMap:s,defaultVariants:l,compoundVariants:n(u,e)})]}),m=r(function(e={}){let t={};for(let[n,r]of d)t[n]=r(e);return t});return g(m,t,c,s,function(e={}){return o(l,e)}),m.__recipe__=!1,m.classNameMap={},m}function h(e,t){if(e&&!t)return e;if(!e&&t)return t;function n(...n){let r=e(...n),i=t(...n);return r&&i?`${r} ${i}`:r||i}let r=a(e.variantKeys,t.variantKeys),i={};for(let n of r)i[n]=a(e.variantMap[n],t.variantMap[n]);return g(n,`${e.__name__} ${t.__name__}`,r,i,function(e){return e}),n.__recipe__=!0,n}function g(e,t,n,r,a){return e.__name__=t,e.raw=function(e){return e},e.variantKeys=n,e.variantMap=r,e.splitVariantProps=function(e){return i(e,n)},e.getVariantProps=a,e}export{p as createRecipe,m as createSlotRecipe};
@@ -2,7 +2,7 @@ import { AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes, ReactElemen
2
2
 
3
3
  //#region src/web/ui/index.d.ts
4
4
  interface PageProps extends HTMLAttributes<HTMLDivElement> {}
5
- /** Content layout for a dashboard route. The route shell owns the page heading. */
5
+ /** Optional content layout for a dashboard route. Pages own their headings and content insets. */
6
6
  declare function Page({
7
7
  className,
8
8
  ...props
@@ -1 +1 @@
1
- import{cx as e}from"../styled-system/css/cx.js";import"../../styled-css.js";import{dashboardButton as t}from"../styled-system/recipes/dashboard-button.js";import{dashboardConfirmDialog as n}from"../styled-system/recipes/dashboard-confirm-dialog.js";import{dashboardEmptyState as r}from"../styled-system/recipes/dashboard-empty-state.js";import{dashboardErrorState as i}from"../styled-system/recipes/dashboard-error-state.js";import{dashboardField as a}from"../styled-system/recipes/dashboard-field.js";import{dashboardPage as o}from"../styled-system/recipes/dashboard-page.js";import{dashboardSection as s}from"../styled-system/recipes/dashboard-section.js";import{dashboardStatus as c}from"../styled-system/recipes/dashboard-status.js";import{dashboardTabs as l}from"../styled-system/recipes/dashboard-tabs.js";const u={button:t,confirmDialog:n,emptyState:r,errorState:i,field:a,page:o,section:s,status:c,tabs:l};export{e as cx,u as styles};
1
+ import{cx as e}from"../styled-system/css/cx.js";import{dashboardButton as t}from"../styled-system/recipes/dashboard-button.js";import{dashboardConfirmDialog as n}from"../styled-system/recipes/dashboard-confirm-dialog.js";import{dashboardEmptyState as r}from"../styled-system/recipes/dashboard-empty-state.js";import{dashboardErrorState as i}from"../styled-system/recipes/dashboard-error-state.js";import{dashboardField as a}from"../styled-system/recipes/dashboard-field.js";import{dashboardPage as o}from"../styled-system/recipes/dashboard-page.js";import{dashboardSection as s}from"../styled-system/recipes/dashboard-section.js";import{dashboardStatus as c}from"../styled-system/recipes/dashboard-status.js";import{dashboardTabs as l}from"../styled-system/recipes/dashboard-tabs.js";const u={button:t,confirmDialog:n,emptyState:r,errorState:i,field:a,page:o,section:s,status:c,tabs:l};export{e as cx,u as styles};
@@ -1,2 +1,3 @@
1
+ import { DashboardMenu, DashboardMenuProps } from "./menu.js";
1
2
  import { DashboardEmptyState, DashboardErrorBoundary, DashboardIndexRedirect, DashboardShell, DashboardShellProps } from "./shell.js";
2
- export { DashboardEmptyState, DashboardErrorBoundary, DashboardIndexRedirect, DashboardShell, type DashboardShellProps };
3
+ export { DashboardEmptyState, DashboardErrorBoundary, DashboardIndexRedirect, DashboardMenu, type DashboardMenuProps, DashboardShell, type DashboardShellProps };
@@ -1 +1 @@
1
- import{DashboardEmptyState as e,DashboardErrorBoundary as t,DashboardIndexRedirect as n,DashboardShell as r}from"./shell.js";export{e as DashboardEmptyState,t as DashboardErrorBoundary,n as DashboardIndexRedirect,r as DashboardShell};
1
+ import{DashboardMenu as e}from"./menu.js";import{DashboardEmptyState as t,DashboardErrorBoundary as n,DashboardIndexRedirect as r,DashboardShell as i}from"./shell.js";export{t as DashboardEmptyState,n as DashboardErrorBoundary,r as DashboardIndexRedirect,e as DashboardMenu,i as DashboardShell};
@@ -0,0 +1,19 @@
1
+ import { DashboardPageManifestEntry } from "../config.js";
2
+
3
+ //#region src/web-shell/menu.d.ts
4
+ interface DashboardNavigation {
5
+ application?: {
6
+ name: string;
7
+ favicon: string;
8
+ };
9
+ pages: readonly DashboardPageManifestEntry[];
10
+ }
11
+ interface DashboardMenuProps {
12
+ className?: string;
13
+ }
14
+ /** Logo and navigation popover. Place inside a dashboard page to own its position. */
15
+ declare function DashboardMenu({
16
+ className
17
+ }: DashboardMenuProps): import("react").JSX.Element | null;
18
+ //#endregion
19
+ export { DashboardMenu, DashboardMenuProps, DashboardNavigation };
@@ -0,0 +1 @@
1
+ import{NavLink as e,useLocation as t}from"react-router";import{createContext as n,useContext as r,useEffect as i,useId as a,useRef as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";const u=n(void 0);function d({className:e}){let n=r(u),i=t();if(!n)throw Error(`DashboardMenu must be rendered inside a dashboard page.`);return n.pages.length<=1?null:c(f,{navigation:n,className:e},i.key)}function f({navigation:t,className:n}){let r=a(),u=o(null),d=o(null),f=o(null),p=o(void 0),[m,h]=s(!1);i(()=>{if(!m)return;if(p.current){let e=f.current?.querySelectorAll(`a`);(p.current===`first`?e?.[0]:e?.[e.length-1])?.focus(),p.current=void 0}function e(e){e.target instanceof Node&&!u.current?.contains(e.target)&&h(!1)}function t(e){e.key===`Escape`&&(h(!1),u.current?.contains(document.activeElement)&&d.current?.focus())}return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[m]);let{application:g,pages:_}=t;return l(`div`,{ref:u,className:[`coreframe-dashboard__menu`,n].filter(Boolean).join(` `),onPointerEnter:e=>{e.pointerType!==`touch`&&h(!0)},onPointerLeave:()=>{u.current?.contains(document.activeElement)||h(!1)},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||h(!1)},children:[c(`button`,{ref:d,type:`button`,className:`coreframe-dashboard__logo`,"aria-label":`Dashboard navigation`,"aria-controls":r,"aria-expanded":m,onClick:()=>h(e=>!e),onKeyDown:e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let t=e.key===`ArrowDown`?`first`:`last`;if(m){let e=f.current?.querySelectorAll(`a`);(t===`first`?e?.[0]:e?.[e.length-1])?.focus()}else p.current=t,h(!0)},children:g?c(`img`,{src:g.favicon,alt:``,className:`coreframe-dashboard__mark`}):c(`span`,{"aria-hidden":`true`,children:`C`})}),m?c(`div`,{className:`coreframe-dashboard__popover`,children:c(`nav`,{ref:f,id:r,className:`coreframe-dashboard__navigation`,"aria-label":`Dashboard`,children:c(`ul`,{className:`coreframe-dashboard__navigation-list`,children:_.map(t=>{let n=t.iconData;return c(`li`,{children:l(e,{className:`coreframe-dashboard__navigation-link`,to:`/${t.path}`,onClick:()=>{h(!1),d.current?.focus()},children:[c(`svg`,{"aria-hidden":`true`,className:`coreframe-dashboard__navigation-icon`,width:`20`,height:`20`,viewBox:`0 0 ${n.width} ${n.height}`,fill:`currentColor`,dangerouslySetInnerHTML:{__html:n.body}}),c(`span`,{className:`coreframe-dashboard__navigation-text`,children:t.title})]})},t.id)})})})}):null]})}export{d as DashboardMenu,u as DashboardNavigationContext};
@@ -1,16 +1,17 @@
1
- import { DashboardPageManifestEntry } from "../config.js";
1
+ import { DashboardNavigation } from "./menu.js";
2
2
 
3
3
  //#region src/web-shell/shell.d.ts
4
- interface DashboardShellProps {
5
- pages: readonly DashboardPageManifestEntry[];
6
- }
4
+ interface DashboardShellProps extends DashboardNavigation {}
7
5
  declare function DashboardShell({
8
- pages
6
+ pages,
7
+ application
9
8
  }: DashboardShellProps): import("react").JSX.Element;
10
9
  declare function DashboardIndexRedirect({
11
10
  pages
12
11
  }: DashboardShellProps): import("react").JSX.Element;
13
- declare function DashboardEmptyState(): import("react").JSX.Element;
12
+ declare function DashboardEmptyState({
13
+ pages
14
+ }: Partial<DashboardShellProps>): import("react").JSX.Element;
14
15
  declare function DashboardErrorBoundary(): import("react").JSX.Element;
15
16
  //#endregion
16
17
  export { DashboardEmptyState, DashboardErrorBoundary, DashboardIndexRedirect, DashboardShell, DashboardShellProps };
@@ -1 +1,6 @@
1
- import{useEffect as e,useRef as t,useState as n}from"react";import{Link as r,NavLink as i,Navigate as a,Outlet as o,isRouteErrorResponse as s,useLocation as c,useNavigation as l,useRouteError as u}from"react-router";import{jsx as d,jsxs as f}from"react/jsx-runtime";function p({pages:r}){let a=c(),s=l(),[u,p]=n(()=>globalThis.window!==void 0&&globalThis.matchMedia(`(max-width: 47.999rem)`).matches),[m,h]=n(!1),[g,v]=n(!1),y=t(null),b=t(null),x=t(!1),S=_(r,a.pathname);e(()=>{let e=globalThis.matchMedia(`(max-width: 47.999rem)`),t=()=>p(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),e(()=>{u&&(m?b.current?.focus():x.current&&y.current?.focus(),x.current=m)},[u,m]),e(()=>{if(!m)return;let e=e=>{e.key===`Escape`&&h(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[m]);let C=u?m:!g;return f(`div`,{className:`coreframe-dashboard`,"data-collapsed":!u&&g?`true`:`false`,"data-drawer-open":u&&m?`true`:`false`,children:[d(`button`,{ref:y,type:`button`,className:`coreframe-dashboard__toggle`,"aria-controls":`coreframe-dashboard-navigation`,"aria-expanded":C,"aria-label":C?`Collapse dashboard navigation`:`Expand dashboard navigation`,onClick:()=>{u?h(e=>!e):v(e=>!e)},children:d(`span`,{"aria-hidden":`true`,children:C?`←`:`☰`})}),d(`button`,{type:`button`,className:`coreframe-dashboard__backdrop`,"aria-label":`Close dashboard navigation`,tabIndex:u&&m?0:-1,onClick:()=>h(!1)}),d(`aside`,{className:`coreframe-dashboard__sidebar`,role:u?`dialog`:void 0,"aria-label":u?`Dashboard navigation`:void 0,"aria-modal":u&&m?!0:void 0,"aria-hidden":u&&!m?!0:void 0,inert:u&&!m?!0:void 0,children:f(`nav`,{ref:b,id:`coreframe-dashboard-navigation`,className:`coreframe-dashboard__navigation`,"aria-label":`Dashboard`,tabIndex:u?-1:void 0,children:[f(`div`,{className:`coreframe-dashboard__brand`,"aria-label":`Coreframe Dashboard`,children:[d(`span`,{"aria-hidden":`true`,className:`coreframe-dashboard__mark`,children:`C`}),d(`span`,{className:`coreframe-dashboard__navigation-text`,children:`Coreframe`})]}),r.length>0?d(`ul`,{className:`coreframe-dashboard__navigation-list`,children:r.map(e=>d(`li`,{children:f(i,{className:`coreframe-dashboard__navigation-link`,to:`/${e.path}`,onClick:()=>h(!1),children:[d(`span`,{"aria-hidden":`true`,className:`coreframe-dashboard__navigation-dot`}),d(`span`,{className:`coreframe-dashboard__navigation-text`,children:e.title})]})},e.id))}):d(`p`,{className:`coreframe-dashboard__navigation-empty`,children:`No pages`})]})}),f(`main`,{className:`coreframe-dashboard__main`,children:[S?f(`header`,{className:`coreframe-dashboard__page-header`,children:[d(`p`,{className:`coreframe-dashboard__eyebrow`,children:`Dashboard`}),d(`h1`,{children:S.title}),S.description?d(`p`,{children:S.description}):null]}):null,s.state===`idle`?null:d(`div`,{className:`coreframe-dashboard__pending`,role:`status`,children:`Loading page…`}),d(`div`,{className:`coreframe-dashboard__content`,children:d(o,{})})]})]})}function m({pages:e}){let t=e[0];return t?d(a,{replace:!0,to:`/${t.path}`}):d(h,{})}function h(){return f(`section`,{className:`coreframe-dashboard__state`,"aria-labelledby":`dashboard-empty-title`,children:[d(`p`,{className:`coreframe-dashboard__eyebrow`,children:`Dashboard`}),d(`h1`,{id:`dashboard-empty-title`,children:`No dashboard pages yet`}),f(`p`,{children:[`Add a page under `,d(`code`,{children:`dashboard/pages/`}),` or register a plugin in`,` `,d(`code`,{children:`dashboard.config.ts`}),`.`]})]})}function g(){let e=u(),t=s(e)&&e.status===404,n=import.meta.env.DEV&&e instanceof Error?e.message:t?`The requested dashboard page does not exist.`:`The dashboard hit an unexpected error.`;return f(`main`,{className:`coreframe-dashboard__state`,children:[d(`p`,{className:`coreframe-dashboard__eyebrow`,children:`Coreframe Dashboard`}),d(`h1`,{children:t?`Page not found`:`Dashboard unavailable`}),d(`p`,{children:n}),d(r,{className:`coreframe-dashboard__button`,to:`/`,children:`Go to dashboard`})]})}function _(e,t){let n=t.split(`/`).filter(Boolean)[0];return e.find(e=>e.path===n)??(n?void 0:e[0])}export{h as DashboardEmptyState,g as DashboardErrorBoundary,m as DashboardIndexRedirect,p as DashboardShell};
1
+ import{DashboardMenu as e,DashboardNavigationContext as t}from"./menu.js";import{Link as n,Navigate as r,Outlet as i,isRouteErrorResponse as a,useLocation as o,useRouteError as s}from"react-router";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u({pages:n,application:r}){let a=o().pathname.split(`/`).filter(Boolean)[0],s=n.find(e=>e.path===a)??(a?void 0:n[0]);return l(t,{value:{pages:n,application:r},children:[s?.layout===`standalone`?null:c(e,{className:`coreframe-dashboard__floating-navigation`}),c(i,{})]})}function d({pages:e}){let t=e[0];return t&&e.some(e=>e.source===`app`)?c(r,{replace:!0,to:`/${t.path}`}):c(f,{pages:e})}function f({pages:e=[]}){return l(`main`,{className:`coreframe-dashboard__introduction`,children:[c(`p`,{className:`coreframe-dashboard__eyebrow`,children:`Coreframe Dashboard`}),c(`h1`,{children:`Your dashboard starts here`}),c(`p`,{children:`A space for your app’s internal tools. Build ordinary React Router pages with your own content, layout, and API access.`}),e.length>0?l(`section`,{children:[c(`h2`,{children:`Installed tools`}),c(`ul`,{children:e.map(e=>c(`li`,{children:c(n,{to:`/${e.path}`,children:e.title})},e.id))})]}):null,l(`section`,{children:[c(`h2`,{children:`Add your first page`}),l(`p`,{children:[`Create `,c(`code`,{children:`dashboard/pages/overview/route.tsx`}),`:`]}),c(`pre`,{children:c(`code`,{children:`export default function Overview() {
2
+ return <main><h1>Overview</h1></main>
3
+ }`})}),l(`p`,{children:[`Add an adjacent `,c(`code`,{children:`page.yaml`}),` with a`,` `,c(`a`,{href:`https://icones.js.org/collection/tabler`,children:`Tabler icon`}),` and optional title:`]}),c(`pre`,{children:c(`code`,{children:`icon: home
4
+ title: Overview`})}),l(`p`,{children:[`The page becomes available at `,c(`code`,{children:`/__dashboard/overview`}),`. This introduction disappears once an app-owned page exists.`]})]}),l(`section`,{children:[c(`h2`,{children:`Make it yours`}),l(`p`,{children:[`Pages own their headings and spacing. Customize default styles in`,` `,c(`code`,{children:`dashboard/panda.config.ts`}),`. A logo menu appears when there is more than one page.`]}),l(`p`,{children:[`Register optional reusable plugins in `,c(`code`,{children:`dashboard/dashboard.config.ts`}),`. App-owned pages are discovered automatically and do not need registration.`]})]}),l(`section`,{children:[c(`h2`,{children:`Disable the dashboard build`}),l(`p`,{children:[`If you do not need the dashboard, add this setting to the existing`,` `,c(`code`,{children:`defineConfig`}),` call in your project’s `,c(`code`,{children:`coreframe.config.ts`}),`:`]}),c(`pre`,{children:c(`code`,{children:`dashboard: {
5
+ enabled: false,
6
+ },`})}),c(`p`,{children:`This skips the dashboard bundle and its local development server. Remove the setting to enable the dashboard again.`})]})]})}function p(){let e=s(),t=a(e)&&e.status===404,r=import.meta.env.DEV&&e instanceof Error?e.message:t?`The requested dashboard page does not exist.`:`The dashboard hit an unexpected error.`;return l(`main`,{className:`coreframe-dashboard__state`,children:[c(`p`,{className:`coreframe-dashboard__eyebrow`,children:`Coreframe Dashboard`}),c(`h1`,{children:t?`Page not found`:`Dashboard unavailable`}),c(`p`,{children:r}),c(n,{className:`coreframe-dashboard__button`,to:`/`,children:`Go to dashboard`})]})}export{f as DashboardEmptyState,p as DashboardErrorBoundary,d as DashboardIndexRedirect,u as DashboardShell};
@@ -1,3 +1,4 @@
1
+ import { DashboardAccess } from "./access.js";
1
2
  import { DashboardPluginRegistration } from "./api/contract.js";
2
3
  import { DashboardLink, DashboardReleaseIdentity, DeployedConfigurationEntry } from "./types.js";
3
4
 
@@ -11,7 +12,6 @@ type DashboardWorkerEnv = {
11
12
  tag?: string;
12
13
  timestamp?: string;
13
14
  };
14
- DASHBOARD_PASSWORD?: string;
15
15
  DEPLOY_ENV?: "production" | "staging";
16
16
  POSTHOG_RELEASE?: string;
17
17
  };
@@ -31,7 +31,7 @@ type DashboardBuildMetadata = {
31
31
  type DashboardWorkerOptions = {
32
32
  plugins: readonly DashboardPluginRegistration<DashboardWorkerHostData>[];
33
33
  };
34
- type DashboardWorkerHandler = (request: Request, env: DashboardWorkerEnv) => Promise<Response> | null;
34
+ type DashboardWorkerHandler = (request: Request, env: DashboardWorkerEnv, access: DashboardAccess) => Promise<Response> | null;
35
35
  type DashboardWorkerHostData = {
36
36
  environment: "production" | "staging";
37
37
  release: DashboardReleaseIdentity;
@@ -39,6 +39,6 @@ type DashboardWorkerHostData = {
39
39
  links: readonly DashboardLink[];
40
40
  };
41
41
  declare function createWorkerHandler(options: DashboardWorkerOptions): DashboardWorkerHandler;
42
- declare function handleDashboardRequest<Env extends DashboardWorkerEnv>(request: Request, env: Env, options: DashboardWorkerOptions): Promise<Response> | null;
42
+ declare function handleDashboardRequest<Env extends DashboardWorkerEnv>(request: Request, env: Env, options: DashboardWorkerOptions, access: DashboardAccess): Promise<Response> | null;
43
43
  //#endregion
44
44
  export { DashboardBuildMetadata, DashboardWorkerEnv, DashboardWorkerHandler, DashboardWorkerHostData, DashboardWorkerOptions, createWorkerHandler, handleDashboardRequest };
@@ -1 +1 @@
1
- import{createDashboardPluginDispatcher as e}from"./api/dispatcher.js";import{getDashboardRequestId as t,isSameOriginDashboardMutation as n}from"./host-policy.js";const r=`/__dashboard`,i=`${r}/api`,a=new WeakMap;function o(n){let r=e(n.plugins,{getRequestId:t});return(e,t)=>{let n=new URL(e.url);return!d(n.pathname)||!t.DEPLOY_ENV?null:c(e,t,n,t.DEPLOY_ENV,r)}}function s(e,t,n){if(!d(new URL(e.url).pathname)||!t.DEPLOY_ENV)return null;let r=n.plugins,i=a.get(r);return i||(i=o(n),a.set(r,i)),i(e,t)}async function c(e,t,a,o,s){if(!t.DASHBOARD_PASSWORD)return new Response(`Dashboard unavailable`,{headers:{"cache-control":`no-store`},status:503});let c=m(e.headers.get(`authorization`));if(!c||!await h(c,t.DASHBOARD_PASSWORD))return new Response(`Authentication required`,{headers:{"cache-control":`no-store`,"www-authenticate":`Basic realm="Coreframe dashboard", charset="UTF-8"`},status:401});if(a.pathname.startsWith(`${i}/plugins/`))return n(e.method,e.headers.get(`origin`),a.origin)?s(e,l(e,t,o)):p({error:{code:`invalid_input`}},403);if(a.pathname===i||a.pathname.startsWith(`${i}/`))return p({error:`Not found`},404);if(a.pathname===r)return a.pathname=`${r}/`,Response.redirect(a,302);if(e.method!==`GET`&&e.method!==`HEAD`)return new Response(`Method not allowed`,{headers:{"cache-control":`no-store`},status:405});if(!t.ASSETS)return new Response(`Dashboard unavailable`,{headers:{"cache-control":`no-store`},status:503});(a.pathname===`${r}/`||!a.pathname.slice(13).includes(`.`))&&(a.pathname=`${r}/index.html`);let u=await t.ASSETS.fetch(new Request(a,e)),d=new Headers(u.headers);return d.set(`cache-control`,a.pathname.endsWith(`/index.html`)?`no-store`:`public, max-age=31536000, immutable`),new Response(e.method===`HEAD`?null:u.body,{headers:d,status:u.status,statusText:u.statusText})}function l(e,t,n){let r=u(),i=t,a=r.configuration.filter(e=>e.requiredIn.includes(n)).map(e=>({description:e.description,kind:e.kind,name:e.name,status:f(i[e.name])?`configured`:`missing`})),o=[],s=r.deployUrls[n];return s?o.push({href:s,id:`application`,label:`Application`}):o.push({href:new URL(`/`,e.url).href,id:`application`,label:`Application`}),{environment:n,release:{applicationName:r.applicationName,applicationVersion:r.applicationVersion,cloudflareVersionId:t.CF_VERSION_METADATA?.id,cloudflareVersionTag:t.CF_VERSION_METADATA?.tag,cloudflareVersionTimestamp:t.CF_VERSION_METADATA?.timestamp,commit:r.commit,coreframeVersion:r.coreframeVersion,releaseName:t.POSTHOG_RELEASE},configuration:a,links:o}}function u(){return typeof __COREFRAME_DASHBOARD_BUILD__<`u`?__COREFRAME_DASHBOARD_BUILD__:{applicationName:`Coreframe application`,configuration:[],deployUrls:{}}}function d(e){return e===r||e.startsWith(`${r}/`)}function f(e){return typeof e==`string`?e.trim().length>0:e!=null}function p(e,t=200){return Response.json(e,{headers:{"cache-control":`no-store`},status:t})}function m(e){if(e?.startsWith(`Basic `))try{let t=Uint8Array.from(atob(e.slice(6)),e=>e.charCodeAt(0)),n=new TextDecoder().decode(t),r=n.indexOf(`:`);return r===-1||n.slice(0,r)!==`coreframe`?void 0:n.slice(r+1)}catch{return}}async function h(e,t){let n=new TextEncoder,[r,i]=await Promise.all([crypto.subtle.digest(`SHA-256`,n.encode(e)),crypto.subtle.digest(`SHA-256`,n.encode(t))]),a=new Uint8Array(r),o=new Uint8Array(i),s=0;for(let e=0;e<a.length;e+=1)s|=a[e]^o[e];return s===0}export{o as createWorkerHandler,s as handleDashboardRequest};
1
+ import{dashboardAccessResponse as e}from"./access.js";import{createDashboardPluginDispatcher as t}from"./api/dispatcher.js";import{getDashboardRequestId as n,isSameOriginDashboardMutation as r}from"./host-policy.js";const i=`/__dashboard`,a=`${i}/api`,o=new WeakMap;function s(e){let r=t(e.plugins,{getRequestId:n});return(e,t,n)=>{let i=new URL(e.url);return!f(i.pathname)||!t.DEPLOY_ENV?null:l(e,t,i,t.DEPLOY_ENV,r,n)}}function c(e,t,n,r){if(!f(new URL(e.url).pathname)||!t.DEPLOY_ENV)return null;let i=n.plugins,a=o.get(i);return a||(a=s(n),o.set(i,a)),a(e,t,r)}async function l(t,n,o,s,c,l){let d=e(t,l);if(d)return d;if(!r(t.method,t.headers.get(`origin`),o.origin))return m({error:{code:`invalid_input`}},403);if(o.pathname.startsWith(`${a}/plugins/`))return c(t,u(t,n,s));if(o.pathname===a||o.pathname.startsWith(`${a}/`))return m({error:`Not found`},404);if(o.pathname===i)return o.pathname=`${i}/`,Response.redirect(o,302);if(t.method!==`GET`&&t.method!==`HEAD`)return new Response(`Method not allowed`,{headers:{"cache-control":`no-store`},status:405});if(!n.ASSETS)return new Response(`Dashboard unavailable`,{headers:{"cache-control":`no-store`},status:503});(o.pathname===`${i}/`||!o.pathname.slice(13).includes(`.`))&&(o.pathname=`${i}/index.html`);let f=await n.ASSETS.fetch(new Request(o,t));if(o.pathname===`${i}/index.html`&&f.status===307){let e=f.headers.get(`location`),r=e?new URL(e,o):void 0;r?.origin===o.origin&&(r.pathname===i||r.pathname===`${i}/`)&&(await f.body?.cancel(),f=await n.ASSETS.fetch(new Request(r,t)))}let p=new Headers(f.headers);return p.set(`cache-control`,`private, no-store`),new Response(t.method===`HEAD`?null:f.body,{headers:p,status:f.status,statusText:f.statusText})}function u(e,t,n){let r=d(),i=t,a=r.configuration.filter(e=>e.requiredIn.includes(n)).map(e=>({description:e.description,kind:e.kind,name:e.name,status:p(i[e.name])?`configured`:`missing`})),o=[],s=r.deployUrls[n];return s?o.push({href:s,id:`application`,label:`Application`}):o.push({href:new URL(`/`,e.url).href,id:`application`,label:`Application`}),{environment:n,release:{applicationName:r.applicationName,applicationVersion:r.applicationVersion,cloudflareVersionId:t.CF_VERSION_METADATA?.id,cloudflareVersionTag:t.CF_VERSION_METADATA?.tag,cloudflareVersionTimestamp:t.CF_VERSION_METADATA?.timestamp,commit:r.commit,coreframeVersion:r.coreframeVersion,releaseName:t.POSTHOG_RELEASE},configuration:a,links:o}}function d(){return typeof __COREFRAME_DASHBOARD_BUILD__<`u`?__COREFRAME_DASHBOARD_BUILD__:{applicationName:`Coreframe application`,configuration:[],deployUrls:{}}}function f(e){return e===i||e.startsWith(`${i}/`)}function p(e){return typeof e==`string`?e.trim().length>0:e!=null}function m(e,t=200){return Response.json(e,{headers:{"cache-control":`no-store`},status:t})}export{s as createWorkerHandler,c as handleDashboardRequest};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreframe/dashboard",
3
- "version": "0.4.0-next.3",
3
+ "version": "0.4.0",
4
4
  "description": "Reusable dashboard composition, shell, plugin, and authenticated runtime for Coreframe apps",
5
5
  "repository": {
6
6
  "type": "git",
@@ -56,30 +56,14 @@
56
56
  "types": "./dist/package/app/index.d.ts",
57
57
  "default": "./dist/package/app/index.js"
58
58
  },
59
- "./plugins/diagnostics": {
60
- "types": "./dist/package/plugins/diagnostics/index.d.ts",
61
- "default": "./dist/package/plugins/diagnostics/index.js"
62
- },
63
- "./plugins/diagnostics/web": {
64
- "types": "./dist/package/plugins/diagnostics/web.d.ts",
65
- "default": "./dist/package/plugins/diagnostics/web.js"
66
- },
67
- "./plugins/diagnostics/api/contract": {
68
- "types": "./dist/package/plugins/diagnostics/api/contract.d.ts",
69
- "default": "./dist/package/plugins/diagnostics/api/contract.js"
70
- },
71
- "./plugins/diagnostics/api/local": {
72
- "types": "./dist/package/plugins/diagnostics/api/local.d.ts",
73
- "default": "./dist/package/plugins/diagnostics/api/local.js"
74
- },
75
- "./plugins/diagnostics/api/worker": {
76
- "types": "./dist/package/plugins/diagnostics/api/worker.d.ts",
77
- "default": "./dist/package/plugins/diagnostics/api/worker.js"
78
- },
79
- "./shell.css": "./dist/package/shell.css"
59
+ "./access": {
60
+ "types": "./dist/package/access.d.ts",
61
+ "default": "./dist/package/access.js"
62
+ }
80
63
  },
81
64
  "dependencies": {
82
65
  "@fontsource-variable/inter": "^5.2.8",
66
+ "@iconify-json/tabler": "^1.2.43",
83
67
  "@tanstack/react-query": "^5.101.2",
84
68
  "react": "19.2.8",
85
69
  "react-dom": "19.2.8",
@@ -87,29 +71,28 @@
87
71
  "rouzer": "^6.0.1",
88
72
  "yaml": "^2.9.0",
89
73
  "zod": "^4.4.3",
90
- "@coreframe/deploy": "0.1.15-next.2",
91
- "@coreframe/diagnostics": "0.2.4-next.0",
92
- "@coreframe/lib": "^0.2.16-next.2"
74
+ "@coreframe/lib": "^0.3.0"
93
75
  },
94
76
  "devDependencies": {
95
- "@pandacss/dev": "2.0.0-beta.8",
96
- "@pandacss/preset-base": "2.0.0-beta.8",
97
- "@pandacss/preset-panda": "2.0.0-beta.8",
77
+ "@pandacss/dev": "2.4.0",
78
+ "@pandacss/preset-base": "2.4.0",
79
+ "@pandacss/preset-panda": "2.4.0",
98
80
  "@types/node": "^26.1.0",
99
81
  "@types/react": "19.2.18",
100
82
  "@types/react-dom": "19.2.4",
101
83
  "jsdom": "^29.1.1",
84
+ "miniflare": "4.20260730.0",
102
85
  "tsdown": "0.22.3",
103
86
  "typescript": "6.0.3",
104
- "vite": "^8.1.4",
87
+ "vite": "^8.3.5",
105
88
  "vitest": "^4.1.10",
106
- "@coreframe/panda": "0.1.10-next.2"
89
+ "@coreframe/panda": "0.1.15"
107
90
  },
108
91
  "scripts": {
109
- "build": "pnpm --dir ../diagnostics build && pnpm build:server",
92
+ "build": "pnpm build:server",
110
93
  "codegen": "panda codegen",
111
- "build:server": "tsdown && node scripts/copy-package-assets.mjs",
112
- "test": "vitest run --reporter=minimal",
94
+ "build:server": "tsdown",
95
+ "test": "NODE_OPTIONS=--no-experimental-webstorage vitest run --reporter=minimal",
113
96
  "typecheck": "tsc --noEmit -p tsconfig.json",
114
97
  "format": "oxlint --fix && oxfmt",
115
98
  "lint": "oxlint"
@@ -1,10 +0,0 @@
1
- import { DashboardPluginApi, DashboardQuery } from "../../../api/contract.js";
2
- import { DashboardPayload } from "../../../types.js";
3
- //#region src/plugins/diagnostics/api/contract.d.ts
4
- /** The typed operation contract shared by the diagnostics page and runtime targets. */
5
- declare const diagnosticsApi: DashboardPluginApi<"diagnostics", {
6
- readonly overview: DashboardQuery<undefined, DashboardPayload>;
7
- }, {}>;
8
- type DiagnosticsApi = typeof diagnosticsApi;
9
- //#endregion
10
- export { DiagnosticsApi, diagnosticsApi as default };
@@ -1 +0,0 @@
1
- import{api as e,query as t}from"../../../api/contract.js";import{z as n}from"zod";const r=e({id:`diagnostics`,queries:{overview:t({output:n.custom()})},commands:{}});export{r as default};
@@ -1,10 +0,0 @@
1
- import { DashboardInitializationContext, DashboardPluginImplementation } from "../../../api/contract.js";
2
- import { DashboardLocalHostData } from "../../../server.js";
3
- import { DiagnosticsApi } from "./contract.js";
4
-
5
- //#region src/plugins/diagnostics/api/local.d.ts
6
- declare function createImplementation({
7
- host
8
- }: DashboardInitializationContext<DashboardLocalHostData>): DashboardPluginImplementation<DiagnosticsApi, DashboardLocalHostData>;
9
- //#endregion
10
- export { createImplementation };
@@ -1 +0,0 @@
1
- import{defineImplementation as e}from"../../../api/contract.js";import t from"./contract.js";import{inspectWorkerEnvironment as n}from"@coreframe/deploy";import{runDiagnostics as r}from"@coreframe/diagnostics";function i({host:i}){return e(t,{queries:{async overview(){let[e,t]=await Promise.all([r({projectRoot:i.projectRoot,environment:`development`,env:process.env}),n({cwd:i.projectRoot})]);return{mode:`local`,diagnostics:e,workerEnvironment:t}}},commands:{}})}export{i as createImplementation};
@@ -1,8 +0,0 @@
1
- import { DashboardInitializationContext, DashboardPluginImplementation } from "../../../api/contract.js";
2
- import { DashboardWorkerHostData } from "../../../worker.js";
3
- import { DiagnosticsApi } from "./contract.js";
4
-
5
- //#region src/plugins/diagnostics/api/worker.d.ts
6
- declare function createImplementation(_context: DashboardInitializationContext<DashboardWorkerHostData>): DashboardPluginImplementation<DiagnosticsApi, DashboardWorkerHostData>;
7
- //#endregion
8
- export { createImplementation };
@@ -1 +0,0 @@
1
- import{defineImplementation as e}from"../../../api/contract.js";import t from"./contract.js";function n(n){return e(t,{queries:{overview({host:e}){return{mode:`deployed`,environment:e.environment,release:e.release,configuration:[...e.configuration],links:[...e.links]}}},commands:{}})}export{n as createImplementation};
@@ -1,30 +0,0 @@
1
- import { DashboardPluginApi, DashboardQuery } from "../../api/contract.js";
2
- import { DashboardPayload } from "../../types.js";
3
- //#region src/plugins/diagnostics/index.d.ts
4
- declare const diagnosticsPlugin: {
5
- readonly id: "diagnostics";
6
- readonly navigation: {
7
- readonly path: "diagnostics";
8
- readonly title: "Production readiness";
9
- readonly description: "Review launch readiness, deployment configuration, and project health.";
10
- };
11
- readonly pageModule: "@coreframe/dashboard/plugins/diagnostics/web";
12
- readonly api: DashboardPluginApi<"diagnostics", {
13
- readonly overview: DashboardQuery<undefined, DashboardPayload>;
14
- }, {}>;
15
- };
16
- /** Registers Coreframe's built-in production-readiness dashboard. */
17
- declare function diagnostics(): {
18
- readonly id: "diagnostics";
19
- readonly navigation: {
20
- readonly path: "diagnostics";
21
- readonly title: "Production readiness";
22
- readonly description: "Review launch readiness, deployment configuration, and project health.";
23
- };
24
- readonly pageModule: "@coreframe/dashboard/plugins/diagnostics/web";
25
- readonly api: DashboardPluginApi<"diagnostics", {
26
- readonly overview: DashboardQuery<undefined, DashboardPayload>;
27
- }, {}>;
28
- };
29
- //#endregion
30
- export { diagnostics, diagnosticsPlugin };
@@ -1 +0,0 @@
1
- import{definePlugin as e}from"../../config.js";import t from"./api/contract.js";const n=e({id:`diagnostics`,navigation:{path:`diagnostics`,title:`Production readiness`,description:`Review launch readiness, deployment configuration, and project health.`},pageModule:`@coreframe/dashboard/plugins/diagnostics/web`,api:t},{apiModule:`@coreframe/dashboard/plugins/diagnostics/api/contract`,localImplementationModule:`@coreframe/dashboard/plugins/diagnostics/api/local`,deployedImplementationModule:`@coreframe/dashboard/plugins/diagnostics/api/worker`});function r(){return n}export{r as diagnostics,n as diagnosticsPlugin};
@@ -1 +0,0 @@
1
- import{createClient as e}from"../../../api/client.js";import t from"../api/contract.js";import{queryOptions as n}from"@tanstack/react-query";const r={overview:()=>n({queryKey:[`dashboard`,`plugins`,`diagnostics`,`overview`],queryFn:()=>e(t).queries.overview()})};export{r as diagnosticsQueries};
@@ -1,4 +0,0 @@
1
- //#region src/plugins/diagnostics/web.d.ts
2
- declare function Diagnostics(): import("react").JSX.Element;
3
- //#endregion
4
- export { Diagnostics as default };
@@ -1 +0,0 @@
1
- import{Button as e,EmptyState as t,ErrorState as n}from"../../web/ui/index.js";import{DashboardPage as r}from"../../web/dashboard/dashboard-page.js";import{DeployedDashboardPage as i}from"../../web/dashboard/deployed-dashboard-page.js";import a from"../../web/root.style.js";import{diagnosticsQueries as o}from"./web/queries.js";import{useQuery as s}from"@tanstack/react-query";import{jsx as c}from"react/jsx-runtime";function l(){let t=s(o.overview());return t.isPending?c(u,{title:`Loading dashboard`,message:`Reading the latest project diagnostics.`}):t.isError?c(u,{error:!0,title:`Dashboard unavailable`,message:t.error.message,action:c(e,{className:a.button,onClick:()=>void t.refetch(),children:`Retry`})}):t.data.mode===`deployed`?c(i,{payload:t.data,onRefresh:()=>void t.refetch()}):c(r,{payload:t.data,onRefresh:()=>void t.refetch()})}function u({title:e,message:r,action:i,error:o=!1}){return c(o?n:t,{action:i,className:a.statePage,message:r,title:e})}export{l as default};