@ekanos/harness 0.27.0 → 0.28.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/README.md +6 -4
- package/dist/internal/components/approvals-tray.d.ts +44 -6
- package/dist/internal/components/approvals-tray.js +252 -30
- package/dist/internal/components/connect-controls.js +4 -2
- package/dist/internal/components/connect-dialog.d.ts +8 -1
- package/dist/internal/components/connect-dialog.js +23 -10
- package/dist/internal/components/connect-panel.d.ts +3 -2
- package/dist/internal/components/connect-panel.js +680 -340
- package/dist/internal/components/connect-steps.d.ts +72 -0
- package/dist/internal/components/connect-steps.js +341 -0
- package/dist/internal/components/console-not-found.d.ts +14 -0
- package/dist/internal/components/console-not-found.js +57 -0
- package/dist/internal/components/dashboard-grid.d.ts +10 -5
- package/dist/internal/components/dashboard-grid.js +8 -9
- package/dist/internal/components/dev-toolbar.d.ts +27 -5
- package/dist/internal/components/dev-toolbar.js +214 -176
- package/dist/internal/components/ekanos-logo.d.ts +18 -0
- package/dist/internal/components/ekanos-logo.js +74 -0
- package/dist/internal/components/events-panel.d.ts +13 -4
- package/dist/internal/components/events-panel.js +478 -81
- package/dist/internal/components/harness-widget-provider.d.ts +6 -8
- package/dist/internal/components/harness-widget-provider.js +5 -19
- package/dist/internal/components/health-panel.d.ts +8 -1
- package/dist/internal/components/health-panel.js +328 -31
- package/dist/internal/components/integration-badge.js +4 -2
- package/dist/internal/components/integration-tab-skeletons.d.ts +8 -0
- package/dist/internal/components/integration-tab-skeletons.js +76 -0
- package/dist/internal/components/not-found-state.d.ts +39 -0
- package/dist/internal/components/not-found-state.js +127 -0
- package/dist/internal/components/operation-runner-panel.d.ts +1 -1
- package/dist/internal/components/operation-runner-panel.js +624 -189
- package/dist/internal/components/operation-scope.d.ts +13 -0
- package/dist/internal/components/operation-scope.js +79 -0
- package/dist/internal/components/page-skeletons.d.ts +11 -0
- package/dist/internal/components/page-skeletons.js +61 -0
- package/dist/internal/components/provenance-banner.d.ts +13 -4
- package/dist/internal/components/provenance-banner.js +35 -10
- package/dist/internal/components/run-log-copy.d.ts +17 -0
- package/dist/internal/components/run-log-copy.js +67 -0
- package/dist/internal/components/run-log-detail.d.ts +22 -0
- package/dist/internal/components/run-log-detail.js +295 -0
- package/dist/internal/components/run-log-empty.d.ts +13 -0
- package/dist/internal/components/run-log-empty.js +46 -0
- package/dist/internal/components/run-log.d.ts +23 -3
- package/dist/internal/components/run-log.js +384 -130
- package/dist/internal/components/runtime-strip.d.ts +5 -1
- package/dist/internal/components/runtime-strip.js +82 -5
- package/dist/internal/components/schema-form.d.ts +2 -1
- package/dist/internal/components/schema-form.js +212 -79
- package/dist/internal/components/scrollable-nav.js +14 -2
- package/dist/internal/components/segmented-control.d.ts +19 -0
- package/dist/internal/components/segmented-control.js +46 -0
- package/dist/internal/components/shell-header.d.ts +25 -0
- package/dist/internal/components/shell-header.js +126 -0
- package/dist/internal/components/surface-nav.d.ts +12 -4
- package/dist/internal/components/surface-nav.js +77 -77
- package/dist/internal/components/widget-surface.d.ts +5 -1
- package/dist/internal/components/widget-surface.js +86 -14
- package/dist/internal/components/workflow-runner.d.ts +23 -10
- package/dist/internal/components/workflow-runner.js +451 -69
- package/dist/internal/lib/connect-model.d.ts +134 -0
- package/dist/internal/lib/connect-model.js +282 -0
- package/dist/internal/lib/connection-facts.js +2 -1
- package/dist/internal/lib/console-client.js +5 -2
- package/dist/internal/lib/console-hooks.d.ts +4 -1
- package/dist/internal/lib/console-hooks.js +3 -2
- package/dist/internal/lib/console-types.d.ts +6 -0
- package/dist/internal/lib/docs-links.d.ts +28 -0
- package/dist/internal/lib/docs-links.js +57 -1
- package/dist/internal/lib/event-delivery.d.ts +33 -0
- package/dist/internal/lib/event-delivery.js +66 -0
- package/dist/internal/lib/font-files/OFL-BricolageGrotesque.txt +93 -0
- package/dist/internal/lib/font-files/OFL-Figtree.txt +93 -0
- package/dist/internal/lib/font-files/bricolage-grotesque-latin-variable.woff2 +0 -0
- package/dist/internal/lib/font-files/figtree-latin-variable.woff2 +0 -0
- package/dist/internal/lib/fonts.js +13 -12
- package/dist/internal/lib/health-model.d.ts +58 -0
- package/dist/internal/lib/health-model.js +140 -0
- package/dist/internal/lib/integration-console-href.d.ts +5 -0
- package/dist/internal/lib/integration-console-href.js +7 -1
- package/dist/internal/lib/oauth-setup-guide.d.ts +28 -0
- package/dist/internal/lib/oauth-setup-guide.js +35 -1
- package/dist/internal/lib/operation-catalog.d.ts +70 -0
- package/dist/internal/lib/operation-catalog.js +261 -0
- package/dist/internal/lib/overview-model.d.ts +34 -0
- package/dist/internal/lib/overview-model.js +91 -0
- package/dist/internal/lib/registry-entry.d.ts +8 -0
- package/dist/internal/lib/registry-entry.js +11 -0
- package/dist/internal/lib/repo-name.d.ts +9 -0
- package/dist/internal/lib/repo-name.js +21 -0
- package/dist/internal/lib/run-log-view.d.ts +66 -1
- package/dist/internal/lib/run-log-view.js +183 -4
- package/dist/internal/lib/runner-view.d.ts +15 -0
- package/dist/internal/lib/runner-view.js +18 -0
- package/dist/internal/lib/schema-form-model.d.ts +17 -0
- package/dist/internal/lib/schema-form-model.js +50 -0
- package/dist/internal/lib/setup-checklist.d.ts +34 -0
- package/dist/internal/lib/setup-checklist.js +79 -0
- package/dist/internal/lib/toolbar-context.d.ts +0 -1
- package/dist/internal/lib/toolbar-context.js +0 -2
- package/dist/internal/lib/toolbar-visibility.d.ts +9 -2
- package/dist/internal/lib/toolbar-visibility.js +5 -0
- package/dist/internal/lib/use-operation-effects.d.ts +7 -0
- package/dist/internal/lib/use-operation-effects.js +28 -0
- package/dist/internal/lib/use-run-log-query.d.ts +9 -0
- package/dist/internal/lib/use-run-log-query.js +35 -0
- package/dist/internal/lib/widget-grid-gaps.d.ts +18 -0
- package/dist/internal/lib/widget-grid-gaps.js +41 -0
- package/dist/internal/lib/workflow-summary.d.ts +54 -0
- package/dist/internal/lib/workflow-summary.js +147 -0
- package/dist/internal/routes/console-home-page.js +2 -1
- package/dist/internal/routes/experience-connect-page.js +46 -17
- package/dist/internal/routes/experience-layout-page.js +75 -26
- package/dist/internal/routes/experience-page-host.js +63 -5
- package/dist/internal/routes/experience-review-queue-page.d.ts +4 -1
- package/dist/internal/routes/experience-review-queue-page.js +108 -12
- package/dist/internal/routes/experience-runs-page.js +57 -4
- package/dist/internal/routes/experience-summary-page.d.ts +19 -0
- package/dist/internal/routes/experience-summary-page.js +212 -52
- package/dist/internal/routes/experience-widget-page.js +58 -7
- package/dist/internal/routes/experience-widgets-page.d.ts +2 -3
- package/dist/internal/routes/experience-widgets-page.js +29 -4
- package/dist/internal/routes/experience-workflow-page.js +81 -9
- package/dist/internal/routes/experience-workflows-page.js +85 -21
- package/dist/internal/routes/integration-layout.js +28 -3
- package/dist/internal/routes/integrations-connect-page.js +16 -6
- package/dist/internal/routes/integrations-events-page.js +22 -1
- package/dist/internal/routes/integrations-health-page.js +16 -1
- package/dist/internal/routes/integrations-layout.js +28 -4
- package/dist/internal/routes/integrations-list-page.d.ts +0 -1
- package/dist/internal/routes/integrations-list-page.js +11 -9
- package/dist/internal/routes/integrations-operation-page.js +53 -17
- package/dist/internal/routes/integrations-operations-page.js +539 -49
- package/dist/internal/routes/integrations-overview-page.js +332 -69
- package/dist/internal/routes/integrations-runs-page.js +53 -3
- package/dist/internal/routes/integrations-scope.d.ts +15 -2
- package/dist/internal/routes/integrations-scope.js +66 -18
- package/dist/internal/routes/preview-index-page.js +2 -2
- package/dist/internal/routes/repo-home-page.d.ts +2 -2
- package/dist/internal/routes/repo-home-page.js +428 -236
- package/dist/internal/routes/repo-layout.d.ts +12 -0
- package/dist/internal/routes/repo-layout.js +50 -38
- package/dist/internal/routes/repo-package-layouts.js +22 -8
- package/dist/internal/routes/single-widget-page.d.ts +1 -1
- package/dist/internal/routes/single-widget-page.js +28 -5
- package/dist/internal/routes/tile-page.d.ts +1 -1
- package/dist/internal/routes/tile-page.js +1 -2
- package/dist/internal/routes/widgets-page.d.ts +1 -1
- package/dist/internal/routes/widgets-page.js +5 -3
- package/dist/registry.d.ts +4 -5
- package/dist/registry.js +0 -1
- package/dist/routes.d.ts +5 -0
- package/dist/routes.js +2 -0
- package/package.json +8 -8
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type StepStatus } from '../lib/connect-model.js';
|
|
3
|
+
import type { ConnectionSetupGuide } from '../lib/oauth-setup-guide.js';
|
|
4
|
+
/**
|
|
5
|
+
* One numbered step of the Connect tab: a marker that is the step's number
|
|
6
|
+
* until it is done (then a check), its title and progress line, and its body.
|
|
7
|
+
* A step that cannot start yet is drawn quieter but stays readable.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ConnectStepItem({ number, title, status, summary, last, testId, children, }: {
|
|
10
|
+
number: number;
|
|
11
|
+
title: string;
|
|
12
|
+
status: StepStatus;
|
|
13
|
+
summary: string;
|
|
14
|
+
last?: boolean;
|
|
15
|
+
testId: string;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
export declare function ConnectStepList({ children }: {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* A labelled box around related rows, like one OAuth app's keys. A `guide`
|
|
23
|
+
* (where to get these keys) is a compact strip under the header, so the card
|
|
24
|
+
* is only as tall as its rows and the first field stays near the top.
|
|
25
|
+
*/
|
|
26
|
+
export declare function CredentialGroup({ title, description, aside, guide, testId, children, }: {
|
|
27
|
+
title: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
aside?: ReactNode;
|
|
30
|
+
guide?: ReactNode;
|
|
31
|
+
testId: string;
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
}): import("react").JSX.Element;
|
|
34
|
+
/**
|
|
35
|
+
* One credential: its human label, the raw key in a monospace chip, whether
|
|
36
|
+
* it is required, whether a value is saved, its description, and the field.
|
|
37
|
+
* A secret is typed masked, with a toggle to check what was typed; a saved
|
|
38
|
+
* value is never shown, because it never reaches the browser.
|
|
39
|
+
*/
|
|
40
|
+
export declare function CredentialRow({ id, name, label, description, note, requirement, primary, secret, set, value, disabled, onChange, action, testId, }: {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
label: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
note?: string;
|
|
46
|
+
/** What saving it unlocks: "Needed for the main connection", "Optional". */
|
|
47
|
+
requirement: string;
|
|
48
|
+
/** The requirement is for the first connection, so it reads stronger. */
|
|
49
|
+
primary?: boolean;
|
|
50
|
+
secret: boolean;
|
|
51
|
+
set: boolean;
|
|
52
|
+
value: string;
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
onChange: (value: string) => void;
|
|
55
|
+
action?: ReactNode;
|
|
56
|
+
testId: string;
|
|
57
|
+
}): import("react").JSX.Element;
|
|
58
|
+
/** A value to paste somewhere else, with Copy. */
|
|
59
|
+
export declare function CopyValue({ value, label, testId, }: {
|
|
60
|
+
value: string;
|
|
61
|
+
label: string;
|
|
62
|
+
testId: string;
|
|
63
|
+
}): import("react").JSX.Element;
|
|
64
|
+
/**
|
|
65
|
+
* Where a developer gets an OAuth app's keys. The essentials stay in view:
|
|
66
|
+
* the provider console and the redirect URI to register. The declared steps
|
|
67
|
+
* and the integration's notes sit behind one disclosure.
|
|
68
|
+
*/
|
|
69
|
+
export declare function SetupGuide({ guide, testId, }: {
|
|
70
|
+
guide: ConnectionSetupGuide;
|
|
71
|
+
testId: string;
|
|
72
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Button } from "@ekanos/ui/button";
|
|
5
|
+
import { Card } from "@ekanos/ui/card";
|
|
6
|
+
import { Icon } from "@ekanos/ui/icon";
|
|
7
|
+
import { Input } from "@ekanos/ui/input";
|
|
8
|
+
import { Label } from "@ekanos/ui/label";
|
|
9
|
+
import { StatusBadge } from "@ekanos/ui/status-badge";
|
|
10
|
+
import { cn } from "@ekanos/ui/utils";
|
|
11
|
+
import { restatesRequirement } from "../lib/connect-model.js";
|
|
12
|
+
const STATUS_LABEL = {
|
|
13
|
+
done: "Done",
|
|
14
|
+
current: "To do",
|
|
15
|
+
todo: "Not yet"
|
|
16
|
+
};
|
|
17
|
+
function ConnectStepItem({
|
|
18
|
+
number,
|
|
19
|
+
title,
|
|
20
|
+
status,
|
|
21
|
+
summary,
|
|
22
|
+
last = false,
|
|
23
|
+
testId,
|
|
24
|
+
children
|
|
25
|
+
}) {
|
|
26
|
+
return /* @__PURE__ */ jsxs(
|
|
27
|
+
"li",
|
|
28
|
+
{
|
|
29
|
+
className: "relative flex min-w-0 gap-3 sm:gap-4",
|
|
30
|
+
"data-test": testId,
|
|
31
|
+
"data-status": status,
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
"span",
|
|
36
|
+
{
|
|
37
|
+
className: cn(
|
|
38
|
+
"flex size-7 shrink-0 items-center justify-center rounded-full border text-sm font-medium",
|
|
39
|
+
status === "done" && "bg-success text-success-foreground border-success",
|
|
40
|
+
status === "current" && "border-primary text-primary bg-background",
|
|
41
|
+
status === "todo" && "text-muted-foreground bg-muted"
|
|
42
|
+
),
|
|
43
|
+
"aria-hidden": true,
|
|
44
|
+
children: status === "done" ? /* @__PURE__ */ jsx(Icon, { name: "check", className: "size-4" }) : number
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
last ? null : /* @__PURE__ */ jsx("span", { className: "bg-border mt-2 w-px flex-1", "aria-hidden": true })
|
|
48
|
+
] }),
|
|
49
|
+
/* @__PURE__ */ jsxs(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: cn("flex min-w-0 flex-1 flex-col gap-4", !last && "pb-8"),
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-h-7 flex-wrap items-center gap-x-3 gap-y-1", children: [
|
|
55
|
+
/* @__PURE__ */ jsxs("h3", { className: "font-heading font-heading-title text-base", children: [
|
|
56
|
+
/* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
|
|
57
|
+
"Step ",
|
|
58
|
+
number,
|
|
59
|
+
": "
|
|
60
|
+
] }),
|
|
61
|
+
title
|
|
62
|
+
] }),
|
|
63
|
+
/* @__PURE__ */ jsx(
|
|
64
|
+
StatusBadge,
|
|
65
|
+
{
|
|
66
|
+
tone: status === "done" ? "success" : status === "current" ? "info" : "neutral",
|
|
67
|
+
"data-test": `${testId}-status`,
|
|
68
|
+
children: STATUS_LABEL[status]
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: summary })
|
|
72
|
+
] }),
|
|
73
|
+
children
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
function ConnectStepList({ children }) {
|
|
82
|
+
return /* @__PURE__ */ jsx("ol", { className: "flex min-w-0 flex-col", "data-test": "connect-steps", children });
|
|
83
|
+
}
|
|
84
|
+
function CredentialGroup({
|
|
85
|
+
title,
|
|
86
|
+
description,
|
|
87
|
+
aside,
|
|
88
|
+
guide,
|
|
89
|
+
testId,
|
|
90
|
+
children
|
|
91
|
+
}) {
|
|
92
|
+
return /* @__PURE__ */ jsxs(
|
|
93
|
+
Card,
|
|
94
|
+
{
|
|
95
|
+
layout: "bleed",
|
|
96
|
+
render: /* @__PURE__ */ jsx("section", {}),
|
|
97
|
+
className: "flex min-w-0 flex-col gap-0 overflow-hidden py-0",
|
|
98
|
+
"data-test": testId,
|
|
99
|
+
children: [
|
|
100
|
+
title || description || aside ? /* @__PURE__ */ jsxs("header", { className: "flex flex-col gap-1 border-b px-4 py-3", children: [
|
|
101
|
+
title ? /* @__PURE__ */ jsx("h4", { className: "text-sm font-semibold", children: title }) : null,
|
|
102
|
+
description ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs", children: description }) : null,
|
|
103
|
+
aside
|
|
104
|
+
] }) : null,
|
|
105
|
+
guide ? /* @__PURE__ */ jsx(
|
|
106
|
+
"aside",
|
|
107
|
+
{
|
|
108
|
+
className: "bg-secondary min-w-0 border-b px-4 py-3",
|
|
109
|
+
"aria-label": "Where to get these keys",
|
|
110
|
+
children: guide
|
|
111
|
+
}
|
|
112
|
+
) : null,
|
|
113
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-col divide-y", children })
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
function CredentialRow({
|
|
119
|
+
id,
|
|
120
|
+
name,
|
|
121
|
+
label,
|
|
122
|
+
description,
|
|
123
|
+
note,
|
|
124
|
+
requirement,
|
|
125
|
+
primary = false,
|
|
126
|
+
secret,
|
|
127
|
+
set,
|
|
128
|
+
value,
|
|
129
|
+
disabled,
|
|
130
|
+
onChange,
|
|
131
|
+
action,
|
|
132
|
+
testId
|
|
133
|
+
}) {
|
|
134
|
+
const [revealed, setRevealed] = useState(false);
|
|
135
|
+
const descriptionId = `${id}-description`;
|
|
136
|
+
const shown = revealed && value !== "";
|
|
137
|
+
const merged = restatesRequirement(requirement, description);
|
|
138
|
+
const lead = merged && description ? description : `${requirement}.`;
|
|
139
|
+
const rest = merged ? void 0 : description;
|
|
140
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-2 px-4 py-3", "data-test": testId, children: [
|
|
141
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1", children: [
|
|
142
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: id, className: "text-sm font-medium", children: label }),
|
|
143
|
+
/* @__PURE__ */ jsx(
|
|
144
|
+
"code",
|
|
145
|
+
{
|
|
146
|
+
className: "bg-muted text-muted-foreground max-w-full truncate rounded px-1.5 py-0.5 font-mono text-xs",
|
|
147
|
+
title: name,
|
|
148
|
+
children: name
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
/* @__PURE__ */ jsxs("span", { className: "ml-auto flex items-center gap-2", children: [
|
|
152
|
+
/* @__PURE__ */ jsx(
|
|
153
|
+
StatusBadge,
|
|
154
|
+
{
|
|
155
|
+
tone: set ? "success" : "neutral",
|
|
156
|
+
"data-test": `${testId}-state`,
|
|
157
|
+
children: set ? "Set" : "Not set"
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
action
|
|
161
|
+
] })
|
|
162
|
+
] }),
|
|
163
|
+
/* @__PURE__ */ jsxs("p", { id: descriptionId, className: "text-muted-foreground -mt-1 text-xs", children: [
|
|
164
|
+
/* @__PURE__ */ jsx(
|
|
165
|
+
"span",
|
|
166
|
+
{
|
|
167
|
+
className: cn(
|
|
168
|
+
"mr-1",
|
|
169
|
+
primary ? "text-foreground font-medium" : "font-medium"
|
|
170
|
+
),
|
|
171
|
+
"data-test": `${testId}-requirement`,
|
|
172
|
+
children: lead
|
|
173
|
+
}
|
|
174
|
+
),
|
|
175
|
+
rest,
|
|
176
|
+
rest && note ? " " : null,
|
|
177
|
+
note
|
|
178
|
+
] }),
|
|
179
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
180
|
+
/* @__PURE__ */ jsx(
|
|
181
|
+
Input,
|
|
182
|
+
{
|
|
183
|
+
id,
|
|
184
|
+
type: secret && !shown ? "password" : "text",
|
|
185
|
+
autoComplete: "off",
|
|
186
|
+
spellCheck: false,
|
|
187
|
+
disabled,
|
|
188
|
+
placeholder: set ? "Saved. Type a new value to replace it." : `Paste the ${lowerFirst(label)}`,
|
|
189
|
+
"aria-describedby": descriptionId,
|
|
190
|
+
className: "min-w-0 flex-1 font-mono",
|
|
191
|
+
value,
|
|
192
|
+
onChange: (event) => onChange(event.target.value)
|
|
193
|
+
}
|
|
194
|
+
),
|
|
195
|
+
secret ? /* @__PURE__ */ jsx(
|
|
196
|
+
Button,
|
|
197
|
+
{
|
|
198
|
+
type: "button",
|
|
199
|
+
variant: "ghost",
|
|
200
|
+
size: "icon",
|
|
201
|
+
"aria-label": shown ? `Hide ${label}` : `Show ${label}`,
|
|
202
|
+
"aria-pressed": shown,
|
|
203
|
+
disabled: value === "",
|
|
204
|
+
onClick: () => setRevealed(!shown),
|
|
205
|
+
"data-test": `${testId}-reveal`,
|
|
206
|
+
children: /* @__PURE__ */ jsx(Icon, { name: shown ? "eye-slash" : "eye" })
|
|
207
|
+
}
|
|
208
|
+
) : null
|
|
209
|
+
] })
|
|
210
|
+
] });
|
|
211
|
+
}
|
|
212
|
+
function lowerFirst(label) {
|
|
213
|
+
return /^[A-Z][a-z]/.test(label) ? label.charAt(0).toLowerCase() + label.slice(1) : label;
|
|
214
|
+
}
|
|
215
|
+
const LINK = "text-primary focus-visible:ring-ring inline-flex items-center gap-1 rounded-sm text-sm font-medium underline-offset-2 hover:underline focus-visible:ring-2 focus-visible:outline-none";
|
|
216
|
+
function CopyValue({
|
|
217
|
+
value,
|
|
218
|
+
label,
|
|
219
|
+
testId
|
|
220
|
+
}) {
|
|
221
|
+
const [copied, setCopied] = useState(false);
|
|
222
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
223
|
+
/* @__PURE__ */ jsx(
|
|
224
|
+
"code",
|
|
225
|
+
{
|
|
226
|
+
className: "bg-muted min-w-0 flex-1 rounded-md px-3 py-2 font-mono text-xs break-all",
|
|
227
|
+
"data-test": testId,
|
|
228
|
+
children: value
|
|
229
|
+
}
|
|
230
|
+
),
|
|
231
|
+
/* @__PURE__ */ jsxs(
|
|
232
|
+
Button,
|
|
233
|
+
{
|
|
234
|
+
type: "button",
|
|
235
|
+
variant: "outline",
|
|
236
|
+
size: "sm",
|
|
237
|
+
"aria-label": `Copy ${label}`,
|
|
238
|
+
onClick: async () => {
|
|
239
|
+
try {
|
|
240
|
+
await navigator.clipboard.writeText(value);
|
|
241
|
+
setCopied(true);
|
|
242
|
+
setTimeout(() => setCopied(false), 1500);
|
|
243
|
+
} catch (error) {
|
|
244
|
+
console.warn("[harness] could not copy to the clipboard:", error);
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"data-test": `${testId}-copy`,
|
|
248
|
+
children: [
|
|
249
|
+
/* @__PURE__ */ jsx(Icon, { name: copied ? "check" : "copy" }),
|
|
250
|
+
copied ? "Copied" : "Copy"
|
|
251
|
+
]
|
|
252
|
+
}
|
|
253
|
+
)
|
|
254
|
+
] });
|
|
255
|
+
}
|
|
256
|
+
function SetupGuide({
|
|
257
|
+
guide,
|
|
258
|
+
testId
|
|
259
|
+
}) {
|
|
260
|
+
const hasLinks = guide.console !== null || guide.guideUrl !== null;
|
|
261
|
+
const more = guide.steps.length + guide.notes.length;
|
|
262
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-2.5 text-sm", "data-test": testId, children: [
|
|
263
|
+
hasLinks ? /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-1", children: [
|
|
264
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: "Get these from" }),
|
|
265
|
+
guide.console ? /* @__PURE__ */ jsxs(
|
|
266
|
+
"a",
|
|
267
|
+
{
|
|
268
|
+
href: guide.console.url,
|
|
269
|
+
target: "_blank",
|
|
270
|
+
rel: "noreferrer",
|
|
271
|
+
className: LINK,
|
|
272
|
+
"data-test": `${testId}-console`,
|
|
273
|
+
children: [
|
|
274
|
+
guide.console.label,
|
|
275
|
+
/* @__PURE__ */ jsx(Icon, { name: "arrow-square-out", className: "size-3.5 shrink-0" })
|
|
276
|
+
]
|
|
277
|
+
}
|
|
278
|
+
) : null,
|
|
279
|
+
guide.guideUrl ? /* @__PURE__ */ jsxs(
|
|
280
|
+
"a",
|
|
281
|
+
{
|
|
282
|
+
href: guide.guideUrl,
|
|
283
|
+
target: "_blank",
|
|
284
|
+
rel: "noreferrer",
|
|
285
|
+
className: LINK,
|
|
286
|
+
"data-test": `${testId}-guide`,
|
|
287
|
+
children: [
|
|
288
|
+
"Setup guide",
|
|
289
|
+
/* @__PURE__ */ jsx(Icon, { name: "arrow-square-out", className: "size-3.5 shrink-0" })
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
) : null
|
|
293
|
+
] }) : null,
|
|
294
|
+
guide.redirectUri ? /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3", children: [
|
|
295
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: "Redirect URI to register, exactly" }),
|
|
296
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1 sm:max-w-xl", children: /* @__PURE__ */ jsx(
|
|
297
|
+
CopyValue,
|
|
298
|
+
{
|
|
299
|
+
value: guide.redirectUri,
|
|
300
|
+
label: "redirect URI",
|
|
301
|
+
testId: `${testId}-redirect-uri`
|
|
302
|
+
}
|
|
303
|
+
) })
|
|
304
|
+
] }) : null,
|
|
305
|
+
more > 0 ? /* @__PURE__ */ jsxs("details", { className: "group/steps", "data-test": `${testId}-steps`, children: [
|
|
306
|
+
/* @__PURE__ */ jsxs("summary", { className: "text-muted-foreground hover:text-foreground focus-visible:ring-ring flex w-fit cursor-pointer list-none items-center gap-1.5 rounded-sm text-xs font-medium focus-visible:ring-2 focus-visible:outline-none [&::-webkit-details-marker]:hidden", children: [
|
|
307
|
+
/* @__PURE__ */ jsx(
|
|
308
|
+
Icon,
|
|
309
|
+
{
|
|
310
|
+
name: "caret-right",
|
|
311
|
+
className: "size-3 transition-transform group-open/steps:rotate-90"
|
|
312
|
+
}
|
|
313
|
+
),
|
|
314
|
+
/* @__PURE__ */ jsx("span", { className: "group-open/steps:hidden", children: "Show setup steps" }),
|
|
315
|
+
/* @__PURE__ */ jsx("span", { className: "hidden group-open/steps:inline", children: "Hide setup steps" })
|
|
316
|
+
] }),
|
|
317
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-2 flex max-w-3xl flex-col gap-3", children: [
|
|
318
|
+
guide.steps.length > 0 ? /* @__PURE__ */ jsx("ol", { className: "text-muted-foreground flex list-decimal flex-col gap-1.5 pl-5 text-sm [overflow-wrap:anywhere]", children: guide.steps.map((step) => /* @__PURE__ */ jsx("li", { children: step }, step)) }) : null,
|
|
319
|
+
guide.notes.length > 0 ? /* @__PURE__ */ jsxs(
|
|
320
|
+
"div",
|
|
321
|
+
{
|
|
322
|
+
className: "flex flex-col gap-1.5",
|
|
323
|
+
"data-test": `${testId}-notes`,
|
|
324
|
+
children: [
|
|
325
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: "Notes from the integration" }),
|
|
326
|
+
/* @__PURE__ */ jsx("ul", { className: "text-muted-foreground flex list-disc flex-col gap-1.5 pl-5 text-sm [overflow-wrap:anywhere]", children: guide.notes.map((note) => /* @__PURE__ */ jsx("li", { children: note }, note)) })
|
|
327
|
+
]
|
|
328
|
+
}
|
|
329
|
+
) : null
|
|
330
|
+
] })
|
|
331
|
+
] }) : null
|
|
332
|
+
] });
|
|
333
|
+
}
|
|
334
|
+
export {
|
|
335
|
+
ConnectStepItem,
|
|
336
|
+
ConnectStepList,
|
|
337
|
+
CopyValue,
|
|
338
|
+
CredentialGroup,
|
|
339
|
+
CredentialRow,
|
|
340
|
+
SetupGuide
|
|
341
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A console `[slug]` this project has no integration for: the integrations it
|
|
3
|
+
* does have, linked where the harness serves their console.
|
|
4
|
+
*/
|
|
5
|
+
export declare function IntegrationNotFound({ slug }: {
|
|
6
|
+
slug: string;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
/** An operation the contract does not declare: back to the list, where search finds the right one. */
|
|
9
|
+
export declare function OperationNotFound({ kind, name, integration, operationsHref, }: {
|
|
10
|
+
kind: string;
|
|
11
|
+
name: string;
|
|
12
|
+
integration: string;
|
|
13
|
+
operationsHref: string;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useConsoleLinks } from "../lib/console-context.js";
|
|
4
|
+
import { useProject } from "../lib/console-hooks.js";
|
|
5
|
+
import { integrationConsoleHref } from "../lib/integration-console-href.js";
|
|
6
|
+
import { NotFoundState } from "./not-found-state.js";
|
|
7
|
+
function IntegrationNotFound({ slug }) {
|
|
8
|
+
const project = useProject();
|
|
9
|
+
const links = useConsoleLinks();
|
|
10
|
+
const integrations = project.data?.integrations ?? [];
|
|
11
|
+
const name = decodeURIComponent(slug);
|
|
12
|
+
const home = project.data?.kind === "experience" ? { label: `Back to ${project.data.name}`, href: links.experience } : links.repoHome ? { label: "Back to the repo home", href: links.repoHome } : { label: "Back to the console", href: "/" };
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
NotFoundState,
|
|
15
|
+
{
|
|
16
|
+
testId: "integration-not-found",
|
|
17
|
+
title: `No integration called \u201C${name}\u201D`,
|
|
18
|
+
description: integrations.length > 0 ? project.data?.kind === "experience" ? `${project.data.name} does not use an integration named ${name}. Pick one it does use, or check the name in the address.` : `This project has no integration named ${name}. Open the one it has, or check the name in the address.` : "This project uses no integrations, so there is no console to open.",
|
|
19
|
+
options: integrations.map((integration) => ({
|
|
20
|
+
label: integration.integration,
|
|
21
|
+
href: integrationConsoleHref(integration),
|
|
22
|
+
hint: `v${integration.version}`
|
|
23
|
+
})),
|
|
24
|
+
...integrations.length > 0 ? { optionsLabel: "The integrations in this project" } : {},
|
|
25
|
+
action: home
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
function OperationNotFound({
|
|
30
|
+
kind,
|
|
31
|
+
name,
|
|
32
|
+
integration,
|
|
33
|
+
operationsHref
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
NotFoundState,
|
|
37
|
+
{
|
|
38
|
+
testId: "operation-not-found",
|
|
39
|
+
title: `No operation called \u201C${name}\u201D`,
|
|
40
|
+
description: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
41
|
+
"The ",
|
|
42
|
+
integration,
|
|
43
|
+
" contract declares no ",
|
|
44
|
+
kind,
|
|
45
|
+
" named",
|
|
46
|
+
" ",
|
|
47
|
+
/* @__PURE__ */ jsx("code", { className: "break-all", children: name }),
|
|
48
|
+
". Operations are renamed when the contract changes; search the list for the one you meant."
|
|
49
|
+
] }),
|
|
50
|
+
action: { label: "All operations", href: operationsHref }
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
IntegrationNotFound,
|
|
56
|
+
OperationNotFound
|
|
57
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
import { WidgetConfig } from '@ekanos/sdk';
|
|
2
3
|
import { type WidgetRenderState } from '@ekanos/sdk/components';
|
|
3
4
|
/**
|
|
@@ -5,8 +6,8 @@ import { type WidgetRenderState } from '@ekanos/sdk/components';
|
|
|
5
6
|
*
|
|
6
7
|
* WHAT CHANGED, and why it had to be a copy rather than an import:
|
|
7
8
|
*
|
|
8
|
-
* - REMOVED the
|
|
9
|
-
*
|
|
9
|
+
* - REMOVED the two server-action imports (`pinWidget`, `unpinWidget`).
|
|
10
|
+
* They are `'use server'` + `server-only` + Supabase,
|
|
10
11
|
* which is the entire reason the real file cannot be imported here.
|
|
11
12
|
*
|
|
12
13
|
* - SWAPPED the host's `DashboardWidgetProvider` for `HarnessWidgetProvider`,
|
|
@@ -22,6 +23,10 @@ import { type WidgetRenderState } from '@ekanos/sdk/components';
|
|
|
22
23
|
* `error`, even though the provider accepts all five. Without
|
|
23
24
|
* this the toolbar could not reach two of the five states at all.
|
|
24
25
|
*
|
|
26
|
+
* - ADDED `caption`, a line above each widget naming it for the developer
|
|
27
|
+
* (the harness's, not the product's), so the preview says which component
|
|
28
|
+
* is which.
|
|
29
|
+
*
|
|
25
30
|
* - ADDED a `WidgetBoundary` around each widget so one partner's crash
|
|
26
31
|
* renders a readable card instead of blanking the page.
|
|
27
32
|
*
|
|
@@ -37,10 +42,10 @@ interface DashboardGridProps {
|
|
|
37
42
|
layout?: DashboardGridLayout;
|
|
38
43
|
/** Forced render state from the dev toolbar. */
|
|
39
44
|
stateOverride?: WidgetRenderState;
|
|
40
|
-
/** Forced collapsed state from the dev toolbar. */
|
|
41
|
-
collapsedOverride?: boolean;
|
|
42
45
|
/** Remount key — changing it resets crashed widget boundaries. */
|
|
43
46
|
resetKey?: string;
|
|
47
|
+
/** A harness line above each widget. */
|
|
48
|
+
caption?: (widget: WidgetConfig) => ReactNode;
|
|
44
49
|
}
|
|
45
|
-
export declare function DashboardGrid({ widgets, accountId, layout, stateOverride,
|
|
50
|
+
export declare function DashboardGrid({ widgets, accountId, layout, stateOverride, resetKey, caption, }: DashboardGridProps): import("react").JSX.Element;
|
|
46
51
|
export {};
|
|
@@ -8,10 +8,10 @@ function DashboardGrid({
|
|
|
8
8
|
accountId,
|
|
9
9
|
layout = "masonry",
|
|
10
10
|
stateOverride,
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
resetKey,
|
|
12
|
+
caption
|
|
13
13
|
}) {
|
|
14
|
-
const shared = { accountId, stateOverride,
|
|
14
|
+
const shared = { accountId, stateOverride, resetKey, caption };
|
|
15
15
|
if (layout === "two-column") {
|
|
16
16
|
return /* @__PURE__ */ jsx("div", { className: "@container/dashboard grid grid-cols-1 items-start gap-5 @4xl/dashboard:grid-cols-2", children: widgets.map((widget) => /* @__PURE__ */ jsx(WidgetRenderer, { widget, ...shared }, widget.id)) });
|
|
17
17
|
}
|
|
@@ -55,12 +55,13 @@ function WidgetRenderer({
|
|
|
55
55
|
widget,
|
|
56
56
|
accountId,
|
|
57
57
|
stateOverride,
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
resetKey,
|
|
59
|
+
caption
|
|
60
60
|
}) {
|
|
61
61
|
const Component = widget.component;
|
|
62
62
|
const state = stateOverride ?? widget.widgetState;
|
|
63
|
-
return /* @__PURE__ */ jsxs("div", { children: [
|
|
63
|
+
return /* @__PURE__ */ jsxs("div", { className: "min-w-0", "data-test": "grid-widget", "data-widget-id": widget.id, children: [
|
|
64
|
+
caption ? caption(widget) : null,
|
|
64
65
|
state === "inactive" ? /* @__PURE__ */ jsxs(
|
|
65
66
|
"p",
|
|
66
67
|
{
|
|
@@ -80,9 +81,7 @@ function WidgetRenderer({
|
|
|
80
81
|
title: widget.name,
|
|
81
82
|
state,
|
|
82
83
|
isEnabled: state === "active",
|
|
83
|
-
isCollapsible: widget.isCollapsible ?? false,
|
|
84
84
|
isPinnable: widget.isPinnable ?? false,
|
|
85
|
-
defaultCollapsed: collapsedOverride ?? widget.collapsed ?? false,
|
|
86
85
|
defaultPinned: widget.isPinned ?? false,
|
|
87
86
|
maxContentHeight: getMaxContentHeight(widget),
|
|
88
87
|
aiFooterEnabled: widget.aiFooterEnabled,
|
|
@@ -95,7 +94,7 @@ function WidgetRenderer({
|
|
|
95
94
|
}
|
|
96
95
|
) })
|
|
97
96
|
},
|
|
98
|
-
`${state}-${
|
|
97
|
+
`${state}-${resetKey ?? ""}`
|
|
99
98
|
)
|
|
100
99
|
] });
|
|
101
100
|
}
|
|
@@ -1,15 +1,37 @@
|
|
|
1
|
+
import { type ToolbarControls } from '../lib/toolbar-visibility.js';
|
|
2
|
+
/** What each control simulates, for its help tooltip. */
|
|
3
|
+
export declare const CONTROL_HELP: {
|
|
4
|
+
readonly renderState: 'The state the dashboard hands every widget: active is normal; loading and error show those states; inactive is a widget not switched on for the account; disabled is one switched off or unhealthy. Check each draws something sensible.';
|
|
5
|
+
readonly data: 'Fixtures answer from recorded data. Live API calls the real service with your local credentials, for integrations that declare a live block.';
|
|
6
|
+
readonly variant: 'Which recorded fixtures answer the widgets: default data, empty (no rows) or error (every read fails).';
|
|
7
|
+
readonly viewport: 'Narrows the preview to a phone, tablet or desktop width. Widgets lay out by their container width, so this is the width they respond to.';
|
|
8
|
+
readonly unhealthy: "Simulates the integration's health check failing after it once succeeded. The dashboard then shows an active widget as disabled, as production does.";
|
|
9
|
+
};
|
|
1
10
|
/**
|
|
2
|
-
* The
|
|
3
|
-
*
|
|
11
|
+
* The preview controls. Every one drives the real machinery rather than a
|
|
12
|
+
* harness-local imitation:
|
|
4
13
|
*
|
|
5
|
-
* - Render state feeds
|
|
14
|
+
* - Render state feeds the dashboard provider's `state` prop, so you are
|
|
6
15
|
* exercising the actual state machine, including the `isEnabled` and health
|
|
7
16
|
* downgrades it computes internally.
|
|
8
|
-
* - Fixture
|
|
9
|
-
* - Collapsed feeds `defaultCollapsed`.
|
|
17
|
+
* - Fixture scenario rebuilds the QueryClient with a different seed set.
|
|
10
18
|
* - Unhealthy feeds `health`, reproducing the one production condition that
|
|
11
19
|
* silently downgrades an active widget to `disabled`.
|
|
12
20
|
*
|
|
13
21
|
* All choices persist to localStorage, so a reload keeps your place.
|
|
22
|
+
*
|
|
23
|
+
* `inline` is the widgets pages' bar, which sits directly above the grid and
|
|
24
|
+
* sticks while you scroll the widgets; otherwise it is the band at the top of
|
|
25
|
+
* a Preview surface (tile, activation form, triggers).
|
|
26
|
+
*/
|
|
27
|
+
export declare function PreviewControls({ controls, inline, }: {
|
|
28
|
+
controls?: ToolbarControls;
|
|
29
|
+
inline?: boolean;
|
|
30
|
+
}): import("react").JSX.Element;
|
|
31
|
+
/**
|
|
32
|
+
* The sticky strip at the top of every page: the slot a page portals its own
|
|
33
|
+
* top chrome into (the provenance banner), and the preview band on a Preview
|
|
34
|
+
* surface. The widgets pages draw their controls inline above the grid
|
|
35
|
+
* instead, next to what they control.
|
|
14
36
|
*/
|
|
15
37
|
export declare function DevToolbar(): import("react").JSX.Element;
|