@ekanos/harness 0.4.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/internal/components/dashboard-grid.d.ts +4 -3
- package/dist/internal/components/dashboard-grid.js +11 -1
- package/dist/internal/routes/activation-page.js +5 -5
- package/dist/internal/routes/integration-index-page.d.ts +13 -0
- package/dist/internal/routes/integration-index-page.js +17 -0
- package/dist/routes.d.ts +3 -1
- package/dist/routes.js +2 -0
- package/package.json +6 -6
- package/dist/internal/components/row-groups.d.ts +0 -23
- package/dist/internal/components/row-groups.js +0 -37
|
@@ -25,9 +25,10 @@ import { type WidgetRenderState } from '@ekanos/sdk/components';
|
|
|
25
25
|
* - ADDED a `WidgetBoundary` around each widget so one partner's crash
|
|
26
26
|
* renders a readable card instead of blanking the page.
|
|
27
27
|
*
|
|
28
|
-
* Everything else — grid classes,
|
|
29
|
-
*
|
|
30
|
-
*
|
|
28
|
+
* Everything else — grid classes, the props handed to the provider, the two
|
|
29
|
+
* props handed to the widget — is verbatim. Row grouping is not copied: both
|
|
30
|
+
* grids import it from `@ekanos/sdk/layout` (the design system's widget rules). If
|
|
31
|
+
* the real grid's markup changes, this needs the same change.
|
|
31
32
|
*/
|
|
32
33
|
type DashboardGridLayout = 'masonry' | 'two-column';
|
|
33
34
|
interface DashboardGridProps {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { buildRowGroups, splitBalanced } from "@ekanos/sdk/layout";
|
|
3
4
|
import { HarnessWidgetProvider } from "./harness-widget-provider.js";
|
|
4
|
-
import { buildRowGroups, splitBalanced } from "./row-groups.js";
|
|
5
5
|
import { WidgetBoundary } from "./widget-boundary.js";
|
|
6
6
|
function DashboardGrid({
|
|
7
7
|
widgets,
|
|
@@ -27,6 +27,16 @@ function DashboardGrid({
|
|
|
27
27
|
group.widget.id
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
|
+
if (group.type === "compact") {
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: "grid grid-cols-1 items-start gap-5 @xl/dashboard:grid-cols-2 @4xl/dashboard:grid-cols-4",
|
|
35
|
+
children: group.widgets.map((widget) => /* @__PURE__ */ jsx(WidgetRenderer, { widget, ...shared }, widget.id))
|
|
36
|
+
},
|
|
37
|
+
group.widgets[0].id
|
|
38
|
+
);
|
|
39
|
+
}
|
|
30
40
|
const { left, right } = splitBalanced(group.widgets);
|
|
31
41
|
return /* @__PURE__ */ jsxs(
|
|
32
42
|
"div",
|
|
@@ -69,13 +69,13 @@ function ActivationPage() {
|
|
|
69
69
|
/* @__PURE__ */ jsx(AlertTitle, { children: mode === "live" ? "Submissions run onActivate on the dev server" : "Submissions go nowhere" }),
|
|
70
70
|
/* @__PURE__ */ jsxs(AlertDescription, { children: [
|
|
71
71
|
/* @__PURE__ */ jsxs("p", { children: [
|
|
72
|
-
"The harness has no Ekanos backend. Submitting shows you the",
|
|
72
|
+
mode === "live" ? "The generated shell stands in for the Ekanos backend. Submitting stores every string field of the form in .ekanos/local-secrets.json and hands it to your live handlers as ctx.secrets, then runs onActivate on that context \u2014 the same rule the host applies to the activation row. " : "The harness has no Ekanos backend. Submitting shows you the ",
|
|
73
|
+
mode === "live" ? null : /* @__PURE__ */ jsx("code", { children: "ActivationResult" }),
|
|
74
|
+
mode === "live" ? "The " : " your form handed back instead of persisting it \u2014 which is the part worth checking, since that payload is what the real activation action would store. The ",
|
|
75
|
+
"dialog, the capability and permission sections and the connected state are the real ones, rendered from your",
|
|
73
76
|
" ",
|
|
74
|
-
/* @__PURE__ */ jsx("code", { children: "ActivationResult" }),
|
|
75
|
-
" your form handed back instead of persisting it \u2014 which is the part worth checking, since that payload is what the real activation action would store. The dialog, the capability and permission sections and the connected state are the real ones, rendered from your ",
|
|
76
77
|
/* @__PURE__ */ jsx("code", { children: "defineIntegration()" }),
|
|
77
|
-
" "
|
|
78
|
-
"declaration."
|
|
78
|
+
" declaration."
|
|
79
79
|
] }),
|
|
80
80
|
/* @__PURE__ */ jsx("p", { "data-test": "activation-mode-notice-top", children: mode === "live" ? "Live API: an OAuth form\u2019s Connect runs the real loop through the generated shell (see Local OAuth below), onActivate runs on the server-held context that loop stored tokens in, and widgets reach real vendors through useIntegrationFetch(). The host runs the same declarations, with real enforcement, after you publish." : "Fixtures: an OAuth form reads its connection status from oauth.connected in your harness entry, onActivate runs in this browser against a context seeded from triggerMocks, and nothing leaves your machine." })
|
|
81
81
|
] })
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `/<slug>` — the address the home page's cards, the back link and every
|
|
3
|
+
* partner's muscle memory land on. It has no surface of its own: the five
|
|
4
|
+
* surfaces live one segment deeper, so this sends the browser to
|
|
5
|
+
* `/<slug>/widgets` (the one every session starts on) instead of rendering a
|
|
6
|
+
* 404 under a working toolbar, which is how it read for three releases.
|
|
7
|
+
*
|
|
8
|
+
* A client component because the registry — and therefore "does this slug
|
|
9
|
+
* exist" — is only readable from context (see routes.ts). The effect is the
|
|
10
|
+
* redirect itself: `redirect()` from next/navigation is a server-side
|
|
11
|
+
* primitive, and `router.replace` is the client equivalent.
|
|
12
|
+
*/
|
|
13
|
+
export declare function IntegrationIndexPage(): null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { notFound, useParams, useRouter } from "next/navigation";
|
|
4
|
+
import { useHarnessIntegration } from "../registry-context.js";
|
|
5
|
+
function IntegrationIndexPage() {
|
|
6
|
+
const params = useParams();
|
|
7
|
+
const router = useRouter();
|
|
8
|
+
const integration = useHarnessIntegration();
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (integration) router.replace(`/${params.slug}/widgets`);
|
|
11
|
+
}, [integration, params.slug, router]);
|
|
12
|
+
if (!integration) notFound();
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
IntegrationIndexPage
|
|
17
|
+
};
|
package/dist/routes.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The five `[slug]` surfaces
|
|
2
|
+
* The five `[slug]` surfaces, the `/<slug>` index that redirects to the first
|
|
3
|
+
* of them, plus their shared layout.
|
|
3
4
|
*
|
|
4
5
|
* Every one is a `'use client'` module: the registry holds live React component
|
|
5
6
|
* references, which cannot cross the server/client boundary as props, so each
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
* local dev tool that is not a real cost.
|
|
18
19
|
*/
|
|
19
20
|
export { IntegrationLayout } from './internal/routes/integration-layout.js';
|
|
21
|
+
export { IntegrationIndexPage } from './internal/routes/integration-index-page.js';
|
|
20
22
|
export { WidgetsPage } from './internal/routes/widgets-page.js';
|
|
21
23
|
export { SingleWidgetPage } from './internal/routes/single-widget-page.js';
|
|
22
24
|
export { TilePage } from './internal/routes/tile-page.js';
|
package/dist/routes.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { IntegrationLayout } from "./internal/routes/integration-layout.js";
|
|
3
|
+
import { IntegrationIndexPage } from "./internal/routes/integration-index-page.js";
|
|
3
4
|
import { WidgetsPage } from "./internal/routes/widgets-page.js";
|
|
4
5
|
import { SingleWidgetPage } from "./internal/routes/single-widget-page.js";
|
|
5
6
|
import { TilePage } from "./internal/routes/tile-page.js";
|
|
@@ -7,6 +8,7 @@ import { ActivationPage } from "./internal/routes/activation-page.js";
|
|
|
7
8
|
import { TriggersPage } from "./internal/routes/triggers-page.js";
|
|
8
9
|
export {
|
|
9
10
|
ActivationPage,
|
|
11
|
+
IntegrationIndexPage,
|
|
10
12
|
IntegrationLayout,
|
|
11
13
|
SingleWidgetPage,
|
|
12
14
|
TilePage,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ekanos/harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "The Ekanos integration dev harness — every surface of an integration rendered in real Ekanos chrome, from fixtures, with no Supabase or auth; and, in live mode, a real localhost OAuth loop over your own dev-app credentials.",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"email": "npm@govastly.com"
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"tw-animate-css": "1.4.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@ekanos/sdk": "0.
|
|
67
|
-
"@ekanos/ui": "0.
|
|
66
|
+
"@ekanos/sdk": "0.7.0",
|
|
67
|
+
"@ekanos/ui": "0.7.0",
|
|
68
68
|
"@kit/tsconfig": "0.1.0",
|
|
69
69
|
"@tailwindcss/postcss": "4.3.3",
|
|
70
70
|
"@tanstack/react-query": "5.103.2",
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"zod": "4.6.5"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
|
-
"@ekanos/sdk": "^0.
|
|
87
|
-
"@ekanos/ui": "^0.4.0 || ^0.5.0 || ^0.6.0",
|
|
86
|
+
"@ekanos/sdk": "^0.7.0",
|
|
87
|
+
"@ekanos/ui": "^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0",
|
|
88
88
|
"@tanstack/react-query": "^5.101.4",
|
|
89
89
|
"next": "^16.0.0",
|
|
90
90
|
"next-intl": "^4.14.7",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"tailwindcss": "^4.0.0"
|
|
95
95
|
},
|
|
96
96
|
"ekanos": {
|
|
97
|
-
"shellContract":
|
|
97
|
+
"shellContract": 3
|
|
98
98
|
},
|
|
99
99
|
"scripts": {
|
|
100
100
|
"build": "tsup && tsc -p tsconfig.build.json && node scripts/rewrite-esm-specifiers.mjs && node scripts/build-css.mjs",
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { WidgetConfig } from '@ekanos/sdk';
|
|
2
|
-
export type RowGroup = {
|
|
3
|
-
type: 'full';
|
|
4
|
-
widget: WidgetConfig;
|
|
5
|
-
} | {
|
|
6
|
-
type: 'half';
|
|
7
|
-
widgets: WidgetConfig[];
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Build row groups that preserve widget order. Contiguous runs of half-width
|
|
11
|
-
* widgets are grouped together; full-width widgets each get their own row.
|
|
12
|
-
*/
|
|
13
|
-
export declare function buildRowGroups(widgets: WidgetConfig[]): RowGroup[];
|
|
14
|
-
export declare function getColSpan(widget: WidgetConfig): 1 | 2;
|
|
15
|
-
/**
|
|
16
|
-
* Splits a run of half-width widgets into two balanced columns, alternating
|
|
17
|
-
* into whichever column is currently shorter (left wins ties) — preserves
|
|
18
|
-
* the exact alternation `MasonryGrid` rendered inline before extraction.
|
|
19
|
-
*/
|
|
20
|
-
export declare function splitBalanced(widgets: WidgetConfig[]): {
|
|
21
|
-
left: WidgetConfig[];
|
|
22
|
-
right: WidgetConfig[];
|
|
23
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
function buildRowGroups(widgets) {
|
|
2
|
-
const groups = [];
|
|
3
|
-
let halfBatch = [];
|
|
4
|
-
for (const widget of widgets) {
|
|
5
|
-
if (getColSpan(widget) === 2) {
|
|
6
|
-
if (halfBatch.length > 0) {
|
|
7
|
-
groups.push({ type: "half", widgets: halfBatch });
|
|
8
|
-
halfBatch = [];
|
|
9
|
-
}
|
|
10
|
-
groups.push({ type: "full", widget });
|
|
11
|
-
} else {
|
|
12
|
-
halfBatch.push(widget);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
if (halfBatch.length > 0) {
|
|
16
|
-
groups.push({ type: "half", widgets: halfBatch });
|
|
17
|
-
}
|
|
18
|
-
return groups;
|
|
19
|
-
}
|
|
20
|
-
function getColSpan(widget) {
|
|
21
|
-
const w = widget.layouts?.lg?.w ?? 6;
|
|
22
|
-
return w > 6 ? 2 : 1;
|
|
23
|
-
}
|
|
24
|
-
function splitBalanced(widgets) {
|
|
25
|
-
const left = [];
|
|
26
|
-
const right = [];
|
|
27
|
-
for (const w of widgets) {
|
|
28
|
-
if (left.length <= right.length) left.push(w);
|
|
29
|
-
else right.push(w);
|
|
30
|
-
}
|
|
31
|
-
return { left, right };
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
buildRowGroups,
|
|
35
|
-
getColSpan,
|
|
36
|
-
splitBalanced
|
|
37
|
-
};
|