@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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState } from "react";
|
|
3
|
+
import { useId, useState } from "react";
|
|
4
4
|
import { usePathname } from "next/navigation";
|
|
5
5
|
import { Button } from "@ekanos/ui/button";
|
|
6
|
+
import { Card } from "@ekanos/ui/card";
|
|
6
7
|
import { Icon } from "@ekanos/ui/icon";
|
|
7
|
-
import { Label } from "@ekanos/ui/label";
|
|
8
8
|
import {
|
|
9
9
|
Select,
|
|
10
10
|
SelectContent,
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
SelectValue
|
|
14
14
|
} from "@ekanos/ui/select";
|
|
15
15
|
import { Switch } from "@ekanos/ui/switch";
|
|
16
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "@ekanos/ui/tooltip";
|
|
16
17
|
import { cn } from "@ekanos/ui/utils";
|
|
17
|
-
import { useTheme } from "next-themes";
|
|
18
18
|
import {
|
|
19
19
|
DATA_MODES,
|
|
20
20
|
FIXTURE_VARIANTS,
|
|
@@ -24,25 +24,55 @@ import {
|
|
|
24
24
|
supportsLiveMode
|
|
25
25
|
} from "../../registry.js";
|
|
26
26
|
import { setChromeSlot } from "../lib/chrome-slot.js";
|
|
27
|
-
import { HARNESS_DOCS_URL } from "../lib/docs-links.js";
|
|
28
|
-
import { getThemeToggleAccessibleLabel } from "../lib/theme-toggle.js";
|
|
29
27
|
import {
|
|
30
28
|
RENDER_STATES,
|
|
31
29
|
VIEWPORTS,
|
|
32
30
|
useRepoMode,
|
|
33
31
|
useToolbar
|
|
34
32
|
} from "../lib/toolbar-context.js";
|
|
35
|
-
import {
|
|
33
|
+
import {
|
|
34
|
+
rendersInlineControls,
|
|
35
|
+
toolbarControlsFor
|
|
36
|
+
} from "../lib/toolbar-visibility.js";
|
|
36
37
|
import { useHarnessRegistry } from "../registry-context.js";
|
|
37
|
-
import { DocsLink } from "./docs-link.js";
|
|
38
38
|
import { FOCUS_RING } from "./scrollable-nav.js";
|
|
39
|
+
import { SegmentedControl } from "./segmented-control.js";
|
|
40
|
+
const CONTROL_HELP = {
|
|
41
|
+
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.",
|
|
42
|
+
data: "Fixtures answer from recorded data. Live API calls the real service with your local credentials, for integrations that declare a live block.",
|
|
43
|
+
variant: "Which recorded fixtures answer the widgets: default data, empty (no rows) or error (every read fails).",
|
|
44
|
+
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.",
|
|
45
|
+
unhealthy: "Simulates the integration's health check failing after it once succeeded. The dashboard then shows an active widget as disabled, as production does."
|
|
46
|
+
};
|
|
47
|
+
function HelpTip({ label, help }) {
|
|
48
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
49
|
+
/* @__PURE__ */ jsx(
|
|
50
|
+
TooltipTrigger,
|
|
51
|
+
{
|
|
52
|
+
className: cn(
|
|
53
|
+
"text-muted-foreground hover:text-foreground inline-flex size-5 items-center justify-center rounded-full",
|
|
54
|
+
FOCUS_RING
|
|
55
|
+
),
|
|
56
|
+
"aria-label": `What ${label} does`,
|
|
57
|
+
"data-test": "toolbar-help",
|
|
58
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "info", className: "h-3.5 w-3.5" })
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ jsx(TooltipContent, { className: "max-w-xs", children: help })
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
39
64
|
function Field({
|
|
40
65
|
label,
|
|
66
|
+
help,
|
|
41
67
|
children
|
|
42
68
|
}) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
children
|
|
69
|
+
const id = useId();
|
|
70
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
71
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-0.5", children: [
|
|
72
|
+
/* @__PURE__ */ jsx("span", { id, className: "text-muted-foreground text-xs font-medium", children: label }),
|
|
73
|
+
/* @__PURE__ */ jsx(HelpTip, { label, help })
|
|
74
|
+
] }),
|
|
75
|
+
children(id)
|
|
46
76
|
] });
|
|
47
77
|
}
|
|
48
78
|
const DATA_MODE_LABELS = {
|
|
@@ -51,198 +81,206 @@ const DATA_MODE_LABELS = {
|
|
|
51
81
|
};
|
|
52
82
|
function useCurrentIntegration() {
|
|
53
83
|
const integrations = useHarnessRegistry();
|
|
54
|
-
const pathname = usePathname();
|
|
55
|
-
const
|
|
84
|
+
const pathname = usePathname() ?? "";
|
|
85
|
+
const segments = pathname.split("/").filter(Boolean);
|
|
86
|
+
const slug = segments[0] === "integrations" ? segments[1] : segments[0] ?? null;
|
|
56
87
|
return slug ? findIntegration(integrations, slug) : null;
|
|
57
88
|
}
|
|
58
|
-
function
|
|
89
|
+
function PreviewControls({
|
|
90
|
+
controls = { widget: true, data: true },
|
|
91
|
+
inline = false
|
|
92
|
+
}) {
|
|
59
93
|
const { state, setState, reset } = useToolbar();
|
|
60
94
|
const repo = useRepoMode();
|
|
61
|
-
const { resolvedTheme, setTheme } = useTheme();
|
|
62
95
|
const integration = useCurrentIntegration();
|
|
63
96
|
const liveAvailable = supportsLiveMode(integration);
|
|
64
97
|
const effectiveMode = resolveEffectiveDataMode(integration, state.dataMode);
|
|
65
98
|
const live = liveAvailable && effectiveMode === "live";
|
|
66
|
-
const pathname = usePathname();
|
|
67
|
-
const controls = toolbarControlsFor(pathname);
|
|
68
|
-
const hasControls = controls.widget || controls.data;
|
|
69
99
|
const [open, setOpen] = useState(false);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
100
|
+
const panelId = useId();
|
|
101
|
+
const bar = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
102
|
+
/* @__PURE__ */ jsxs(
|
|
103
|
+
Button,
|
|
104
|
+
{
|
|
105
|
+
type: "button",
|
|
106
|
+
size: "sm",
|
|
107
|
+
variant: "outline",
|
|
108
|
+
className: "md:hidden",
|
|
109
|
+
"aria-expanded": open,
|
|
110
|
+
"aria-controls": panelId,
|
|
111
|
+
onClick: () => setOpen((value) => !value),
|
|
112
|
+
"data-test": "toolbar-controls-toggle",
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ jsx(Icon, { name: "sliders-horizontal", className: "h-4 w-4" }),
|
|
115
|
+
open ? "Hide controls" : "Preview controls"
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
/* @__PURE__ */ jsxs(
|
|
120
|
+
"div",
|
|
121
|
+
{
|
|
122
|
+
id: panelId,
|
|
123
|
+
className: cn(
|
|
124
|
+
"order-last w-full flex-wrap items-center gap-x-4 gap-y-3 md:order-none md:flex md:w-auto md:flex-1",
|
|
125
|
+
open ? "flex" : "hidden"
|
|
126
|
+
),
|
|
127
|
+
"data-test": "toolbar-controls",
|
|
128
|
+
children: [
|
|
129
|
+
controls.widget ? /* @__PURE__ */ jsx(Field, { label: "Render state", help: CONTROL_HELP.renderState, children: (labelId) => /* @__PURE__ */ jsxs(
|
|
130
|
+
Select,
|
|
80
131
|
{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"aria-expanded": open,
|
|
86
|
-
"aria-controls": "toolbar-controls",
|
|
87
|
-
onClick: () => setOpen((value) => !value),
|
|
88
|
-
"data-test": "toolbar-controls-toggle",
|
|
89
|
-
children: open ? "Hide controls" : "Preview controls"
|
|
90
|
-
}
|
|
91
|
-
) : null,
|
|
92
|
-
hasControls ? /* @__PURE__ */ jsxs(
|
|
93
|
-
"div",
|
|
94
|
-
{
|
|
95
|
-
id: "toolbar-controls",
|
|
96
|
-
className: cn(
|
|
97
|
-
"order-last w-full flex-wrap items-end gap-5 md:order-none md:flex md:w-auto",
|
|
98
|
-
open ? "flex" : "hidden"
|
|
99
|
-
),
|
|
100
|
-
"data-test": "toolbar-controls",
|
|
132
|
+
value: state.renderState,
|
|
133
|
+
onValueChange: (value) => setState({
|
|
134
|
+
renderState: value
|
|
135
|
+
}),
|
|
101
136
|
children: [
|
|
102
|
-
|
|
103
|
-
|
|
137
|
+
/* @__PURE__ */ jsx(
|
|
138
|
+
SelectTrigger,
|
|
104
139
|
{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
children:
|
|
110
|
-
/* @__PURE__ */ jsx(
|
|
111
|
-
SelectTrigger,
|
|
112
|
-
{
|
|
113
|
-
className: "w-36",
|
|
114
|
-
"data-test": "toolbar-render-state",
|
|
115
|
-
children: /* @__PURE__ */ jsx(SelectValue, {})
|
|
116
|
-
}
|
|
117
|
-
),
|
|
118
|
-
/* @__PURE__ */ jsx(SelectContent, { children: RENDER_STATES.map((value) => /* @__PURE__ */ jsx(SelectItem, { value, children: value }, value)) })
|
|
119
|
-
]
|
|
140
|
+
size: "sm",
|
|
141
|
+
className: "w-24",
|
|
142
|
+
"aria-labelledby": labelId,
|
|
143
|
+
"data-test": "toolbar-render-state",
|
|
144
|
+
children: /* @__PURE__ */ jsx(SelectValue, {})
|
|
120
145
|
}
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
|
|
146
|
+
),
|
|
147
|
+
/* @__PURE__ */ jsx(SelectContent, { children: RENDER_STATES.map((value) => /* @__PURE__ */ jsx(SelectItem, { value, children: value }, value)) })
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
) }) : null,
|
|
151
|
+
controls.data && !repo && integration ? /* @__PURE__ */ jsx(Field, { label: "Data", help: CONTROL_HELP.data, children: (labelId) => /* @__PURE__ */ jsxs(
|
|
152
|
+
Select,
|
|
153
|
+
{
|
|
154
|
+
value: effectiveMode,
|
|
155
|
+
onValueChange: (value) => setState({ dataMode: value }),
|
|
156
|
+
disabled: !liveAvailable,
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ jsx(
|
|
159
|
+
SelectTrigger,
|
|
124
160
|
{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
SelectTrigger,
|
|
131
|
-
{
|
|
132
|
-
className: "w-32",
|
|
133
|
-
"data-test": "toolbar-data-mode",
|
|
134
|
-
children: /* @__PURE__ */ jsx(SelectValue, {})
|
|
135
|
-
}
|
|
136
|
-
),
|
|
137
|
-
/* @__PURE__ */ jsx(SelectContent, { children: DATA_MODES.map((value) => /* @__PURE__ */ jsx(SelectItem, { value, children: DATA_MODE_LABELS[value] }, value)) })
|
|
138
|
-
]
|
|
161
|
+
size: "sm",
|
|
162
|
+
className: "w-24",
|
|
163
|
+
"aria-labelledby": labelId,
|
|
164
|
+
"data-test": "toolbar-data-mode",
|
|
165
|
+
children: /* @__PURE__ */ jsx(SelectValue, {})
|
|
139
166
|
}
|
|
140
|
-
)
|
|
141
|
-
|
|
142
|
-
/* @__PURE__ */ jsx(Field, { label: "Fixture scenario", children: /* @__PURE__ */ jsxs(
|
|
143
|
-
Select,
|
|
144
|
-
{
|
|
145
|
-
value: state.variant,
|
|
146
|
-
onValueChange: (value) => setState({ variant: value }),
|
|
147
|
-
disabled: live,
|
|
148
|
-
children: [
|
|
149
|
-
/* @__PURE__ */ jsx(SelectTrigger, { className: "w-32", "data-test": "toolbar-variant", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
150
|
-
/* @__PURE__ */ jsx(SelectContent, { children: FIXTURE_VARIANTS.map((value) => /* @__PURE__ */ jsx(SelectItem, { value, children: value }, value)) })
|
|
151
|
-
]
|
|
152
|
-
}
|
|
153
|
-
) }),
|
|
154
|
-
/* @__PURE__ */ jsx(Field, { label: "Viewport", children: /* @__PURE__ */ jsx("div", { className: "flex gap-1", children: Object.keys(VIEWPORTS).map((key) => /* @__PURE__ */ jsx(
|
|
155
|
-
Button,
|
|
156
|
-
{
|
|
157
|
-
size: "sm",
|
|
158
|
-
variant: state.viewport === key ? "default" : "outline",
|
|
159
|
-
onClick: () => setState({ viewport: key }),
|
|
160
|
-
children: VIEWPORTS[key].label
|
|
161
|
-
},
|
|
162
|
-
key
|
|
163
|
-
)) }) }),
|
|
164
|
-
/* @__PURE__ */ jsx(Field, { label: "Collapsed", children: /* @__PURE__ */ jsx(
|
|
165
|
-
Switch,
|
|
166
|
-
{
|
|
167
|
-
checked: state.collapsed,
|
|
168
|
-
onCheckedChange: (checked) => setState({ collapsed: checked }),
|
|
169
|
-
"aria-label": "Toggle collapsed"
|
|
170
|
-
}
|
|
171
|
-
) }),
|
|
172
|
-
/* @__PURE__ */ jsx(Field, { label: "Unhealthy", children: /* @__PURE__ */ jsx(
|
|
173
|
-
Switch,
|
|
174
|
-
{
|
|
175
|
-
checked: state.unhealthy,
|
|
176
|
-
onCheckedChange: (checked) => setState({ unhealthy: checked }),
|
|
177
|
-
"aria-label": "Simulate unhealthy integration"
|
|
178
|
-
}
|
|
179
|
-
) })
|
|
180
|
-
] }) : null
|
|
167
|
+
),
|
|
168
|
+
/* @__PURE__ */ jsx(SelectContent, { children: DATA_MODES.map((value) => /* @__PURE__ */ jsx(SelectItem, { value, children: DATA_MODE_LABELS[value] }, value)) })
|
|
181
169
|
]
|
|
182
170
|
}
|
|
183
|
-
) : null,
|
|
184
|
-
/* @__PURE__ */ jsxs(
|
|
185
|
-
/* @__PURE__ */ jsx(
|
|
186
|
-
|
|
171
|
+
) }) : null,
|
|
172
|
+
controls.widget ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
173
|
+
/* @__PURE__ */ jsx(Field, { label: "Scenario", help: CONTROL_HELP.variant, children: (labelId) => /* @__PURE__ */ jsxs(
|
|
174
|
+
Select,
|
|
187
175
|
{
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
children: "Docs"
|
|
192
|
-
}
|
|
193
|
-
),
|
|
194
|
-
live && controls.data ? /* @__PURE__ */ jsxs(
|
|
195
|
-
"span",
|
|
196
|
-
{
|
|
197
|
-
className: "text-primary flex items-center gap-2 text-sm font-medium",
|
|
198
|
-
"data-test": "toolbar-live-badge",
|
|
199
|
-
children: [
|
|
200
|
-
/* @__PURE__ */ jsx(Icon, { name: "broadcast", className: "h-4 w-4" }),
|
|
201
|
-
"Reaching ",
|
|
202
|
-
resolveEgress(integration).join(", ")
|
|
203
|
-
]
|
|
204
|
-
}
|
|
205
|
-
) : null,
|
|
206
|
-
/* @__PURE__ */ jsxs(
|
|
207
|
-
Button,
|
|
208
|
-
{
|
|
209
|
-
size: "sm",
|
|
210
|
-
variant: "outline",
|
|
211
|
-
onClick: () => setTheme(resolvedTheme === "dark" ? "light" : "dark"),
|
|
212
|
-
"aria-label": getThemeToggleAccessibleLabel(resolvedTheme),
|
|
176
|
+
value: state.variant,
|
|
177
|
+
onValueChange: (value) => setState({ variant: value }),
|
|
178
|
+
disabled: live,
|
|
213
179
|
children: [
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
-
|
|
180
|
+
/* @__PURE__ */ jsx(
|
|
181
|
+
SelectTrigger,
|
|
216
182
|
{
|
|
217
|
-
|
|
218
|
-
className:
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
]
|
|
183
|
+
size: "sm",
|
|
184
|
+
className: "w-24",
|
|
185
|
+
"aria-labelledby": labelId,
|
|
186
|
+
"data-test": "toolbar-variant",
|
|
187
|
+
children: /* @__PURE__ */ jsx(SelectValue, {})
|
|
223
188
|
}
|
|
224
189
|
),
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
-
"span",
|
|
227
|
-
{
|
|
228
|
-
"aria-hidden": "true",
|
|
229
|
-
className: cn("hidden items-center dark:flex"),
|
|
230
|
-
children: [
|
|
231
|
-
/* @__PURE__ */ jsx(Icon, { name: "sun", className: "mr-2 h-4 w-4" }),
|
|
232
|
-
"Light"
|
|
233
|
-
]
|
|
234
|
-
}
|
|
235
|
-
)
|
|
190
|
+
/* @__PURE__ */ jsx(SelectContent, { children: FIXTURE_VARIANTS.map((value) => /* @__PURE__ */ jsx(SelectItem, { value, children: value }, value)) })
|
|
236
191
|
]
|
|
237
192
|
}
|
|
238
|
-
),
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
193
|
+
) }),
|
|
194
|
+
/* @__PURE__ */ jsx(Field, { label: "Viewport", help: CONTROL_HELP.viewport, children: () => /* @__PURE__ */ jsx(
|
|
195
|
+
SegmentedControl,
|
|
196
|
+
{
|
|
197
|
+
label: "Viewport",
|
|
198
|
+
testPrefix: "toolbar-viewport",
|
|
199
|
+
value: state.viewport,
|
|
200
|
+
onChange: (viewport) => setState({ viewport }),
|
|
201
|
+
options: Object.keys(VIEWPORTS).map(
|
|
202
|
+
(key) => ({ value: key, label: VIEWPORTS[key].label })
|
|
203
|
+
)
|
|
204
|
+
}
|
|
205
|
+
) }),
|
|
206
|
+
/* @__PURE__ */ jsx(Field, { label: "Unhealthy", help: CONTROL_HELP.unhealthy, children: (labelId) => /* @__PURE__ */ jsx(
|
|
207
|
+
Switch,
|
|
208
|
+
{
|
|
209
|
+
checked: state.unhealthy,
|
|
210
|
+
onCheckedChange: (checked) => setState({ unhealthy: checked }),
|
|
211
|
+
"aria-labelledby": labelId,
|
|
212
|
+
"data-test": "toolbar-unhealthy"
|
|
213
|
+
}
|
|
214
|
+
) })
|
|
215
|
+
] }) : null
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
/* @__PURE__ */ jsxs("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
220
|
+
live && controls.data ? /* @__PURE__ */ jsxs(
|
|
221
|
+
"span",
|
|
222
|
+
{
|
|
223
|
+
className: "text-primary flex items-center gap-2 text-sm font-medium",
|
|
224
|
+
"data-test": "toolbar-live-badge",
|
|
225
|
+
children: [
|
|
226
|
+
/* @__PURE__ */ jsx(Icon, { name: "broadcast", className: "h-4 w-4" }),
|
|
227
|
+
"Reaching ",
|
|
228
|
+
resolveEgress(integration).join(", ")
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
) : null,
|
|
232
|
+
/* @__PURE__ */ jsxs(
|
|
233
|
+
Button,
|
|
234
|
+
{
|
|
235
|
+
size: "sm",
|
|
236
|
+
variant: "ghost",
|
|
237
|
+
onClick: reset,
|
|
238
|
+
title: "Put every preview control back to its default",
|
|
239
|
+
"aria-label": "Reset preview controls",
|
|
240
|
+
"data-test": "toolbar-reset",
|
|
241
|
+
children: [
|
|
242
|
+
/* @__PURE__ */ jsx(Icon, { name: "arrow-counter-clockwise", className: "h-4 w-4" }),
|
|
243
|
+
inline ? null : "Reset"
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
] })
|
|
248
|
+
] });
|
|
249
|
+
const shared = {
|
|
250
|
+
role: "toolbar",
|
|
251
|
+
"aria-label": "Preview controls",
|
|
252
|
+
className: "flex flex-wrap items-center gap-x-4 gap-y-3"
|
|
253
|
+
};
|
|
254
|
+
return inline ? /* @__PURE__ */ jsx(
|
|
255
|
+
Card,
|
|
256
|
+
{
|
|
257
|
+
layout: "bleed",
|
|
258
|
+
...shared,
|
|
259
|
+
className: cn(shared.className, "sticky top-2 z-20 flex-row px-3 py-2"),
|
|
260
|
+
"data-test": "preview-controls",
|
|
261
|
+
children: bar
|
|
262
|
+
}
|
|
263
|
+
) : /* @__PURE__ */ jsx(
|
|
264
|
+
"div",
|
|
265
|
+
{
|
|
266
|
+
...shared,
|
|
267
|
+
className: cn(shared.className, "bg-card border-b px-4 py-3 sm:px-6"),
|
|
268
|
+
"data-test": "toolbar-band",
|
|
269
|
+
children: bar
|
|
243
270
|
}
|
|
244
271
|
);
|
|
245
272
|
}
|
|
273
|
+
function DevToolbar() {
|
|
274
|
+
const pathname = usePathname() ?? "/";
|
|
275
|
+
const controls = toolbarControlsFor(pathname);
|
|
276
|
+
const band = (controls.widget || controls.data) && !rendersInlineControls(pathname);
|
|
277
|
+
return /* @__PURE__ */ jsxs("div", { className: "bg-card z-40 md:sticky md:top-0", "data-test": "sticky-chrome", children: [
|
|
278
|
+
/* @__PURE__ */ jsx("div", { ref: setChromeSlot, "data-test": "chrome-slot" }),
|
|
279
|
+
band ? /* @__PURE__ */ jsx(PreviewControls, { controls }) : null
|
|
280
|
+
] });
|
|
281
|
+
}
|
|
246
282
|
export {
|
|
247
|
-
|
|
283
|
+
CONTROL_HELP,
|
|
284
|
+
DevToolbar,
|
|
285
|
+
PreviewControls
|
|
248
286
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The logo's lowercase e in white on a tile of its gradient. The e carries a
|
|
3
|
+
* stroke of its own fill so the hairline holds at small sizes.
|
|
4
|
+
*/
|
|
5
|
+
export declare function EkanosMark({ className }: {
|
|
6
|
+
className?: string;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* The wordmark in the current text colour. Its strokes are hairlines, so it
|
|
10
|
+
* takes a stroke of its own fill to stay legible at header size.
|
|
11
|
+
*/
|
|
12
|
+
export declare function EkanosWordmark({ className }: {
|
|
13
|
+
className?: string;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
/** The logo as the way home: the mark always, the wordmark beside it from `sm`. */
|
|
16
|
+
export declare function EkanosHomeLink({ className }: {
|
|
17
|
+
className?: string;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Link from "next/link";
|
|
3
|
+
import { cn } from "@ekanos/ui/utils";
|
|
4
|
+
import { FOCUS_RING } from "./scrollable-nav.js";
|
|
5
|
+
const E_PATH = "M12.33,35.86c0-8.12,5.95-14.07,14.4-14.07s14.34,5.95,14.34,14.07v.11H13.79c.05,7.25,5.2,12.66,12.93,12.66,5.47,0,9.69-2.71,11.69-6.93h1.52c-2.06,4.98-6.93,8.23-13.21,8.23-8.44,0-14.4-5.95-14.4-14.07ZM39.6,34.67c-.54-6.71-5.57-11.58-12.88-11.58s-12.39,4.87-12.93,11.58h25.82Z";
|
|
6
|
+
const WORDMARK_REST = "M44.45,10.8h1.41v24.08l17.43-12.39h2.22l-18.02,12.88,18.62,13.86h-2.27l-17.97-13.37v13.37h-1.41V10.8ZM64.54,35.86c0-8.12,5.95-14.07,14.4-14.07s14.34,5.9,14.34,14.18v13.26h-1.35v-7.58c-2.22,5.3-6.98,8.28-13.04,8.28-8.39,0-14.34-5.95-14.34-14.07ZM91.88,35.86c0-7.31-5.2-12.77-12.94-12.77s-12.94,5.47-12.94,12.77,5.2,12.77,12.94,12.77,12.94-5.47,12.94-12.77ZM96.66,35.21c0-8.82,5.3-13.42,13.21-13.42s13.21,4.6,13.21,13.42v14.02h-1.41v-14.02c0-7.74-4.66-12.12-11.8-12.12s-11.8,4.38-11.8,12.12v14.02h-1.41v-14.02ZM126.34,35.86c0-8.12,5.95-14.07,14.4-14.07s14.4,5.95,14.4,14.07-5.95,14.07-14.4,14.07-14.4-5.95-14.4-14.07ZM153.67,35.86c0-7.31-5.2-12.77-12.94-12.77s-12.94,5.47-12.94,12.77,5.2,12.77,12.94,12.77,12.94-5.47,12.94-12.77ZM157.58,41.98h1.41c.16,3.9,3.73,6.71,9.31,6.71s9.15-2.92,9.15-6.87c0-4.44-4.38-4.87-9.04-5.41-4.93-.54-10.12-1.14-10.12-6.6,0-4.87,4.06-8.01,9.9-8.01s9.8,3.3,9.9,7.69h-1.41c-.11-3.84-3.3-6.39-8.5-6.39s-8.44,2.6-8.44,6.55c0,4.55,4.38,4.93,9.04,5.47,4.93.54,10.12,1.14,10.12,6.55,0,4.82-4.17,8.28-10.66,8.28s-10.5-3.41-10.66-7.96Z";
|
|
7
|
+
const LOGO_GRADIENT = "[background-image:linear-gradient(to_top_in_oklab,oklch(0.603_0.2347_26.99)_0%,oklch(0.5727_0.1707_21.07)_23%,oklch(0.6043_0.0435_4.7)_59%,oklch(0.6596_0.0336_211.63)_85%,oklch(0.687_0.0565_204.87)_100%)]";
|
|
8
|
+
function EkanosMark({ className }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
"svg",
|
|
11
|
+
{
|
|
12
|
+
viewBox: "0 0 24 24",
|
|
13
|
+
"aria-hidden": "true",
|
|
14
|
+
focusable: "false",
|
|
15
|
+
className: cn("size-7 shrink-0 rounded-md", LOGO_GRADIENT, className),
|
|
16
|
+
children: /* @__PURE__ */ jsx(
|
|
17
|
+
"path",
|
|
18
|
+
{
|
|
19
|
+
transform: "translate(-0.07 -4.21) scale(0.452)",
|
|
20
|
+
fill: "oklch(1 0 0)",
|
|
21
|
+
stroke: "oklch(1 0 0)",
|
|
22
|
+
strokeWidth: "1.6",
|
|
23
|
+
strokeLinejoin: "round",
|
|
24
|
+
d: E_PATH
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
function EkanosWordmark({ className }) {
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
"svg",
|
|
33
|
+
{
|
|
34
|
+
viewBox: "12.3 10.8 166 39.2",
|
|
35
|
+
"aria-hidden": "true",
|
|
36
|
+
focusable: "false",
|
|
37
|
+
className: cn("h-5 w-auto shrink-0", className),
|
|
38
|
+
children: /* @__PURE__ */ jsx(
|
|
39
|
+
"path",
|
|
40
|
+
{
|
|
41
|
+
fill: "currentColor",
|
|
42
|
+
stroke: "currentColor",
|
|
43
|
+
strokeWidth: "0.9",
|
|
44
|
+
strokeLinejoin: "round",
|
|
45
|
+
d: `${E_PATH}${WORDMARK_REST}`
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
function EkanosHomeLink({ className }) {
|
|
52
|
+
return /* @__PURE__ */ jsxs(
|
|
53
|
+
Link,
|
|
54
|
+
{
|
|
55
|
+
href: "/",
|
|
56
|
+
"aria-label": "Ekanos harness home",
|
|
57
|
+
"data-test": "header-logo",
|
|
58
|
+
className: cn(
|
|
59
|
+
"text-foreground flex shrink-0 items-center gap-2 rounded-md",
|
|
60
|
+
FOCUS_RING,
|
|
61
|
+
className
|
|
62
|
+
),
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsx(EkanosMark, {}),
|
|
65
|
+
/* @__PURE__ */ jsx(EkanosWordmark, { className: "hidden sm:block" })
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
EkanosHomeLink,
|
|
72
|
+
EkanosMark,
|
|
73
|
+
EkanosWordmark
|
|
74
|
+
};
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import type { ConsoleEvent, ConsoleIntegration } from '../lib/console-types.js';
|
|
2
|
+
/** An integration with no events: say what an event is and where to go instead. */
|
|
3
|
+
export declare function NoEvents({ integration, operationsHref, }: {
|
|
4
|
+
integration: string;
|
|
5
|
+
operationsHref: string;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
2
7
|
/**
|
|
3
|
-
*
|
|
4
|
-
* Fixtures mode validates the payload and lists the
|
|
5
|
-
*
|
|
8
|
+
* Send a test event: pick one of the contract's events, edit its payload,
|
|
9
|
+
* send it. Fixtures mode validates the payload and lists the workflows that
|
|
10
|
+
* start on it; live mode also runs the integration's own webhook handler.
|
|
6
11
|
*/
|
|
7
|
-
export declare function EventsPanel({ integration, events, }: {
|
|
12
|
+
export declare function EventsPanel({ integration, events, base, initialEvent, }: {
|
|
8
13
|
integration: ConsoleIntegration;
|
|
9
14
|
events: ConsoleEvent[];
|
|
15
|
+
/** This integration's console, for links into its run log and operations. */
|
|
16
|
+
base: string;
|
|
17
|
+
/** Event name to open with (`?event=`). */
|
|
18
|
+
initialEvent?: string | null;
|
|
10
19
|
}): import("react").JSX.Element | null;
|