@coreframe/dashboard 0.4.0-next.3 → 3.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -10
- package/dist/browser/api/client.js +1 -0
- package/dist/browser/api/contract.js +1 -0
- package/dist/browser/api/error-mapping.js +1 -0
- package/dist/browser/api/errors.js +1 -0
- package/dist/browser/api/paths.js +1 -0
- package/dist/browser/api/rouzer.js +1 -0
- package/dist/browser/api/validation.js +1 -0
- package/dist/{package → browser}/app-client.d.ts +4 -4
- package/dist/browser/app-client.js +1 -0
- package/dist/browser/plugins/diagnostics/api/contract.js +1 -0
- package/dist/browser/plugins/diagnostics/web/queries.js +1 -0
- package/dist/browser/plugins/diagnostics/web.d.ts +4 -0
- package/dist/browser/plugins/diagnostics/web.js +1 -0
- package/dist/browser/web/dashboard/dashboard-page.js +1 -0
- package/dist/browser/web/dashboard/dashboard-section.js +1 -0
- package/dist/browser/web/dashboard/dashboard.style.js +1 -0
- package/dist/browser/web/dashboard/deployed-dashboard-page.js +1 -0
- package/dist/browser/web/dashboard/findings.js +1 -0
- package/dist/browser/web/dashboard/worker-environment.js +1 -0
- package/dist/browser/web/root.style.js +1 -0
- package/dist/browser/web/styled-system/css/css.js +1 -0
- package/dist/browser/web/styled-system/css/cx.js +1 -0
- package/dist/browser/web/styled-system/css/merge-css.js +1 -0
- package/dist/browser/web/styled-system/helpers.js +1 -0
- package/dist/browser/web/styled-system/recipes/dashboard-button.js +1 -0
- package/dist/browser/web/styled-system/recipes/dashboard-confirm-dialog.js +1 -0
- package/dist/browser/web/styled-system/recipes/dashboard-empty-state.js +1 -0
- package/dist/browser/web/styled-system/recipes/dashboard-error-state.js +1 -0
- package/dist/browser/web/styled-system/recipes/dashboard-field.js +1 -0
- package/dist/browser/web/styled-system/recipes/dashboard-page.js +1 -0
- package/dist/browser/web/styled-system/recipes/dashboard-section.js +1 -0
- package/dist/browser/web/styled-system/recipes/dashboard-status.js +1 -0
- package/dist/browser/web/styled-system/recipes/dashboard-tabs.js +1 -0
- package/dist/{package → browser}/web/ui/index.d.ts +28 -14
- package/dist/browser/web/ui/index.js +1 -0
- package/dist/compiled/api/client.js +23 -0
- package/dist/compiled/api/contract.js +13 -0
- package/dist/compiled/api/error-mapping.js +12 -0
- package/dist/compiled/api/errors.js +18 -0
- package/dist/compiled/api/paths.js +9 -0
- package/dist/compiled/api/rouzer.js +22 -0
- package/dist/compiled/api/validation.js +22 -0
- package/dist/compiled/app/main.js +17 -0
- package/dist/compiled/app-client.js +179 -0
- package/dist/compiled/bamboo.css +2 -0
- package/dist/compiled/compiled-styles.js +1 -0
- package/dist/compiled/octane-client-build.json +8 -0
- package/dist/compiled/plugins/diagnostics/api/contract.js +10 -0
- package/dist/compiled/plugins/diagnostics/web/queries.js +12 -0
- package/dist/compiled/plugins/diagnostics/web.js +56 -0
- package/dist/compiled/web/dashboard/dashboard-page.js +356 -0
- package/dist/compiled/web/dashboard/dashboard-section.js +61 -0
- package/dist/compiled/web/dashboard/dashboard.style.js +50 -0
- package/dist/compiled/web/dashboard/deployed-dashboard-page.js +376 -0
- package/dist/compiled/web/dashboard/findings.js +393 -0
- package/dist/compiled/web/dashboard/worker-environment.js +187 -0
- package/dist/compiled/web/root.style.js +9 -0
- package/dist/compiled/web/styled-system/css/cx.js +41 -0
- package/dist/compiled/web/ui/index.js +1825 -0
- package/dist/compiled/web-shell/index.js +2 -0
- package/dist/compiled/web-shell/shell.js +335 -0
- package/dist/package/app/main.js +1 -0
- package/dist/package/build.d.ts +6 -23
- package/dist/package/build.js +3 -2
- package/dist/package/config.d.ts +2 -4
- package/dist/package/plugins/diagnostics/api/contract.d.ts +1 -1
- package/dist/package/plugins/diagnostics/api/contract.js +1 -1
- package/dist/package/shell.css +1 -0
- package/dist/package/web-shell/index.d.ts +2 -2
- package/dist/package/web-shell/index.js +1 -1
- package/dist/package/web-shell/shell.d.ts +12 -7
- package/dist/package/web-shell/shell.js +1 -1
- package/dist/package/worker.js +1 -1
- package/package.json +26 -26
- package/dist/package/app/empty.d.ts +0 -2
- package/dist/package/app/empty.js +0 -1
- package/dist/package/app/entry.client.js +0 -1
- package/dist/package/app/index-route.d.ts +0 -4
- package/dist/package/app/index-route.js +0 -1
- package/dist/package/app/index.d.ts +0 -5
- package/dist/package/app/index.js +0 -1
- package/dist/package/app/not-found.d.ts +0 -4
- package/dist/package/app/not-found.js +0 -1
- package/dist/package/app/root.d.ts +0 -12
- package/dist/package/app/root.js +0 -1
- package/dist/package/app/routes.d.ts +0 -6
- package/dist/package/app/routes.js +0 -1
- package/dist/package/app/shell.d.ts +0 -6
- package/dist/package/app/shell.js +0 -1
- package/dist/package/app-client.js +0 -1
- package/dist/package/plugins/diagnostics/web/queries.js +0 -1
- package/dist/package/plugins/diagnostics/web.d.ts +0 -4
- package/dist/package/plugins/diagnostics/web.js +0 -1
- package/dist/package/styled-css.js +0 -1
- package/dist/package/web/dashboard/dashboard-page.js +0 -1
- package/dist/package/web/dashboard/dashboard-section.js +0 -1
- package/dist/package/web/dashboard/dashboard.style.js +0 -1
- package/dist/package/web/dashboard/deployed-dashboard-page.js +0 -1
- package/dist/package/web/dashboard/findings.js +0 -1
- package/dist/package/web/dashboard/worker-environment.js +0 -1
- package/dist/package/web/root.style.js +0 -1
- package/dist/package/web/styled-system/css/conditions.js +0 -1
- package/dist/package/web/styled-system/css/css.js +0 -1
- package/dist/package/web/styled-system/css/cx.js +0 -1
- package/dist/package/web/styled-system/helpers.js +0 -1
- package/dist/package/web/styled-system/recipes/dashboard-button.js +0 -1
- package/dist/package/web/styled-system/recipes/dashboard-confirm-dialog.js +0 -1
- package/dist/package/web/styled-system/recipes/dashboard-empty-state.js +0 -1
- package/dist/package/web/styled-system/recipes/dashboard-error-state.js +0 -1
- package/dist/package/web/styled-system/recipes/dashboard-field.js +0 -1
- package/dist/package/web/styled-system/recipes/dashboard-page.js +0 -1
- package/dist/package/web/styled-system/recipes/dashboard-section.js +0 -1
- package/dist/package/web/styled-system/recipes/dashboard-status.js +0 -1
- package/dist/package/web/styled-system/recipes/dashboard-tabs.js +0 -1
- package/dist/package/web/styled-system/recipes/runtime.js +0 -1
- package/dist/package/web/ui/index.js +0 -1
- package/dist/package/web/ui/styles.js +0 -1
- /package/dist/package/app/{entry.client.d.ts → main.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Reusable composition, shell, plugin, and authenticated runtime boundaries for an app-owned
|
|
4
4
|
Coreframe dashboard.
|
|
5
5
|
|
|
6
|
-
Generated applications own a second client-only
|
|
6
|
+
Generated applications own a second client-only Octane Xplat application under `dashboard`. Coreframe
|
|
7
7
|
provides the document, client bootstrap, shell adapters, and virtual build modules; the
|
|
8
8
|
application keeps its plugin selection and pages. The normal `pnpm dev`, `pnpm typecheck`, `pnpm
|
|
9
9
|
build`, and `pnpm preview` workflows supervise, generate, and build that application. Its production
|
|
@@ -27,7 +27,7 @@ Plugins are never discovered or installed at runtime.
|
|
|
27
27
|
|
|
28
28
|
Add app-owned routes at `dashboard/pages/<slug>/route.tsx`. An optional adjacent `page.yaml` may
|
|
29
29
|
define `title` and `description`. Build-time composition validates slugs, metadata, route modules,
|
|
30
|
-
identifiers, and paths before generating the
|
|
30
|
+
identifiers, and paths before generating the Octane Xplat route catalog and navigation manifest.
|
|
31
31
|
|
|
32
32
|
The generated dashboard does not need route adapters, a document root, a query-client module, or an
|
|
33
33
|
entry file. Keep those defaults in the package unless the dashboard build contract itself must
|
|
@@ -36,15 +36,30 @@ ship an app-owned server entry.
|
|
|
36
36
|
|
|
37
37
|
Projects can opt into app-owned customization without copying the default scaffold:
|
|
38
38
|
|
|
39
|
-
- `dashboard/
|
|
40
|
-
|
|
41
|
-
- `dashboard/styles.css` is loaded after the package stylesheet, while `
|
|
39
|
+
- `dashboard/index.html` is the app-owned document; `dashboard/main.ts` mounts the
|
|
40
|
+
package-provided Octane dashboard app;
|
|
41
|
+
- `dashboard/styles.css` is loaded after the package stylesheet, while `bamboo.config.ts` remains the
|
|
42
42
|
theme and generated-style override; and
|
|
43
|
-
- `vite.config.ts`
|
|
43
|
+
- `dashboard/vite.config.ts` remains a small tool-level adapter for build changes.
|
|
44
|
+
|
|
45
|
+
## Compiled styles
|
|
46
|
+
|
|
47
|
+
The package builds browser components with Bamboo and ships their CSS through
|
|
48
|
+
`@coreframe/dashboard/shell.css`. Consumers do not need to compile package-owned
|
|
49
|
+
recipe calls. The Node runtime and its declarations stay in `dist/package`;
|
|
50
|
+
the browser declaration pass writes to `dist/browser`, and compiled UI modules live in
|
|
51
|
+
`dist/compiled`. Each build writes to its own directory so browser tree shaking
|
|
52
|
+
cannot remove server exports. The package build imports every standalone Node
|
|
53
|
+
entrypoint to verify the emitted module graph. App-owned pages still use the
|
|
54
|
+
app’s Bamboo Vite plugin.
|
|
55
|
+
|
|
56
|
+
App tokens can override shared CSS variables. Changing a package-owned recipe’s
|
|
57
|
+
structure requires rebuilding the package; an app config does not recompile
|
|
58
|
+
those distributed components.
|
|
44
59
|
|
|
45
60
|
## Runtime boundaries
|
|
46
61
|
|
|
47
|
-
The app dashboard uses the same
|
|
62
|
+
The app dashboard uses the same Octane, Octane Xplat routing, BambooCSS,
|
|
48
63
|
Sculpted, Rouzer, Zod, TanStack Query, and Worker conventions as the main Coreframe application.
|
|
49
64
|
Coreframe contributes the responsive navigation shell and default client/query runtime without
|
|
50
65
|
imposing a page-content component API.
|
|
@@ -72,9 +87,6 @@ credentials, Worker bindings, environment secrets, and the raw request remain ou
|
|
|
72
87
|
contract. Typed operation errors expose safe error codes, and a failed local initialization can be
|
|
73
88
|
retried without restarting the host.
|
|
74
89
|
|
|
75
|
-
Each plugin’s `apiModule` must default-export its operation contract. Both the local host and
|
|
76
|
-
generated Worker target load that default export.
|
|
77
|
-
|
|
78
90
|
The compact plugin API uses `api`, `query`, and `command` for the shared contract, then derives a
|
|
79
91
|
browser client from that contract:
|
|
80
92
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{throwDashboardResponseError as e}from"./error-mapping.js";import{getDefaultPluginApiURL as t}from"./paths.js";import{createRouzerRoutes as n}from"./rouzer.js";import{createClient as r}from"rouzer";function i(i,o={}){return a(i,r({baseURL:o.baseURL??t(i.id),headers:{"content-type":`application/json`},onJsonError:e,routes:n(i),fetch:o.fetch}))}function a(e,t){let n=t;return{queries:Object.fromEntries(Object.entries(e.queries).map(([e,t])=>[e,t.input===void 0?t=>n.queries[e](void 0,t):(t,r)=>n.queries[e](t,r)])),commands:Object.fromEntries(Object.entries(e.commands).map(([e,t])=>[e,t.input===void 0?t=>n.commands[e](void 0,t):(t,r)=>n.commands[e](t,r)]))}}export{i as createClient};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{assertDashboardPluginApi as e}from"./validation.js";function t(e={}){return{kind:`query`,...e}}function n(t){return e(t),t}export{n as api,t as query};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DashboardOperationError as e,isDashboardOperationErrorBody as t}from"./errors.js";async function n(n){let r=n.status===400?`invalid_input`:`internal`;if(n.headers.get(`content-type`)?.includes(`application/json`)){let e=await n.json().catch(()=>void 0),i=e&&typeof e==`object`&&`error`in e?e.error:void 0;t(i)&&(r=i.code)}throw new e(r)}export{n as throwDashboardResponseError};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={invalid_input:`The dashboard request was invalid.`,not_found:`The requested dashboard resource was not found.`,conflict:`The dashboard operation could not be completed.`,unavailable:`The dashboard operation is temporarily unavailable.`,internal:`The dashboard operation failed.`};var t=class extends Error{code;constructor(t){super(e[t]),this.name=`DashboardOperationError`,this.code=t}};function n(t){return typeof t==`object`&&!!t&&`code`in t&&typeof t.code==`string`&&t.code in e}export{t as DashboardOperationError,n as isDashboardOperationErrorBody};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=`/__dashboard/api/plugins`;function t(t){let n=globalThis.location===void 0?void 0:globalThis.location.origin;if(!n)throw Error(`A dashboard API baseURL is required outside a browser.`);return new URL(`${e}/${t}/`,n).href}export{e as dashboardPluginApiPath,t as getDefaultPluginApiURL};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$type as e}from"rouzer";import*as t from"rouzer/http";function n(e){let n=Object.fromEntries(Object.entries(e.queries).map(([e,t])=>[e,r(`query`,e,t)])),i=Object.fromEntries(Object.entries(e.commands).map(([e,t])=>[e,r(`command`,e,t)]));return{queries:t.resource(`queries`,n),commands:t.resource(`commands`,i)}}function r(n,r,i){let a=i.input?n===`query`?{query:i.input,response:e()}:{body:i.input,response:e()}:{response:e()};return n===`query`?t.get(r,a):t.post(r,a)}export{n as createRouzerRoutes};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,t=/^[A-Za-z0-9][A-Za-z0-9_-]*$/u;function n(e){if(!e||typeof e!=`object`)throw Error(`Dashboard plugin API is missing.`);let t=e;a(t.id??``),r(t.queries,`queries`,`query`),r(t.commands,`commands`,`command`)}function r(e,t,n){if(!e||typeof e!=`object`)throw Error(`Dashboard plugin API is missing ${t}.`);for(let[r,a]of Object.entries(e)){if(!a||typeof a!=`object`||a.kind!==n)throw Error(`Dashboard ${t} operation "${r}" has the wrong kind.`);i(r)}}function i(e){if(!t.test(e))throw Error(`Dashboard operation name "${e}" must start with a letter or number and contain only letters, numbers, underscores, and hyphens.`)}function a(t){if(!e.test(t))throw Error(`Dashboard plugin id "${t}" must contain only lowercase letters, numbers, and single hyphens.`)}export{n as assertDashboardPluginApi};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AuthSessionHintStore } from "@coreframe/lib/auth-transport";
|
|
2
|
-
import {
|
|
2
|
+
import { OctaneNode } from "octane";
|
|
3
3
|
import { RouzerClient } from "rouzer";
|
|
4
4
|
import { HttpRouteTree } from "rouzer/http";
|
|
5
5
|
|
|
@@ -54,14 +54,14 @@ type DashboardAppClientResult<Routes extends HttpRouteTree> = Readonly<{
|
|
|
54
54
|
declare function createDashboardAppClient<const Routes extends HttpRouteTree>(routes: Routes, options?: DashboardAppClientOptions): DashboardAppClientResult<Routes>;
|
|
55
55
|
/** The props accepted by {@link DashboardAppSessionBoundary}. */
|
|
56
56
|
type DashboardAppSessionBoundaryProps = Readonly<{
|
|
57
|
-
children:
|
|
57
|
+
children: OctaneNode;
|
|
58
58
|
pending?: DashboardAppSessionFallback;
|
|
59
59
|
session: DashboardAppSession;
|
|
60
60
|
unauthenticated?: DashboardAppSessionFallback;
|
|
61
61
|
unknown?: DashboardAppSessionFallback;
|
|
62
62
|
}>;
|
|
63
63
|
/** A caller-owned fallback rendered for one of the non-content session states. */
|
|
64
|
-
type DashboardAppSessionFallback =
|
|
64
|
+
type DashboardAppSessionFallback = OctaneNode | ((session: DashboardAppSession) => OctaneNode);
|
|
65
65
|
/** Reads a dashboard session with React's external-store subscription contract. */
|
|
66
66
|
declare function useDashboardAppSession(session: DashboardAppSession): DashboardAppSessionSnapshot;
|
|
67
67
|
/**
|
|
@@ -76,7 +76,7 @@ declare function DashboardAppSessionBoundary({
|
|
|
76
76
|
session,
|
|
77
77
|
unauthenticated,
|
|
78
78
|
unknown
|
|
79
|
-
}: DashboardAppSessionBoundaryProps):
|
|
79
|
+
}: DashboardAppSessionBoundaryProps): any;
|
|
80
80
|
/** A typed HTTP failure that preserves the app response status. */
|
|
81
81
|
declare class DashboardAppResponseError extends Error {
|
|
82
82
|
readonly status: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createAuthSessionHintStore as e}from"@coreframe/lib/auth-transport";import{createBrowserAuthSessionHintPersistence as t,createBrowserAuthenticatedFetch as n}from"@coreframe/lib/auth-transport/browser";import{useSyncExternalStore as r}from"octane";import{createClient as i}from"rouzer";function a(e,t={}){let r=p(),a=m(t.fetch??((e,t)=>globalThis.fetch(e,t)),r),o=t.sessionHint??f(),s=n({appOrigin:r,fetch:a,refreshAccess:()=>a(new URL(`/api/auth/token`,r),{credentials:`include`,method:`POST`}),sessionHint:o});return{client:i({baseURL:new URL(`/api/`,r).href,fetch:s.fetch,headers:{"content-type":`application/json`},onJsonError:h,routes:e}),session:l(s,o)}}function o(e){return r(e.subscribe,e.get,e.get)}function s({children:e,pending:t,session:n,unauthenticated:r,unknown:i}){switch(o(n).status){case`authenticated`:return e;case`checking`:return g(t,n);case`unauthenticated`:return g(r,n);case`unknown`:return g(i,n)}}var c=class extends Error{status;constructor(e){super(`Request failed with status ${e}.`),this.name=`DashboardAppResponseError`,this.status=e}};function l(e,t){let n=u(t.get()),r,i,a=!1;function o(){return n}function s(e,t){let r=d(e,t);r.status===n.status&&r.expiresAt===n.expiresAt||(n=r,l())}let c=new Set;function l(){for(let e of c)e()}function f(e){return c.add(e),()=>c.delete(e)}function p(){i!==void 0&&(clearTimeout(i),i=void 0)}function m(e){p(),i=setTimeout(()=>{i=void 0,t.get(),h()},Math.max(0,e-Date.now()))}function h(){if(a)return;let e=t.get();if(e.status===`authenticated`){s(`authenticated`,e.validUntil),m(e.validUntil);return}if(e.status===`unauthenticated`){s(`unauthenticated`,null),m(e.validUntil);return}p(),s(`checking`,null),g()}function g(){if(a)return Promise.resolve(n);if(t.get().status!==`unknown`)return h(),Promise.resolve(n);if(s(`checking`,null),r)return r;let i=e.refreshAccessToken().then(r=>{if(a)return n;let i=t.get();return i.status===`authenticated`||i.status===`unauthenticated`?h():r?s(`unknown`,null):(e.setUnauthenticated(),h()),n}).catch(()=>{if(!a){let e=t.get();e.status===`authenticated`||e.status===`unauthenticated`?h():s(`unknown`,null)}return n});return r=i,i.then(()=>{r===i&&(r=void 0)}),i}function _(){return a?Promise.resolve(n):(t.invalidate(),g())}let v=t.subscribe(h),y=()=>t.syncFromPersistence(),b=()=>{n.status===`unknown`&&g()};return globalThis.window!==void 0&&(globalThis.addEventListener(`storage`,y),globalThis.addEventListener(`online`,b)),h(),{get expiresAt(){return n.expiresAt},get isPending(){return n.isPending},get status(){return n.status},dispose(){a||(a=!0,p(),v(),globalThis.window!==void 0&&(globalThis.removeEventListener(`storage`,y),globalThis.removeEventListener(`online`,b)))},get:o,refresh:_,subscribe:f}}function u(e){return e.status===`authenticated`?d(`authenticated`,e.validUntil):e.status===`unauthenticated`?d(`unauthenticated`,null):d(`checking`,null)}function d(e,t){return Object.freeze({expiresAt:t,isPending:e!==`authenticated`&&e!==`unauthenticated`,status:e})}function f(){let n=!1;if(globalThis.window!==void 0)try{n=t({key:`coreframe.auth-session-observation.v1`,storage:globalThis.localStorage})}catch{n=!1}return e({persistence:n,unauthenticatedTtlMs:3e5})}function p(){let e=globalThis.location?.origin;if(!e)throw Error(`createDashboardAppClient() requires a browser location.`);let t;try{t=new URL(e)}catch{throw TypeError(`createDashboardAppClient() requires an HTTP(S) browser origin.`)}if(t.protocol!==`http:`&&t.protocol!==`https:`)throw TypeError(`createDashboardAppClient() requires an HTTP(S) browser origin.`);return t.origin}function m(e,t){return(n,r)=>{if(new URL(n instanceof Request?n.url:n.toString(),t).origin!==t)throw TypeError(`Dashboard app client only allows same-origin requests.`);return e(n,{...r,credentials:`include`})}}async function h(e){throw new c(e.status)}function g(e,t){return typeof e==`function`?e(t):e??null}export{c as DashboardAppResponseError,s as DashboardAppSessionBoundary,a as createDashboardAppClient,o as useDashboardAppSession};
|
|
@@ -0,0 +1 @@
|
|
|
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,r as diagnosticsApi};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createClient as e}from"../../../api/client.js";import t from"../api/contract.js";import{defineQuery as n}from"@octane-xplat/ui/data";const r=n([`dashboard`,`plugins`,`diagnostics`,`overview`],(n,{signal:r})=>e(t).queries.overview({signal:r}));export{r as diagnosticsOverview};
|
|
@@ -0,0 +1 @@
|
|
|
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{diagnosticsOverview as o}from"./web/queries.js";import{useEffect as s,useState as c}from"octane";import{createQueryClient as l,useQuery$ as u}from"@octane-xplat/ui/data";import{jsx as d}from"octane/jsx-runtime";function f(){let[t]=c(l);s(()=>()=>void t.dispose(),[t]);let n=u(t,o,!0),f=n?.state$.get();if(!n||!f||f.status===`pending`)return d(p,{title:`Loading dashboard`,message:`Reading the latest project diagnostics.`});let m=()=>{n.refetch().catch(()=>{})};if(f.status===`error`){let t=f.error;return d(p,{error:!0,title:`Dashboard unavailable`,message:t instanceof Error?t.message:`The diagnostics request failed.`,action:d(e,{className:a.button,onClick:m,children:`Retry`})})}let h=n.data$.get();return h.mode===`deployed`?d(i,{payload:h,onRefresh:m}):d(r,{payload:h,onRefresh:m})}function p({title:e,message:r,action:i,error:o=!1}){return d(o?n:t,{action:i,className:a.statePage,message:r,title:e})}export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./dashboard.style.js";import{FindingSection as t,LinksSection as n}from"./findings.js";import{WorkerEnvironment as r}from"./worker-environment.js";import{useState as i}from"octane";import{jsx as a,jsxs as o}from"octane/jsx-runtime";const s={ready:`No outstanding findings`,needs_setup:`Launch decisions needed`,broken_locally:`Diagnostics blocked`,not_deploy_ready:`Launch work remaining`,unknown:`Readiness incomplete`};function c({payload:c,onRefresh:p}){let[m,h]=i(),[g,_]=i(),v=c.diagnostics,y=v.snapshot.facts.package?.name??`Unnamed project`,b=d(v);async function x(e,t){try{if(!navigator.clipboard)throw Error(`Clipboard access is unavailable`);await navigator.clipboard.writeText(t),h(e),_(void 0)}catch{_(e)}}return o(`main`,{className:e.page,children:[o(`header`,{className:e.topbar,children:[o(`div`,{className:e.brand,children:[a(`span`,{className:e.brandMark,"aria-hidden":`true`,children:`C`}),o(`div`,{children:[a(`p`,{className:e.eyebrow,children:`Coreframe Dashboard`}),a(`h1`,{className:e.title,children:y})]})]}),o(`div`,{className:e.topbarActions,children:[a(`span`,{className:u(v.dashboard.headline.status),children:s[v.dashboard.headline.status]}),a(`button`,{className:e.button,onClick:p,children:`Refresh`})]})]}),o(`section`,{className:e.summary,"aria-labelledby":`summary-title`,children:[o(`div`,{children:[a(`p`,{className:e.eyebrow,children:`Production readiness`}),a(`h2`,{className:e.summaryTitle,id:`summary-title`,children:v.dashboard.headline.message}),o(`p`,{className:e.muted,children:[`Diagnostics updated `,f(v.snapshot.collectedAt),`.`]})]}),o(`dl`,{className:e.summaryFacts,children:[a(l,{label:`First-release scope`,value:b.scope}),a(l,{label:`Product identity`,value:b.identity}),a(l,{label:`Legal and privacy`,value:b.legal})]})]}),o(`div`,{className:e.grid,children:[a(r,{status:c.workerEnvironment}),a(t,{title:`Path to production`,description:`Decisions and human-owned work that remain before the first production release.`,findings:v.dashboard.launchItems,emptyTitle:`No outstanding launch items`,emptyMessage:`Diagnostics found no unresolved production-readiness work.`,copiedAction:m,copyError:g,onCopy:x}),v.dashboard.problems.length?a(t,{title:`Problems`,description:`Local or runtime problems that need investigation.`,findings:v.dashboard.problems,emptyTitle:`No problems`,emptyMessage:`No problems were returned.`,copiedAction:m,copyError:g,onCopy:x}):null,v.dashboard.links.length?a(n,{links:v.dashboard.links}):null]})]})}function l({label:t,value:n}){return o(`div`,{className:e.summaryFact,children:[a(`dt`,{children:t}),a(`dd`,{children:n})]})}function u(t){return t===`ready`?`${e.status} ${e.success}`:t===`broken_locally`?`${e.status} ${e.danger}`:t===`unknown`?`${e.status} ${e.neutral}`:`${e.status} ${e.warning}`}function d(e){let t=e.snapshot.facts.launchReadiness;if(!t)return{scope:`Unknown`,identity:`Unknown`,legal:`Unknown`};let n=t.defaultIdentity.length+ +(e.snapshot.facts.package?.name===`coreframe`),r=t.defaultLegalDocuments.length+ +!t.privacyReviewRecorded;return{scope:t.productionChecklistExists?`Recorded`:`Undecided`,identity:n===0?`Personalized`:n===1?`1 default remains`:`${n} defaults remain`,legal:r===0?`Reviewed`:`${r} item${r===1?``:`s`} pending`}}function f(e){let t=new Date(e);return Number.isNaN(t.valueOf())?`just now`:new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}).format(t)}export{c as DashboardPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./dashboard.style.js";import{EmptyState as t}from"../ui/index.js";import{jsx as n,jsxs as r}from"octane/jsx-runtime";function i({title:t,description:i}){return r(`header`,{className:e.sectionHeader,children:[n(`h2`,{id:`${t}-title`,children:t}),n(`p`,{children:i})]})}function a({title:r,message:i}){return n(t,{className:e.empty,title:r,message:i})}export{a as EmptyState,i as SectionHeader};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{css as e}from"../styled-system/css/css.js";var t={page:e({width:`min(76rem, calc(100vw - 2rem))`,margin:`0 auto`,padding:{base:`1.25rem 0 3rem`,md:`2rem 0 4rem`}}),topbar:e({display:`flex`,alignItems:{base:`flex-start`,md:`center`},justifyContent:`space-between`,flexDirection:{base:`column`,md:`row`},gap:`1.25rem`,padding:`0 0.25rem 1.5rem`}),brand:e({display:`flex`,alignItems:`center`,gap:`0.875rem`}),brandMark:e({display:`grid`,width:`2.625rem`,height:`2.625rem`,placeItems:`center`,borderRadius:`0.75rem`,background:`gray.900`,color:`white`,fontSize:`1rem`,fontWeight:`750`,boxShadow:`0 5px 14px rgb(32 33 38 / 0.16)`}),topbarActions:e({display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:`0.625rem`}),eyebrow:e({margin:`0 0 0.2rem`,color:`gray.600`,fontSize:`0.65rem`,fontWeight:`700`,letterSpacing:`0.1em`,textTransform:`uppercase`}),title:e({margin:`0`,fontSize:`clamp(1.5rem, 4vw, 1.875rem)`,fontWeight:`700`,letterSpacing:`-0.035em`,lineHeight:`1.05`}),button:e({border:`1px solid token(colors.gray.300)`,borderRadius:`0.625rem`,background:`white`,color:`gray.900`,padding:`0.5625rem 0.75rem`,fontWeight:`600`,boxShadow:`0 1px 2px rgb(32 33 38 / 0.05)`,transition:`border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease`,"&:hover":{borderColor:`gray.500`,boxShadow:`0 3px 8px rgb(32 33 38 / 0.08)`,transform:`translateY(-1px)`},"&:focus-visible":{outline:`3px solid rgb(91 91 214 / 0.22)`,outlineOffset:`2px`},"&:disabled":{opacity:`0.55`}}),primaryButton:e({border:`1px solid token(colors.indigo.600)`,borderRadius:`0.625rem`,background:`indigo.600`,color:`white`,padding:`0.5625rem 0.75rem`,fontWeight:`600`,boxShadow:`0 4px 10px rgb(91 91 214 / 0.2)`,transition:`filter 150ms ease, transform 150ms ease`,"&:hover:not(:disabled)":{filter:`brightness(0.94)`,transform:`translateY(-1px)`},"&:focus-visible":{outline:`3px solid rgb(91 91 214 / 0.22)`,outlineOffset:`2px`},"&:disabled":{borderColor:`gray.300`,background:`gray.100`,color:`gray.500`,boxShadow:`none`,opacity:`1`}}),smallButton:e({border:`1px solid token(colors.gray.300)`,borderRadius:`0.5rem`,background:`white`,color:`gray.900`,padding:`0.4rem 0.625rem`,fontSize:`0.75rem`,fontWeight:`600`,transition:`border-color 150ms ease, background 150ms ease`,"&:hover":{borderColor:`indigo.600`,background:`gray.100`}}),status:e({display:`inline-flex`,alignItems:`center`,borderRadius:`999px`,gap:`0.4rem`,padding:`0.5rem 0.7rem`,fontSize:`0.75rem`,fontWeight:`650`,lineHeight:`1`,whiteSpace:`nowrap`,"&::before":{width:`0.4rem`,height:`0.4rem`,borderRadius:`50%`,background:`currentColor`,content:`''`}}),success:e({background:`green.50`,color:`green.700`}),warning:e({background:`yellow.50`,color:`yellow.700`}),danger:e({background:`red.50`,color:`red.700`}),neutral:e({background:`gray.100`,color:`gray.600`}),summary:e({position:`relative`,display:`grid`,gridTemplateColumns:{base:`1fr`,md:`minmax(0, 1.05fr) minmax(21rem, 0.95fr)`},alignItems:`center`,gap:{base:`1.5rem`,md:`2.5rem`},overflow:`hidden`,border:`1px solid token(colors.gray.200)`,borderRadius:`1rem`,background:`linear-gradient(135deg, #ffffff 20%, #f8f7ff 100%)`,padding:{base:`1.25rem`,md:`1.75rem 2rem`},boxShadow:`0 12px 35px rgb(32 33 38 / 0.055)`,"&::after":{position:`absolute`,top:`-5rem`,right:`-3rem`,width:`11rem`,height:`11rem`,borderRadius:`50%`,background:`rgb(91 91 214 / 0.06)`,content:`''`,pointerEvents:`none`}}),summaryTitle:e({margin:`0`,fontSize:`clamp(1.4rem, 3vw, 1.8rem)`,fontWeight:`680`,letterSpacing:`-0.025em`,lineHeight:`1.2`}),muted:e({maxWidth:`47.5rem`,margin:`0.5rem 0 0`,color:`gray.600`,fontSize:`0.875rem`,lineHeight:`1.55`}),summaryFacts:e({position:`relative`,zIndex:`1`,display:`grid`,gridTemplateColumns:{base:`1fr`,sm:`repeat(3, minmax(0, 1fr))`},gap:`0.625rem`,margin:`0`}),summaryFact:e({minWidth:`0`,border:`1px solid rgb(229 228 223 / 0.9)`,borderRadius:`0.75rem`,background:`rgb(255 255 255 / 0.8)`,padding:`0.875rem`,boxShadow:`0 2px 10px rgb(32 33 38 / 0.035)`,"& dt":{color:`gray.500`,fontSize:`0.625rem`,fontWeight:`700`,letterSpacing:`0.035em`,textTransform:`uppercase`},"& dd":{margin:`0.35rem 0 0`,fontSize:`0.925rem`,fontWeight:`650`,lineHeight:`1.3`}}),grid:e({display:`grid`,gridTemplateColumns:{base:`1fr`,md:`repeat(2, minmax(0, 1fr))`},gap:`1rem`,paddingTop:`1rem`}),section:e({minWidth:`0`,gridColumn:{base:`auto`,md:`1 / -1`},border:`1px solid token(colors.gray.200)`,borderRadius:`1rem`,background:`white`,padding:{base:`1.125rem`,md:`1.375rem 1.5rem`},boxShadow:`0 5px 18px rgb(32 33 38 / 0.035)`}),sectionHeader:e({marginBottom:`1rem`,"& h2":{margin:`0`,fontSize:`1.05rem`,fontWeight:`680`,letterSpacing:`-0.015em`},"& p":{margin:`0.3rem 0 0`,color:`gray.600`,fontSize:`0.8125rem`,lineHeight:`1.45`}}),environmentNotice:e({margin:`0.75rem 0`,borderRadius:`0.625rem`,background:`yellow.50`,color:`yellow.700`,padding:`0.625rem 0.75rem`,fontSize:`0.75rem`,lineHeight:`1.45`}),environmentTableFrame:e({overflowX:`auto`}),environmentTable:e({width:`100%`,borderCollapse:`collapse`,textAlign:`left`,"& th, & td":{borderTop:`1px solid token(colors.gray.200)`,padding:`0.75rem`,verticalAlign:`top`,fontSize:`0.75rem`},"& thead th":{borderTop:`0`,color:`gray.500`,fontSize:`0.65rem`,fontWeight:`700`,letterSpacing:`0.04em`,textTransform:`uppercase`},"& tbody th":{minWidth:`16rem`,fontWeight:`600`},"& code":{fontSize:`0.75rem`},"& tbody th span":{display:`block`,maxWidth:`28rem`,marginTop:`0.25rem`,color:`gray.600`,fontWeight:`400`,lineHeight:`1.4`}}),environmentState:e({display:`inline-flex`,borderRadius:`999px`,background:`gray.100`,color:`gray.600`,padding:`0.3125rem 0.5rem`,fontSize:`0.6875rem`,fontWeight:`650`,lineHeight:`1`,whiteSpace:`nowrap`}),environmentStateOk:e({background:`green.50`,color:`green.700`}),environmentStateMissing:e({background:`red.50`,color:`red.700`}),environmentStatePending:e({background:`yellow.50`,color:`yellow.800`}),list:e({listStyle:`none`,margin:`0`,padding:`0`}),empty:e({borderTop:`1px solid token(colors.gray.200)`,paddingTop:`0.875rem`,"& strong":{fontSize:`0.8125rem`},"& p":{margin:`0.25rem 0 0`,color:`gray.600`,fontSize:`0.8125rem`}}),error:e({margin:`0.75rem 0 0`,color:`red.700`,fontSize:`0.8125rem`}),findingRow:e({borderTop:`1px solid token(colors.gray.200)`,padding:`1.125rem 0`,"&:first-child":{borderTop:`0`,paddingTop:`0.125rem`},"&:last-child":{paddingBottom:`0.125rem`}}),findingTitle:e({display:`flex`,alignItems:`center`,flexWrap:`wrap`,gap:`0.5rem`,"& h3":{margin:`0`,fontSize:`0.9rem`,fontWeight:`650`}}),findingArea:e({color:`gray.500`,fontSize:`0.6875rem`,fontWeight:`700`,letterSpacing:`0.04em`,textTransform:`uppercase`,whiteSpace:`nowrap`}),findingStatus:e({display:`inline-flex`,marginLeft:`auto`,borderRadius:`999px`,padding:`0.3125rem 0.5rem`,fontSize:`0.75rem`,fontWeight:`650`,lineHeight:`1`,whiteSpace:`nowrap`}),dot:e({width:`0.4375rem`,height:`0.4375rem`,flex:`0 0 auto`,borderRadius:`50%`}),successDot:e({background:`green.700`}),warningDot:e({background:`yellow.700`}),dangerDot:e({background:`red.700`}),evidence:e({display:`flex`,flexWrap:`wrap`,gap:`0.375rem 1.125rem`,margin:`0.625rem 0 0 0.9375rem`,"& > div":{display:`flex`,alignItems:`baseline`,gap:`0.3125rem`},"& dt":{color:`gray.500`,fontSize:`0.6875rem`,fontWeight:`700`,textTransform:`uppercase`},"& dd":{margin:`0`,fontSize:`0.75rem`,fontWeight:`600`}}),actions:e({display:`grid`,gap:`0.5rem`,margin:`0.75rem 0 0 0.9375rem`,"& a":{width:`fit-content`,color:`indigo.600`,fontSize:`0.8125rem`,fontWeight:`600`}}),action:e({display:`flex`,alignItems:`center`,flexWrap:`wrap`,gap:`0.5rem`,"& > span:first-child":{fontSize:`0.8125rem`,fontWeight:`600`}}),linkRow:e({borderTop:`1px solid token(colors.gray.200)`,"&:first-child":{borderTop:`0`},"& a":{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:`1rem`,padding:`0.6875rem 0`,color:`indigo.600`,fontWeight:`600`,textDecoration:`none`,"&:hover":{textDecoration:`underline`}}})};export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./dashboard.style.js";import{SectionHeader as t}from"./dashboard-section.js";import{jsx as n,jsxs as r}from"octane/jsx-runtime";function i({payload:i,onRefresh:o}){let s=i.configuration.filter(e=>e.status===`missing`);return r(`main`,{className:e.page,children:[r(`header`,{className:e.topbar,children:[r(`div`,{className:e.brand,children:[n(`span`,{className:e.brandMark,"aria-hidden":`true`,children:`C`}),r(`div`,{children:[n(`p`,{className:e.eyebrow,children:`Coreframe Dashboard`}),n(`h1`,{className:e.title,children:i.release.applicationName})]})]}),r(`div`,{className:e.topbarActions,children:[n(`span`,{className:`${e.status} ${s.length?e.warning:e.success}`,children:s.length?`${s.length} missing`:`Configuration ready`}),n(`button`,{className:e.button,onClick:o,children:`Refresh`})]})]}),r(`section`,{className:e.summary,"aria-labelledby":`deployment-title`,children:[r(`div`,{children:[n(`p`,{className:e.eyebrow,children:`Deployed Worker`}),r(`h2`,{className:e.summaryTitle,id:`deployment-title`,children:[i.environment===`production`?`Production`:`Staging`,` deployment`]}),n(`p`,{className:e.muted,children:`Read-only release identity and required Worker configuration.`})]}),r(`dl`,{className:e.summaryFacts,children:[n(a,{label:`Application`,value:i.release.applicationVersion??`Unknown`}),n(a,{label:`Coreframe`,value:i.release.coreframeVersion??`Unknown`}),n(a,{label:`Release`,value:i.release.releaseName??i.release.cloudflareVersionTag??`Unknown`})]})]}),r(`div`,{className:e.grid,children:[r(`section`,{className:e.section,"aria-labelledby":`configuration-title`,children:[n(t,{title:`Worker configuration`,description:`Required values are checked by presence only. Secret and variable values are never returned.`}),n(`div`,{className:e.environmentTableFrame,children:r(`table`,{className:e.environmentTable,children:[n(`thead`,{children:r(`tr`,{children:[n(`th`,{scope:`col`,children:`Name`}),n(`th`,{scope:`col`,children:`Kind`}),n(`th`,{scope:`col`,children:`Status`})]})}),n(`tbody`,{children:i.configuration.map(t=>r(`tr`,{children:[r(`th`,{scope:`row`,children:[n(`code`,{children:t.name}),n(`span`,{children:t.description})]}),n(`td`,{children:t.kind}),n(`td`,{children:n(`span`,{className:`${e.environmentState} ${t.status===`configured`?e.environmentStateOk:e.environmentStateMissing}`,children:t.status===`configured`?`Configured`:`Missing`})})]},t.name))})]})})]}),i.links.length?r(`section`,{className:e.section,"aria-labelledby":`links-title`,children:[n(t,{title:`Helpful links`,description:`Configured deployment resources.`}),n(`ul`,{className:e.list,children:i.links.map(t=>n(`li`,{className:e.linkRow,children:r(`a`,{href:t.href,rel:`noreferrer`,target:`_blank`,children:[n(`span`,{children:t.label}),n(`span`,{"aria-hidden":`true`,children:`→`})]})},t.id))})]}):null]})]})}function a({label:t,value:i}){return r(`div`,{className:e.summaryFact,children:[n(`dt`,{children:t}),n(`dd`,{children:i})]})}export{i as DeployedDashboardPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./dashboard.style.js";import{EmptyState as t,SectionHeader as n}from"./dashboard-section.js";import{jsx as r,jsxs as i}from"octane/jsx-runtime";function a({title:a,description:s,findings:c,emptyTitle:l,emptyMessage:u,copiedAction:d,copyError:f,onCopy:p}){return i(`section`,{className:e.section,"aria-labelledby":`${a}-title`,children:[r(n,{title:a,description:s}),c.length===0?r(t,{title:l,message:u}):r(`ul`,{className:e.list,children:c.map(e=>r(o,{finding:e,copiedAction:d,copyError:f,onCopy:p},e.id))})]})}function o({finding:t,copiedAction:n,copyError:a,onCopy:o}){return i(`li`,{className:e.findingRow,children:[i(`div`,{className:e.findingTitle,children:[r(`span`,{className:u(t.status),"aria-hidden":`true`}),r(`span`,{className:e.findingArea,children:p(t.area)}),r(`h3`,{children:t.title}),r(`span`,{className:d(t.status),children:f(t.status)})]}),r(`p`,{className:e.muted,children:t.summary}),r(s,{evidence:t.evidence}),r(c,{actions:t.actions,actionPrefix:t.id,copiedAction:n,copyError:a,onCopy:o})]})}function s({evidence:t}){return t?.length?r(`dl`,{className:e.evidence,children:t.map(e=>i(`div`,{children:[r(`dt`,{children:e.label}),r(`dd`,{children:String(e.value)})]},e.label))}):null}function c({actions:t,actionPrefix:n,copiedAction:a,copyError:o,onCopy:s}){return t.length?r(`div`,{className:e.actions,children:t.map((t,c)=>{let l=`${n}-${c}`;if(t.kind===`link`)return r(`a`,{href:t.href,rel:`noreferrer`,target:`_blank`,children:t.label},l);let u=t.kind===`agent_prompt`?t.prompt:t.command;return i(`div`,{className:e.action,children:[r(`span`,{children:t.label}),r(`button`,{className:e.smallButton,onClick:()=>void s(l,u),children:a===l?`Copied`:t.kind===`agent_prompt`?`Copy task for agent`:`Copy command`}),o===l?r(`span`,{className:e.error,children:`Copy unavailable`}):null]},l)})}):null}function l({links:t}){return i(`section`,{className:e.section,"aria-labelledby":`links-title`,children:[r(n,{title:`Helpful links`,description:`Configured tools for deeper project detail.`}),r(`ul`,{className:e.list,children:t.map(t=>r(`li`,{className:e.linkRow,children:i(`a`,{href:t.href,rel:`noreferrer`,target:`_blank`,children:[r(`span`,{children:t.label}),r(`span`,{"aria-hidden":`true`,children:`→`})]})},t.id))})]})}function u(t){return`${e.dot} ${t===`ok`?e.successDot:t===`blocked`?e.dangerDot:e.warningDot}`}function d(t){return`${e.findingStatus} ${t===`ok`?e.success:t===`blocked`?e.danger:t===`needs_action`?e.warning:e.neutral}`}function f(e){return{ok:`Complete`,needs_action:`Needs action`,blocked:`Blocked`,unknown:`Unknown`}[e]}function p(e){switch(e){case`launch`:return`Release scope`;case`product`:return`Product identity`;case`legal`:return`Legal and privacy`;case`local_dev`:return`Local development`;default:return`${e[0].toUpperCase()}${e.slice(1)}`}}export{a as FindingSection,l as LinksSection};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./dashboard.style.js";import{jsx as t,jsxs as n}from"octane/jsx-runtime";const r={configured:`Configured`,declared:`Declared`,generated:`Automatic`,missing:`Missing`,not_configured:`Not configured`,pending_addition:`Pending addition`,pending_replacement:`Pending replacement`,pending_update:`Pending update`,unknown:`Unknown`};function i({status:r}){if(r.entries.length===0)return null;let i=Object.values(r.providers).flatMap(e=>e.message?[e.message]:[]),o=Object.entries(r.undeclaredSecrets).flatMap(([e,t])=>t.map(t=>`${t} (${e})`));return n(`section`,{className:e.section,"aria-labelledby":`worker-environment-title`,children:[n(`header`,{className:e.sectionHeader,children:[t(`h2`,{id:`worker-environment-title`,children:`Worker environment`}),t(`p`,{children:`Local values are optional overrides of built-in defaults. Secret changes are queued until the next deploy; ordinary variables remain owned by project and deploy configuration.`})]}),i.map(n=>t(`p`,{className:e.environmentNotice,children:n},n)),t(`div`,{className:e.environmentTableFrame,children:n(`table`,{className:e.environmentTable,children:[t(`thead`,{children:n(`tr`,{children:[t(`th`,{scope:`col`,children:`Name`}),t(`th`,{scope:`col`,children:`Kind`}),t(`th`,{scope:`col`,children:`Local`}),t(`th`,{scope:`col`,children:`Staging`}),t(`th`,{scope:`col`,children:`Production`})]})}),t(`tbody`,{children:r.entries.map(e=>n(`tr`,{children:[n(`th`,{scope:`row`,children:[t(`code`,{children:e.name}),t(`span`,{children:e.description})]}),t(`td`,{children:e.kind}),t(`td`,{children:e.local===`override`?`Override`:`Built-in default`}),t(a,{state:e.deployed.staging}),t(a,{state:e.deployed.production})]},e.name))})]})}),o.length>0?n(`p`,{className:e.environmentNotice,children:[`Cloudflare also contains undeclared secrets: `,o.join(`, `),`.`]}):null]})}function a({state:e}){return t(`td`,{children:t(`span`,{className:o(e),children:r[e]})})}function o(t){return t===`configured`||t===`generated`?`${e.environmentState} ${e.environmentStateOk}`:t===`missing`?`${e.environmentState} ${e.environmentStateMissing}`:t.startsWith(`pending_`)?`${e.environmentState} ${e.environmentStatePending}`:e.environmentState}export{i as WorkerEnvironment};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{css as e}from"./styled-system/css/css.js";var t={statePage:e({display:`flex`,width:`min(70rem, calc(100vw - 2.5rem))`,minHeight:`100svh`,flexDirection:`column`,alignItems:`flex-start`,justifyContent:`center`,margin:`0 auto`}),eyebrow:e({margin:`0 0 0.3125rem`,color:`gray.600`,fontSize:`0.6875rem`,fontWeight:`700`,letterSpacing:`0.08em`,textTransform:`uppercase`}),message:e({color:`gray.600`}),button:e({marginTop:`1rem`,borderRadius:`0.375rem`,background:`indigo.600`,color:`white`,padding:`0.5rem 0.75rem`,fontWeight:`600`,textDecoration:`none`})};export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cloneStyles as e,uncompiledStyle as t}from"../helpers.js";import{mergeCss as n}from"./merge-css.js";const r=(...e)=>t(`css`);r.raw=(...t)=>e(n(...t));export{r as css};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../helpers.js";function e(t,n){let r=arguments.length;if(r===2&&typeof t==`string`){if(typeof n==`string`)return t?n?t+` `+n:t:n;if(n==null||n===!1||n===!0)return t}let i=``;for(let t=0;t<r;t++){let n=arguments[t];if(!n)continue;let r=Array.isArray(n)?e(...n):typeof n==`string`?n:``;r&&(i&&(i+=` `),i+=r)}return i}export{e as cx};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createMergeCss as e}from"../helpers.js";const t=new Map;`textShadowColor:textShadowColor,position:pos,insetInline:insetX,insetBlock:insetY,insetInlineEnd:insetEnd/end,insetInlineStart:insetStart/start,flexDirection:flexDir,padding:p,paddingLeft:pl,paddingRight:pr,paddingTop:pt,paddingBottom:pb,paddingBlock:py/paddingY,paddingInline:paddingX/px,paddingInlineEnd:pe/paddingEnd,paddingInlineStart:ps/paddingStart,marginLeft:ml,marginRight:mr,marginTop:mt,marginBottom:mb,margin:m,marginBlock:my/marginY,marginInline:mx/marginX,marginInlineEnd:me/marginEnd,marginInlineStart:ms/marginStart,outlineWidth:ringWidth,outlineColor:ringColor,outline:ring,outlineOffset:ringOffset,width:w,minWidth:minW,maxWidth:maxW,height:h,minHeight:minH,maxHeight:maxH,textShadowColor:textShadowColor,backgroundPosition:bgPosition,backgroundPositionX:bgPositionX,backgroundPositionY:bgPositionY,backgroundAttachment:bgAttachment,backgroundClip:bgClip,background:bg,backgroundColor:bgColor,backgroundOrigin:bgOrigin,backgroundImage:bgImage,backgroundRepeat:bgRepeat,backgroundBlendMode:bgBlendMode,backgroundSize:bgSize,backgroundGradient:bgGradient,backgroundLinear:bgLinear,backgroundRadial:bgRadial,backgroundConic:bgConic,borderRadius:rounded,borderTopLeftRadius:roundedTopLeft,borderTopRightRadius:roundedTopRight,borderBottomRightRadius:roundedBottomRight,borderBottomLeftRadius:roundedBottomLeft,borderTopRadius:roundedTop,borderRightRadius:roundedRight,borderBottomRadius:roundedBottom,borderLeftRadius:roundedLeft,borderStartStartRadius:roundedStartStart,borderStartEndRadius:roundedStartEnd,borderStartRadius:roundedStart,borderEndStartRadius:roundedEndStart,borderEndEndRadius:roundedEndEnd,borderEndRadius:roundedEnd,borderInline:borderX,borderInlineWidth:borderXWidth,borderInlineColor:borderXColor,borderBlock:borderY,borderBlockWidth:borderYWidth,borderBlockColor:borderYColor,borderInlineStart:borderStart,borderInlineStartWidth:borderStartWidth,borderInlineStartColor:borderStartColor,borderInlineEnd:borderEnd,borderInlineEndWidth:borderEndWidth,borderInlineEndColor:borderEndColor,boxShadow:shadow,boxShadowColor:shadowColor,translateX:x,translateY:y,translateZ:z,scrollMarginBlock:scrollMarginY,scrollMarginInline:scrollMarginX,scrollPaddingBlock:scrollPaddingY,scrollPaddingInline:scrollPaddingX`.split(`,`).forEach(e=>{let[n,r]=e.split(`:`);r.split(`/`).forEach(e=>t.set(e,n))});const n=e=>t.get(e)||e,{mergeCss:r,mergeCssUncached:i}=e({utility:{hasShorthand:!0,resolveShorthand:n}});export{r as mergeCss,n as resolveShorthand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const t=e=>typeof e==`object`&&!!e;var n=class extends Error{code;hint;constructor(e,t,n){super(t,{cause:n?.cause}),this.code=`ERR_BAMBOO_${e}`,this.hint=n?.hint}};const r=1e3,i=e=>{let t=5381;for(let n=0;n<e.length;n++){let r=e[n];if(typeof r!=`object`||!r){let e=typeof r;if(e===`string`)for(let e=0;e<r.length;e++)t=t*33^r.charCodeAt(e);else t=e===`number`?t*33^(r|0):e===`boolean`?t*33^(r?991:997):t*33^3;continue}if(Array.isArray(r))return null;let i=Object.getPrototypeOf(r);if(i!==Object.prototype&&i!==null)return null;for(let e in r){let n=r[e],i=typeof n;if(n!==null&&i===`object`)return null;for(let n=0;n<e.length;n++)t=t*33^e.charCodeAt(n);if(i===`string`)for(let e=0;e<n.length;e++)t=t*33^n.charCodeAt(e);else t=i===`number`?t*33^(n|0):i===`boolean`?t*33^(n?991:997):t*33^2}}return t>>>0},a=e=>{let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r];if(typeof i==`object`&&i){let e=Array.isArray(i)?[]:{},r=0;for(let t in i)e[t]=i[t],r++;t.push(e),n.push(r)}else t.push(i),n.push(0)}return{values:t,counts:n}},o=(e,t,n)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],a=t[r];if(i===a)continue;if(i===null||a===null||typeof i!=`object`||typeof a!=`object`||Array.isArray(i)!==Array.isArray(a))return!1;let o=0;for(let e in i){if(i[e]!==a[e])return!1;o++}if(o!==n[r])return!1}return!0},s=e=>{let t=new Map,n=new Map,s=new Map,c=new Map,l=new Map,u=new Map,d=(e,t)=>{if(e)for(let n=0;n<e.length;n++){let r=e[n];if(o(t,r.values,r.counts))return r}};return(...o)=>{if(o.length===1){let t=o[0];if(typeof t!=`object`||!t){if(l.has(t))return l.get(t);if(u.has(t)){let e=u.get(t);return l.set(t,e),e}let n=e(t);return l.set(t,n),l.size>r&&(u=l,l=new Map),n}}let f=i(o);if(f!==null){let i=t.get(f),s=d(i,o);if(s)return s.out;let c=d(n.get(f),o);if(c)return i||(i=[],t.set(f,i)),i.push(c),i.length>8&&i.shift(),c.out;let l=a(o),u=e(...o);return i||(i=[],t.set(f,i)),i.push({values:l.values,counts:l.counts,out:u}),i.length>8&&i.shift(),t.size>r&&(n=t,t=new Map),u}let p=JSON.stringify(o);if(s.has(p))return s.get(p);if(c.has(p)){let e=c.get(p);return s.set(p,e),e}let m=e(...o);return s.set(p,m),s.size>r&&(c=s,s=new Map),m}},c=new Set([`__proto__`,`constructor`,`prototype`]);function l(...t){return t.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{if(c.has(r))return;let i=t[r],a=n[r];e(i)&&e(a)?t[r]=l(i,a):t[r]=a}),t),{})}const u=e=>e!=null;function d(e,n,r={}){let{stop:i,getKey:a}=r;function o(e,r=[]){if(t(e)){let t={};for(let[s,c]of Object.entries(e)){let l=a?.(s,c)??s,d=[...r,l];if(i?.(e,d))return n(e,r);let f=o(c,d);u(f)&&(t[l]=f)}return t}return n(e,r)}return o(e)}function f(e,t){if(Array.isArray(e))return!1;for(let n in e){let r=e[n];if(r==null||typeof r==`object`||t!==void 0&&t(n)!==n)return!1}return!0}function p(e,t,r=!0){let{utility:i}=t,{hasShorthand:a,resolveShorthand:o}=i;return f(e,r&&a?o:void 0)?e:d(e,(e,t)=>{if(Array.isArray(e))throw new n(`INVALID_STYLE_VALUE`,`An array is not a style value${t.length?`: "${t.join(`.`)}"`:``}.`,{hint:`Write a responsive value as a condition object, e.g. { base: "medium", lg: "bold" }.`});return e},{stop:e=>Array.isArray(e),getKey:r?e=>a?o(e):e:void 0})}function m(e){let t=Object.keys(e);for(let n=0;n<t.length;n++)if(e[t[n]]!==void 0)return!0;return!1}function h(...t){return t.filter(t=>{if(Array.isArray(t))throw new n(`INVALID_STYLE_ARGUMENT`,`An array is not a style argument.`,{hint:`Spread it instead, e.g. css(...styles) rather than css(styles).`});return e(t)&&m(t)})}function g(e){function t(t){let n=h(...t);return n.length===1?n:n.map(t=>p(t,e))}function n(...e){return l(...t(e))}return{mergeCss:s(n),mergeCssUncached:n}}const _=new Set([`__proto__`,`constructor`,`prototype`]);function v(t){if(Array.isArray(t))return t.map(e=>v(e));if(!e(t))return t;let n={};for(let e of Object.keys(t))_.has(e)||(n[e]=v(t[e]));return n}RegExp(`^(${[`min`,`max`,`clamp`,`calc`].join(`|`)})\\(.*\\)`);const y=`(?:${`cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%`.split(`,`).join(`|`)})`;RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${y}$`);const b=(e,t,n)=>{let r=Object.getOwnPropertyDescriptor(e,n);return r?(`get`in r||`set`in r||!r.enumerable||n===`__proto__`?Object.defineProperty(t,n,r):t[n]=r.value,!0):!1},x=(e,t,n)=>{let r=new Set(t),i=new Set,a={};for(let t=0;t<n.length;t++){let o=n[t];i.has(o)||!r.has(o)||b(e,a,o)&&i.add(o)}let o={};for(let n=0;n<t.length;n++){let r=t[n];i.has(r)||b(e,o,r)}return[a,o]};function S(e,...t){let n=Object.getOwnPropertyNames(e);if(t.length===1&&Array.isArray(t[0]))return x(e,n,t[0]);let r=new Set(n),i=new Set,a=t=>{let n={};for(let a=0;a<t.length;a++){let o=t[a];i.has(o)||!r.has(o)||b(e,n,o)&&i.add(o)}return n},o=e=>{let t=[];for(let r=0;r<n.length;r++){let i=n[r];e(i)&&t.push(i)}return t};return t.map(e=>a(Array.isArray(e)?e:o(e))).concat(a(n))}function C(e){throw Error(`bamboocss: `+e+"() was not compiled. Add `bamboocss()` from `@bamboocss/vite` and import `virtual:bamboo.css`. See https://bamboocss.com/docs/installation/vite")}export{v as cloneStyles,g as createMergeCss,S as splitProps,C as uncompiledStyle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{splitProps as e,uncompiledStyle as t}from"../helpers.js";const n=[`variant`,`tone`,`size`],r=Object.assign(e=>t(`dashboard-button`),{splitVariantProps(t){return e(t,n)}});export{r as dashboardButton};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{splitProps as e,uncompiledStyle as t}from"../helpers.js";const n=[],r=Object.assign(e=>t(`dashboard-confirm-dialog`),{splitVariantProps(t){return e(t,n)}});export{r as dashboardConfirmDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{splitProps as e,uncompiledStyle as t}from"../helpers.js";const n=[],r=Object.assign(e=>t(`dashboard-empty-state`),{splitVariantProps(t){return e(t,n)}});export{r as dashboardEmptyState};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{splitProps as e,uncompiledStyle as t}from"../helpers.js";const n=[],r=Object.assign(e=>t(`dashboard-error-state`),{splitVariantProps(t){return e(t,n)}});export{r as dashboardErrorState};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{splitProps as e,uncompiledStyle as t}from"../helpers.js";const n=[],r=Object.assign(e=>t(`dashboard-field`),{splitVariantProps(t){return e(t,n)}});export{r as dashboardField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{splitProps as e,uncompiledStyle as t}from"../helpers.js";const n=[],r=Object.assign(e=>t(`dashboard-page`),{splitVariantProps(t){return e(t,n)}});export{r as dashboardPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{splitProps as e,uncompiledStyle as t}from"../helpers.js";const n=[],r=Object.assign(e=>t(`dashboard-section`),{splitVariantProps(t){return e(t,n)}});export{r as dashboardSection};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{splitProps as e,uncompiledStyle as t}from"../helpers.js";const n=[`tone`],r=Object.assign(e=>t(`dashboard-status`),{splitVariantProps(t){return e(t,n)}});export{r as dashboardStatus};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{splitProps as e,uncompiledStyle as t}from"../helpers.js";const n=[],r=Object.assign(e=>t(`dashboard-tabs`),{splitVariantProps(t){return e(t,n)}});export{r as dashboardTabs};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes, ReactElement, ReactNode } from "
|
|
1
|
+
import { AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes, ReactElement, ReactNode, Ref } from "octane";
|
|
2
2
|
|
|
3
3
|
//#region src/web/ui/index.d.ts
|
|
4
4
|
interface PageProps extends HTMLAttributes<HTMLDivElement> {}
|
|
@@ -6,7 +6,7 @@ interface PageProps extends HTMLAttributes<HTMLDivElement> {}
|
|
|
6
6
|
declare function Page({
|
|
7
7
|
className,
|
|
8
8
|
...props
|
|
9
|
-
}: PageProps): import("
|
|
9
|
+
}: PageProps): import("octane/jsx-runtime").JSX.Element;
|
|
10
10
|
interface SectionProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
11
11
|
title?: ReactNode;
|
|
12
12
|
description?: ReactNode;
|
|
@@ -21,7 +21,7 @@ declare function Section({
|
|
|
21
21
|
headingId,
|
|
22
22
|
title,
|
|
23
23
|
...props
|
|
24
|
-
}: SectionProps): import("
|
|
24
|
+
}: SectionProps): import("octane/jsx-runtime").JSX.Element;
|
|
25
25
|
interface TabsProps extends HTMLAttributes<HTMLDivElement> {
|
|
26
26
|
value: string;
|
|
27
27
|
onValueChange: (value: string) => void;
|
|
@@ -36,12 +36,12 @@ declare function TabsRoot({
|
|
|
36
36
|
orientation,
|
|
37
37
|
value,
|
|
38
38
|
...props
|
|
39
|
-
}: TabsProps): import("
|
|
39
|
+
}: TabsProps): import("octane/jsx-runtime").JSX.Element;
|
|
40
40
|
interface TabsListProps extends HTMLAttributes<HTMLDivElement> {}
|
|
41
41
|
declare function TabsList({
|
|
42
42
|
className,
|
|
43
43
|
...props
|
|
44
|
-
}: TabsListProps): import("
|
|
44
|
+
}: TabsListProps): import("octane/jsx-runtime").JSX.Element;
|
|
45
45
|
interface TabsTriggerProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value"> {
|
|
46
46
|
value: string;
|
|
47
47
|
}
|
|
@@ -53,7 +53,7 @@ declare function TabsTrigger({
|
|
|
53
53
|
onKeyDown,
|
|
54
54
|
value,
|
|
55
55
|
...props
|
|
56
|
-
}: TabsTriggerProps): import("
|
|
56
|
+
}: TabsTriggerProps): import("octane/jsx-runtime").JSX.Element;
|
|
57
57
|
interface TabsPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
58
58
|
value: string;
|
|
59
59
|
forceMount?: boolean;
|
|
@@ -64,7 +64,7 @@ declare function TabsPanel({
|
|
|
64
64
|
forceMount,
|
|
65
65
|
value,
|
|
66
66
|
...props
|
|
67
|
-
}: TabsPanelProps): import("
|
|
67
|
+
}: TabsPanelProps): import("octane/jsx-runtime").JSX.Element | null;
|
|
68
68
|
declare const Tabs: typeof TabsRoot & {
|
|
69
69
|
List: typeof TabsList;
|
|
70
70
|
Panel: typeof TabsPanel;
|
|
@@ -79,7 +79,7 @@ declare function Status({
|
|
|
79
79
|
role,
|
|
80
80
|
tone,
|
|
81
81
|
...props
|
|
82
|
-
}: StatusProps): import("
|
|
82
|
+
}: StatusProps): import("octane/jsx-runtime").JSX.Element;
|
|
83
83
|
type ButtonVariant = "solid" | "outline" | "quiet";
|
|
84
84
|
type ButtonTone = "neutral" | "accent" | "danger";
|
|
85
85
|
type ButtonSize = "sm" | "md" | "lg";
|
|
@@ -97,8 +97,22 @@ type ButtonProps = ButtonOptions & ((Omit<ButtonHTMLAttributes<HTMLButtonElement
|
|
|
97
97
|
href?: undefined;
|
|
98
98
|
}) | (Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof ButtonOptions> & {
|
|
99
99
|
href: string;
|
|
100
|
-
}))
|
|
101
|
-
|
|
100
|
+
})) & {
|
|
101
|
+
ref?: Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
102
|
+
};
|
|
103
|
+
declare function Button({
|
|
104
|
+
busy,
|
|
105
|
+
busyLabel,
|
|
106
|
+
children,
|
|
107
|
+
className,
|
|
108
|
+
disabled,
|
|
109
|
+
href,
|
|
110
|
+
ref,
|
|
111
|
+
size,
|
|
112
|
+
tone,
|
|
113
|
+
variant,
|
|
114
|
+
...rest
|
|
115
|
+
}: ButtonProps): import("octane/jsx-runtime").JSX.Element;
|
|
102
116
|
interface FieldProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
103
117
|
children: ReactElement;
|
|
104
118
|
description?: ReactNode;
|
|
@@ -116,15 +130,15 @@ declare function Field({
|
|
|
116
130
|
label,
|
|
117
131
|
required,
|
|
118
132
|
...props
|
|
119
|
-
}: FieldProps): import("
|
|
133
|
+
}: FieldProps): import("octane/jsx-runtime").JSX.Element;
|
|
120
134
|
interface StateProps extends Omit<HTMLAttributes<HTMLElement>, "children" | "title"> {
|
|
121
135
|
action?: ReactNode;
|
|
122
136
|
children?: ReactNode;
|
|
123
137
|
message?: ReactNode;
|
|
124
138
|
title: ReactNode;
|
|
125
139
|
}
|
|
126
|
-
declare function EmptyState(props: StateProps): import("
|
|
127
|
-
declare function ErrorState(props: StateProps): import("
|
|
140
|
+
declare function EmptyState(props: StateProps): import("octane/jsx-runtime").JSX.Element;
|
|
141
|
+
declare function ErrorState(props: StateProps): import("octane/jsx-runtime").JSX.Element;
|
|
128
142
|
interface ConfirmDialogProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "title"> {
|
|
129
143
|
busy?: boolean;
|
|
130
144
|
cancelLabel?: ReactNode;
|
|
@@ -152,6 +166,6 @@ declare function ConfirmDialog({
|
|
|
152
166
|
open,
|
|
153
167
|
title,
|
|
154
168
|
...props
|
|
155
|
-
}: ConfirmDialogProps): import("
|
|
169
|
+
}: ConfirmDialogProps): import("octane/jsx-runtime").JSX.Element | null;
|
|
156
170
|
//#endregion
|
|
157
171
|
export { Button, ButtonProps, ButtonSize, ButtonTone, ButtonVariant, ConfirmDialog, ConfirmDialogProps, EmptyState, ErrorState, Field, FieldProps, Page, PageProps, Section, SectionProps, StateProps, Status, StatusProps, StatusTone, Tabs, TabsListProps, TabsPanelProps, TabsProps, TabsTriggerProps };
|
|
@@ -0,0 +1 @@
|
|
|
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";import{cloneElement as u,createContext as d,useCallback as f,useContext as p,useEffect as m,useId as h,useMemo as g,useRef as _}from"octane";import{jsx as v,jsxs as y}from"octane/jsx-runtime";function b({className:t,...n}){return v(`div`,{...n,className:e(o(),t),"data-dashboard-page":`true`})}function x({actions:t,children:n,className:r,description:i,headingId:a,title:o,...c}){let l=h(),u=s(),d=o!=null||i!=null||t!=null,f=a??`dashboard-section-${I(l)}`;return y(`section`,{...c,className:e(u.root,r),"aria-labelledby":o==null?c[`aria-labelledby`]:f,children:[d?y(`header`,{className:u.header,children:[y(`div`,{children:[o==null?null:v(`h2`,{className:u.heading,id:f,children:o}),i==null?null:v(`p`,{className:u.description,children:i})]}),t==null?null:v(`div`,{className:u.actions,children:t})]}):null,v(`div`,{className:u.content,children:n})]})}const S=d(null);function C({children:t,className:n,id:r,onValueChange:i,orientation:a=`horizontal`,value:o,...s}){let c=h(),u=I(r??`dashboard-tabs-${c}`),d=_(new Map),p=f(e=>{e!==o&&i(e)},[i,o]),m=f((e,t)=>{t?d.current.set(e,t):d.current.delete(e)},[]),y=g(()=>({baseId:u,orientation:a,registerTrigger:m,select:p,triggerRefs:d,value:o}),[u,a,m,p,o]),b=l();return v(S,{value:y,children:v(`div`,{...s,className:e(b.root,n),"data-dashboard-tabs":`true`,"data-orientation":a,id:r??u,children:t})})}function w({className:t,...n}){let r=F(),i=l();return v(`div`,{...n,className:e(i.list,t),role:`tablist`,"aria-orientation":r.orientation})}function T({children:t,className:n,disabled:r=!1,onClick:i,onKeyDown:a,value:o,...s}){let c=F(),u=_(null),d=l(),f=`${c.baseId}-tab-${I(o)}`,p=`${c.baseId}-panel-${I(o)}`,h=c.value===o;m(()=>(c.registerTrigger(f,u.current),()=>c.registerTrigger(f,null)),[c,f]);function g(e){let t=e.key,n=c.orientation===`horizontal`,r=n&&t===`ArrowRight`||!n&&t===`ArrowDown`?1:n&&t===`ArrowLeft`||!n&&t===`ArrowUp`?-1:0,i=Array.from(c.triggerRefs.current.values()).filter(e=>!e.disabled);if(t!==`Home`&&t!==`End`&&r===0||i.length===0)return;let a=i.indexOf(e.currentTarget),o=i[t===`Home`?0:t===`End`?i.length-1:(a+r+i.length)%i.length];if(!o)return;e.preventDefault(),o.focus();let s=o.dataset.dashboardTabValue;s&&c.select(s)}return v(`button`,{...s,ref:u,className:e(d.trigger,n),type:`button`,role:`tab`,id:f,"aria-controls":p,"aria-selected":h,"data-dashboard-tab-value":o,disabled:r,tabIndex:h?0:-1,onClick:e=>{i?.(e),!e.defaultPrevented&&!r&&c.select(o)},onKeyDown:e=>{a?.(e),e.defaultPrevented||g(e)},children:t})}function E({children:t,className:n,forceMount:r=!1,value:i,...a}){let o=F(),s=l(),c=`${o.baseId}-panel-${I(i)}`,u=`${o.baseId}-tab-${I(i)}`,d=o.value===i;return!d&&!r?null:v(`div`,{...a,className:e(s.panel,n),id:c,role:`tabpanel`,"aria-labelledby":u,hidden:!d,tabIndex:0,children:t})}const D=Object.assign(C,{List:w,Panel:E,Trigger:T});function O({className:t,role:n=`status`,tone:r=`neutral`,...i}){return v(`span`,{...i,className:e(c({tone:r}),t),role:n})}function k({busy:n=!1,busyLabel:r=`Loading`,children:i,className:a,disabled:o=!1,href:s,ref:c,size:l=`md`,tone:u=`accent`,variant:d=`solid`,...f}){let p=f[`aria-label`],m=e(t({size:l,tone:u,variant:d}),a);if(s!==void 0){let{onClick:e,...t}=f;return v(`a`,{...t,ref:c,href:s,className:m,"aria-label":n?r:p,"aria-busy":n||void 0,"aria-disabled":o||n||void 0,tabIndex:o||n?-1:t.tabIndex,onClick:t=>{if(o||n){t.preventDefault();return}e?.(t)},children:i})}let{onClick:h,type:g=`button`,..._}=f;return v(`button`,{..._,ref:c,className:m,type:g,disabled:o||n,"aria-label":n?r:p,"aria-busy":n||void 0,onClick:e=>h?.(e),children:i})}function A({children:t,className:n,description:r,error:i,id:o,label:s,required:c=!1,...l}){let d=h(),f=a(),p=t.props,m=o??p.id??`dashboard-field-${I(d)}`,g=r==null?void 0:`${m}-description`,_=i==null?void 0:`${m}-error`,b=i!=null&&i!==!1,x=[p[`aria-describedby`],g,_].filter(Boolean).join(` `),S=u(t,{id:m,required:c||p.required,"aria-describedby":x||void 0,"aria-invalid":b||p[`aria-invalid`]||void 0,"aria-required":c||p[`aria-required`]||void 0});return y(`div`,{...l,className:e(f.root,n),"data-invalid":b?`true`:void 0,children:[y(`label`,{className:f.label,htmlFor:m,children:[s,c?v(`span`,{"aria-hidden":`true`,children:` *`}):null]}),S,r==null?null:v(`p`,{className:f.description,id:g,children:r}),b?v(`p`,{className:f.error,id:_,role:`alert`,children:i}):null]})}function j({action:t,children:n,className:a,message:o,title:s,variant:c,...l}){let u=h(),d=c===`empty`?r():i(),f=`dashboard-${c}-${I(u)}`;return y(`section`,{...l,className:e(d.root,a),"aria-labelledby":l[`aria-labelledby`]??f,role:c===`error`?`alert`:void 0,children:[v(`h2`,{className:d.title,id:f,children:s}),o==null?null:v(`p`,{className:d.message,children:o}),n,t==null?null:v(`div`,{className:d.action,children:t})]})}function M(e){return v(j,{...e,variant:`empty`})}function N(e){return v(j,{...e,variant:`error`})}function P({busy:t=!1,cancelLabel:r=`Cancel`,children:i,className:a,confirmLabel:o=`Confirm`,confirmTone:s=`danger`,description:c,onConfirm:l,onMouseDown:u,onOpenChange:d,open:f,title:p,...g}){let b=h(),x=n(),S=_(null),C=_(null),w=_(null),T=_(null),E=`dashboard-confirm-title-${I(b)}`,D=c==null?void 0:`dashboard-confirm-description-${I(b)}`;return m(()=>{if(!f){T.current?.focus(),T.current=null;return}T.current||=document.activeElement instanceof HTMLElement?document.activeElement:null,t?S.current?.focus():C.current?.focus()},[t,f]),m(()=>{if(!f)return;function e(e){if(e.key===`Escape`){if(t)return;e.preventDefault(),d(!1);return}if(e.key!==`Tab`)return;let n=S.current?Array.from(S.current.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)):[];if(n.length===0)return;let r=n[0],i=n[n.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),i?.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r?.focus())}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t,d,f]),f?v(`div`,{...g,className:e(x.backdrop,a),"data-dashboard-confirm-dialog":`true`,onMouseDown:e=>{u?.(e),!e.defaultPrevented&&e.target===e.currentTarget&&!t&&d(!1)},children:y(`div`,{ref:S,className:x.content,role:`dialog`,"aria-modal":`true`,"aria-busy":t||void 0,"aria-labelledby":E,"aria-describedby":D,tabIndex:-1,children:[v(`h2`,{className:x.title,id:E,children:p}),c==null?null:v(`p`,{className:x.description,id:D,children:c}),i,y(`div`,{className:x.actions,children:[v(k,{ref:C,className:x.cancel,variant:`outline`,disabled:t,onClick:()=>d(!1),children:r}),v(k,{ref:w,className:x.confirm,busy:t,tone:s,onClick:()=>void l(),children:o})]})]})}):null}function F(){let e=p(S);if(!e)throw Error(`Dashboard Tabs compound components must be used inside <Tabs>`);return e}function I(e){return e.replace(/[^a-zA-Z0-9_-]/gu,`-`)}export{k as Button,P as ConfirmDialog,M as EmptyState,N as ErrorState,A as Field,b as Page,x as Section,O as Status,D as Tabs};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { throwDashboardResponseError as e } from "./error-mapping.js";
|
|
2
|
+
import { getDefaultPluginApiURL as t } from "./paths.js";
|
|
3
|
+
import { createRouzerRoutes as n } from "./rouzer.js";
|
|
4
|
+
import { createClient as r } from "rouzer";
|
|
5
|
+
//#region src/api/client.ts
|
|
6
|
+
function i(i, o = {}) {
|
|
7
|
+
return a(i, r({
|
|
8
|
+
baseURL: o.baseURL ?? t(i.id),
|
|
9
|
+
headers: { "content-type": "application/json" },
|
|
10
|
+
onJsonError: e,
|
|
11
|
+
routes: n(i),
|
|
12
|
+
fetch: o.fetch
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
function a(e, t) {
|
|
16
|
+
let n = t;
|
|
17
|
+
return {
|
|
18
|
+
queries: Object.fromEntries(Object.entries(e.queries).map(([e, t]) => [e, t.input === void 0 ? (t) => n.queries[e](void 0, t) : (t, r) => n.queries[e](t, r)])),
|
|
19
|
+
commands: Object.fromEntries(Object.entries(e.commands).map(([e, t]) => [e, t.input === void 0 ? (t) => n.commands[e](void 0, t) : (t, r) => n.commands[e](t, r)]))
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { i as createClient };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { assertDashboardPluginApi as e } from "./validation.js";
|
|
2
|
+
//#region src/api/contract.ts
|
|
3
|
+
function t(e = {}) {
|
|
4
|
+
return {
|
|
5
|
+
kind: "query",
|
|
6
|
+
...e
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function n(t) {
|
|
10
|
+
return e(t), t;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { n as api, t as query };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DashboardOperationError as e, isDashboardOperationErrorBody as t } from "./errors.js";
|
|
2
|
+
//#region src/api/error-mapping.ts
|
|
3
|
+
async function n(n) {
|
|
4
|
+
let r = n.status === 400 ? "invalid_input" : "internal";
|
|
5
|
+
if (n.headers.get("content-type")?.includes("application/json")) {
|
|
6
|
+
let e = await n.json().catch(() => void 0), i = e && typeof e == "object" && "error" in e ? e.error : void 0;
|
|
7
|
+
t(i) && (r = i.code);
|
|
8
|
+
}
|
|
9
|
+
throw new e(r);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as throwDashboardResponseError };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/api/errors.ts
|
|
2
|
+
var e = {
|
|
3
|
+
invalid_input: "The dashboard request was invalid.",
|
|
4
|
+
not_found: "The requested dashboard resource was not found.",
|
|
5
|
+
conflict: "The dashboard operation could not be completed.",
|
|
6
|
+
unavailable: "The dashboard operation is temporarily unavailable.",
|
|
7
|
+
internal: "The dashboard operation failed."
|
|
8
|
+
}, t = class extends Error {
|
|
9
|
+
code;
|
|
10
|
+
constructor(t) {
|
|
11
|
+
super(e[t]), this.name = "DashboardOperationError", this.code = t;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
function n(t) {
|
|
15
|
+
return typeof t == "object" && !!t && "code" in t && typeof t.code == "string" && t.code in e;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { t as DashboardOperationError, n as isDashboardOperationErrorBody };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/api/paths.ts
|
|
2
|
+
var e = "/__dashboard/api/plugins";
|
|
3
|
+
function t(t) {
|
|
4
|
+
let n = globalThis.location === void 0 ? void 0 : globalThis.location.origin;
|
|
5
|
+
if (!n) throw Error("A dashboard API baseURL is required outside a browser.");
|
|
6
|
+
return new URL(`${e}/${t}/`, n).href;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { e as dashboardPluginApiPath, t as getDefaultPluginApiURL };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { $type as e } from "rouzer";
|
|
2
|
+
import * as t from "rouzer/http";
|
|
3
|
+
//#region src/api/rouzer.ts
|
|
4
|
+
function n(e) {
|
|
5
|
+
let n = Object.fromEntries(Object.entries(e.queries).map(([e, t]) => [e, r("query", e, t)])), i = Object.fromEntries(Object.entries(e.commands).map(([e, t]) => [e, r("command", e, t)]));
|
|
6
|
+
return {
|
|
7
|
+
queries: t.resource("queries", n),
|
|
8
|
+
commands: t.resource("commands", i)
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function r(n, r, i) {
|
|
12
|
+
let a = i.input ? n === "query" ? {
|
|
13
|
+
query: i.input,
|
|
14
|
+
response: e()
|
|
15
|
+
} : {
|
|
16
|
+
body: i.input,
|
|
17
|
+
response: e()
|
|
18
|
+
} : { response: e() };
|
|
19
|
+
return n === "query" ? t.get(r, a) : t.post(r, a);
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { n as createRouzerRoutes };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/api/validation.ts
|
|
2
|
+
var e = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u, t = /^[A-Za-z0-9][A-Za-z0-9_-]*$/u;
|
|
3
|
+
function n(e) {
|
|
4
|
+
if (!e || typeof e != "object") throw Error("Dashboard plugin API is missing.");
|
|
5
|
+
let t = e;
|
|
6
|
+
a(t.id ?? ""), r(t.queries, "queries", "query"), r(t.commands, "commands", "command");
|
|
7
|
+
}
|
|
8
|
+
function r(e, t, n) {
|
|
9
|
+
if (!e || typeof e != "object") throw Error(`Dashboard plugin API is missing ${t}.`);
|
|
10
|
+
for (let [r, a] of Object.entries(e)) {
|
|
11
|
+
if (!a || typeof a != "object" || a.kind !== n) throw Error(`Dashboard ${t} operation "${r}" has the wrong kind.`);
|
|
12
|
+
i(r);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function i(e) {
|
|
16
|
+
if (!t.test(e)) throw Error(`Dashboard operation name "${e}" must start with a letter or number and contain only letters, numbers, underscores, and hyphens.`);
|
|
17
|
+
}
|
|
18
|
+
function a(t) {
|
|
19
|
+
if (!e.test(t)) throw Error(`Dashboard plugin id "${t}" must contain only lowercase letters, numbers, and single hyphens.`);
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { n as assertDashboardPluginApi };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DashboardNotFound as e, DashboardShell as t } from "../web-shell/shell.js";
|
|
2
|
+
import "../web-shell/index.js";
|
|
3
|
+
import { createScopedElement as n, createScopedValue as r } from "octane";
|
|
4
|
+
import { __createRootDefaultOptions as i, createElementFromConfig as a, enableHostDescriptors as o } from "octane/internal/client";
|
|
5
|
+
import { RouteOutlet as s } from "@octane-xplat/ui";
|
|
6
|
+
import { RouterProvider as c, configureRouter as l, router as u } from "@octane-xplat/ui/routing";
|
|
7
|
+
import { dashboardManifest as d } from "virtual:coreframe-internal/dashboard/manifest";
|
|
8
|
+
import { dashboardRoutes as f } from "virtual:coreframe-internal/dashboard/routes";
|
|
9
|
+
import "virtual:coreframe-internal/dashboard/styles";
|
|
10
|
+
o(), l({
|
|
11
|
+
catalog: f,
|
|
12
|
+
base: "/__dashboard"
|
|
13
|
+
});
|
|
14
|
+
var p = document.getElementById("root");
|
|
15
|
+
if (!p) throw Error("Dashboard root element is missing.");
|
|
16
|
+
i(p).render(r(() => n(c, { router: u }, () => r(() => n(t, { pages: d }, () => n(s, {}, () => a("c:0d10af73", e, {}), "c:82cd02d2"), "c:291cb29f")), "c:c5de160a")));
|
|
17
|
+
//#endregion
|