@parhelia/alpaca 0.4.12884 → 0.4.13030
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/componentCommands.js +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -47
- package/dist/tracing/components/TracingTitlebar.d.ts.map +1 -1
- package/dist/tracing/components/TracingTitlebar.js +13 -7
- package/package.json +1 -5
- package/dist/GraphQL.d.ts +0 -2
- package/dist/GraphQL.d.ts.map +0 -1
- package/dist/GraphQL.js +0 -200
- package/dist/GraphiQLPanel.d.ts +0 -15
- package/dist/GraphiQLPanel.d.ts.map +0 -1
- package/dist/GraphiQLPanel.js +0 -207
- package/dist/Layout.d.ts +0 -2
- package/dist/Layout.d.ts.map +0 -1
- package/dist/Layout.js +0 -67
- package/dist/graphqlService.d.ts +0 -77
- package/dist/graphqlService.d.ts.map +0 -1
- package/dist/graphqlService.js +0 -518
- package/dist/services.d.ts +0 -3
- package/dist/services.d.ts.map +0 -1
- package/dist/services.js +0 -10
|
@@ -43,8 +43,12 @@ async function getCheckboxCommand(components, editContext, fieldName, label) {
|
|
|
43
43
|
const items = await editContext.itemsRepository.getItems(datasourceItems);
|
|
44
44
|
if (!items.length)
|
|
45
45
|
return null;
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
// W12 phase 3 (fecanon lane): a routed read carries the canonical "true" (payload
|
|
47
|
+
// `canonical: true`), an old-route read the checkbox's "1"; both mean checked. The save below
|
|
48
|
+
// keeps posting the store's own "1"/"" unmarked, which both backends still accept.
|
|
49
|
+
const isChecked = (raw) => raw === "1" || (raw ?? "").toLowerCase() === "true";
|
|
50
|
+
const someLinked = items.some((item) => isChecked(item.fields.find((field) => field.name === fieldName)?.rawValue));
|
|
51
|
+
const allLinked = items.every((item) => isChecked(item.fields.find((field) => field.name === fieldName)?.rawValue));
|
|
48
52
|
return {
|
|
49
53
|
id: fieldName,
|
|
50
54
|
icon: allLinked ? (_jsx(Check, { strokeWidth: 1, size: defaultIconSize })) : someLinked ? (_jsx(StopCircle, { strokeWidth: 1, size: defaultIconSize })) : (_jsx(Square, { strokeWidth: 1, size: defaultIconSize })),
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EAGpB,MAAM,gBAAgB,CAAC;AAuBxB,eAAO,MAAM,2BAA2B,mBAAmB,CAAC;AAC5D,eAAO,MAAM,+BAA+B,yBAAyB,CAAC;AAkCtE;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,mBAAmB,uBAoBxE;AAED,wBAAgB,eAAe,CAAC,aAAa,EAAE,mBAAmB,uBAqBjE;AAED,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,mBAAmB,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,53 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { lazy, Suspense } from "react";
|
|
3
|
-
import { Activity,
|
|
4
|
-
import { GraphQLIcon, JsonIcon, } from "@parhelia/core";
|
|
5
|
-
import { Layout } from "./Layout";
|
|
3
|
+
import { Activity, Waypoints } from "lucide-react";
|
|
6
4
|
import { alpacaComponentCommandProvider } from "./componentCommands";
|
|
7
5
|
import { TracingTitlebar } from "./tracing/components/TracingTitlebar";
|
|
8
6
|
import { TraceSourcesSidebar } from "./tracing/components/TraceSourcesSidebar";
|
|
9
|
-
const GraphQL = lazy(() => import("./GraphQL").then((module) => ({ default: module.GraphQL })));
|
|
10
|
-
function LazyGraphQLPanel() {
|
|
11
|
-
return (_jsx(Suspense, { fallback: _jsx("div", { className: "p-4 text-sm text-muted-foreground", children: "Loading GraphQL editor..." }), children: _jsx(GraphQL, {}) }));
|
|
12
|
-
}
|
|
13
7
|
const TracingWorkspaceComponent = lazy(() => import("./tracing/components/TracingWorkspace").then((module) => ({
|
|
14
8
|
default: module.TracingWorkspace,
|
|
15
9
|
})));
|
|
16
10
|
function LazyTracingWorkspace() {
|
|
17
11
|
return (_jsx(Suspense, { fallback: _jsx("div", { className: "p-4 text-sm text-muted-foreground", children: "Loading tracing\u2026" }), children: _jsx(TracingWorkspaceComponent, {}) }));
|
|
18
12
|
}
|
|
19
|
-
const layoutDebugSidebar = {
|
|
20
|
-
id: "layout",
|
|
21
|
-
title: "Layout",
|
|
22
|
-
icon: _jsx(PanelsTopLeft, { strokeWidth: 1 }),
|
|
23
|
-
position: "left",
|
|
24
|
-
sortOrder: 100,
|
|
25
|
-
panels: [
|
|
26
|
-
{
|
|
27
|
-
name: "layout",
|
|
28
|
-
icon: _jsx(JsonIcon, {}),
|
|
29
|
-
title: "Layout",
|
|
30
|
-
content: _jsx(Layout, {}),
|
|
31
|
-
initialSize: 100,
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
};
|
|
35
|
-
const graphqlSidebar = {
|
|
36
|
-
id: "graphql",
|
|
37
|
-
title: "GraphQL",
|
|
38
|
-
icon: _jsx(GraphQLIcon, {}),
|
|
39
|
-
position: "left",
|
|
40
|
-
sortOrder: 101,
|
|
41
|
-
panels: [
|
|
42
|
-
{
|
|
43
|
-
name: "graphql",
|
|
44
|
-
icon: _jsx(GraphQLIcon, {}),
|
|
45
|
-
title: "GraphQL",
|
|
46
|
-
content: _jsx(LazyGraphQLPanel, {}),
|
|
47
|
-
initialSize: 100,
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
};
|
|
51
13
|
export const ALPACA_TRACING_WORKSPACE_ID = "alpaca-tracing";
|
|
52
14
|
export const ALPACA_TRACE_SOURCES_SIDEBAR_ID = "alpaca-trace-sources";
|
|
53
15
|
const traceSourcesSidebar = {
|
|
@@ -102,16 +64,11 @@ export function configureAlpacaTracing(configuration) {
|
|
|
102
64
|
}
|
|
103
65
|
export function configureAlpaca(configuration) {
|
|
104
66
|
const sidebars = (configuration.editor?.sidebars || []).filter((s) => s.id !== "debug");
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const nextSidebars = [...sidebars];
|
|
108
|
-
if (!hasLayoutDebugSidebar)
|
|
109
|
-
nextSidebars.push(layoutDebugSidebar);
|
|
110
|
-
if (!hasGraphqlSidebar)
|
|
111
|
-
nextSidebars.push(graphqlSidebar);
|
|
67
|
+
// cf-panels (DevOps 8651 / 8652): the Layout and GraphQL panels are the core editor's now, driven by the page's store's
|
|
68
|
+
// capabilities on every host.
|
|
112
69
|
configuration.editor = {
|
|
113
70
|
...configuration.editor,
|
|
114
|
-
sidebars
|
|
71
|
+
sidebars,
|
|
115
72
|
};
|
|
116
73
|
const componentCommandProviders = configuration.componentCommands?.providers ?? [];
|
|
117
74
|
if (!componentCommandProviders.includes(alpacaComponentCommandProvider)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TracingTitlebar.d.ts","sourceRoot":"","sources":["../../../src/tracing/components/TracingTitlebar.tsx"],"names":[],"mappings":"AAwBA,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"TracingTitlebar.d.ts","sourceRoot":"","sources":["../../../src/tracing/components/TracingTitlebar.tsx"],"names":[],"mappings":"AAwBA,wBAAgB,eAAe,uCAmN9B;AAwED,wBAAgB,IAAI,CAAC,EACnB,OAAO,EACP,QAAQ,EACR,KAAe,EACf,MAAM,GACP,EAAE;IACD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,+BAYA;AAED,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,OAAO,EACP,WAAW,EACX,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,+BAgBA"}
|
|
@@ -18,23 +18,29 @@ export function TracingTitlebar() {
|
|
|
18
18
|
const countdown = recording?.autoOffAtUtc ? formatCountdown((Date.parse(recording.autoOffAtUtc) - now) / 1000) : "recording";
|
|
19
19
|
if (!editContext?.workspace || editContext.isMobile)
|
|
20
20
|
return null;
|
|
21
|
+
// Until the instance's status arrives the view knows neither its state nor its process generation, which every
|
|
22
|
+
// mutation must echo: the indicators read "loading…" and their menus stay closed instead of offering "off" actions
|
|
23
|
+
// that the instance would refuse as coming from a stale view.
|
|
24
|
+
const loading = !status;
|
|
21
25
|
const attachment = status?.browserAttachment;
|
|
22
26
|
const attached = !!attachment?.sessionId && !attachment.stale;
|
|
23
27
|
const source = selectedSource(state);
|
|
24
28
|
const canPersist = !!status?.storageAvailable && !!source && source.kind !== "global" && (source.kind !== "capture" || (!!source.finalized && !status.storageOutdated));
|
|
25
29
|
const confirm = editContext.confirm;
|
|
26
|
-
return (_jsxs("div", { className: "flex w-full min-w-0 items-center justify-between gap-3 overflow-hidden pr-2 pl-2", "data-testid": "alpaca-tracing-titlebar", children: [_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2 overflow-hidden", children: [remote ? _jsxs("span", { className: "text-xs text-neutral-grey-50", children: ["Remote: ", state.selectedInstance, " (no cookie recording)"] }) : _jsx(_Fragment, { children: _jsx(Menu, { testId: "alpaca-tracing-browser-menu", trigger: _jsx(Indicator, { icon: _jsx(User, { className: "h-3.5 w-3.5", strokeWidth: 1.5 }), on: attached, label: "This browser", value:
|
|
27
|
-
?
|
|
28
|
-
:
|
|
29
|
-
?
|
|
30
|
-
:
|
|
30
|
+
return (_jsxs("div", { className: "flex w-full min-w-0 items-center justify-between gap-3 overflow-hidden pr-2 pl-2", "data-testid": "alpaca-tracing-titlebar", children: [_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2 overflow-hidden", children: [remote ? _jsxs("span", { className: "text-xs text-neutral-grey-50", children: ["Remote: ", state.selectedInstance, " (no cookie recording)"] }) : _jsx(_Fragment, { children: _jsx(Menu, { testId: "alpaca-tracing-browser-menu", trigger: _jsx(Indicator, { icon: _jsx(User, { className: "h-3.5 w-3.5", strokeWidth: 1.5 }), on: attached, label: "This browser", value: loading
|
|
31
|
+
? "loading…"
|
|
32
|
+
: attached
|
|
33
|
+
? `recording to “${attachment?.name ?? "session"}”`
|
|
34
|
+
: attachment?.stale
|
|
35
|
+
? "stale attachment"
|
|
36
|
+
: "not recording", disabled: loading }), children: attached ? (_jsxs(_Fragment, { children: [_jsx(MenuItem, { onClick: () => void traceActions.detach(), testId: "alpaca-tracing-detach", children: "Detach (stop recording, keep the session)" }), _jsx(MenuItem, { destructive: true, onClick: () => confirm({
|
|
31
37
|
header: "Detach and delete session",
|
|
32
38
|
message: `Delete the session “${attachment?.name ?? ""}” and everything it recorded on this instance?`,
|
|
33
39
|
acceptLabel: "Delete",
|
|
34
40
|
accept: () => {
|
|
35
41
|
void traceActions.deleteSession(attachment.sessionId, false);
|
|
36
42
|
},
|
|
37
|
-
}), testId: "alpaca-tracing-detach-delete", children: "Detach and delete session\u2026" })] })) : (_jsxs(MenuItem, { onClick: () => void traceActions.recordMySession(), testId: "alpaca-tracing-record-my-session", children: ["Record my session", _jsx("span", { className: "block text-2xs text-neutral-grey-50", children: "Traces every request this browser makes to this instance." })] })) }) }), _jsx(Menu, { testId: "alpaca-tracing-global-menu", trigger: _jsx(Indicator, { icon: _jsx(Globe, { className: "h-3.5 w-3.5", strokeWidth: 1.5 }), on: !!status?.globalEnabled, onTone: "warning", label: "Global", value: status
|
|
43
|
+
}), testId: "alpaca-tracing-detach-delete", children: "Detach and delete session\u2026" })] })) : (_jsxs(MenuItem, { onClick: () => void traceActions.recordMySession(), testId: "alpaca-tracing-record-my-session", children: ["Record my session", _jsx("span", { className: "block text-2xs text-neutral-grey-50", children: "Traces every request this browser makes to this instance." })] })) }) }), _jsx(Menu, { testId: "alpaca-tracing-global-menu", trigger: _jsx(Indicator, { icon: _jsx(Globe, { className: "h-3.5 w-3.5", strokeWidth: 1.5 }), on: !!status?.globalEnabled, onTone: "warning", label: "Global", value: loading ? "loading…" : status.globalEnabled ? countdown : "off", disabled: loading }), children: status?.globalEnabled ? (_jsxs(_Fragment, { children: [support.keep === "capture" ? _jsxs(_Fragment, { children: [_jsx(MenuItem, { onClick: () => void traceActions.stopGlobal(), testId: "alpaca-tracing-stop-global", children: "Stop and keep capture" }), _jsx(MenuItem, { destructive: true, onClick: () => confirm({ header: "Discard recording", message: "Discard this instance's active recording and its evidence?", acceptLabel: "Discard", accept: () => { void traceActions.disableGlobal(); } }), children: "Discard\u2026" })] }) : _jsx(MenuItem, { onClick: () => confirm({ header: "Stop recording", message: "Stop this instance's recording? The recorded stories are discarded. Keeping stopped recordings is not available on this instance.", acceptLabel: "Stop", accept: () => { void traceActions.disableGlobal(); } }), testId: "alpaca-tracing-stop-global", children: "Stop recording\u2026" }), support.autoOff && [5, 10, 30, 60].filter(minutes => minutes <= (recording?.maxAutoOffMinutes ?? 60)).map(minutes => _jsxs(MenuItem, { onClick: () => void traceActions.setAutoOff(minutes), children: ["Stop in ", minutes, " min"] }, minutes))] })) : (_jsxs(_Fragment, { children: [support.autoOff && [5, 10, 30, 60].filter(minutes => minutes <= (recording?.maxAutoOffMinutes ?? 60)).map(minutes => _jsxs(MenuItem, { onClick: () => void traceActions.enableGlobal(minutes), children: ["Record everything for ", minutes, " min\u2026"] }, minutes)), (!remote || !support.autoOff) && _jsx(MenuItem, { onClick: () => void traceActions.enableGlobal(null), children: "Record everything until stopped\u2026" })] })) }), status && _jsx(InstanceLine, { status: status })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [_jsx(SimpleIconButton, { icon: _jsx(Crosshair, { className: "h-5 w-5", strokeWidth: 1 }), label: state.follow ? "Stop following the newest story" : "Follow the newest story", size: "large", selected: state.follow, onClick: () => traceActions.setFollow(!state.follow), "data-testid": "alpaca-tracing-follow" }), _jsx(SimpleIconButton, { icon: _jsx(Save, { className: "h-5 w-5", strokeWidth: 1 }), label: !status?.storageAvailable
|
|
38
44
|
? "Trace storage is not installed on this instance"
|
|
39
45
|
: source?.kind === "global" && !support.persistGlobal ? "Persisting the global recording is not available on this instance"
|
|
40
46
|
: source?.kind === "capture" && status.storageOutdated ? "Update Alpaca.Tracing.Storage to persist captures"
|
|
@@ -87,7 +93,7 @@ function InstanceLine({ status }) {
|
|
|
87
93
|
}
|
|
88
94
|
// Used as a Radix PopoverTrigger child (asChild): it must forward the ref and spread the trigger props.
|
|
89
95
|
const Indicator = forwardRef(function Indicator({ icon, on, onTone = "success", label, value, className, ...props }, ref) {
|
|
90
|
-
return (_jsxs("button", { ref: ref, type: "button", title: `${label}: ${value}`, ...props, className: cls("flex h-8 min-w-0 shrink items-center gap-1.5 rounded border border-border-default bg-background px-2 text-xs whitespace-nowrap text-neutral-grey-100 hover:bg-neutral-grey-5", className), children: [_jsx("span", { className: cls("inline-block h-2 w-2 rounded-full", on ? (onTone === "warning" ? "animate-pulse bg-feedback-red" : "animate-pulse bg-feedback-green") : "bg-neutral-grey-15") }), icon, _jsxs("span", { className: "shrink-0 text-neutral-grey-50", children: [label, ":"] }), _jsx("span", { className: "min-w-0 max-w-[220px] truncate", children: value }), _jsx(ChevronDown, { className: "h-3 w-3 text-neutral-grey-50", strokeWidth: 1.5 })] }));
|
|
96
|
+
return (_jsxs("button", { ref: ref, type: "button", title: `${label}: ${value}`, ...props, className: cls("flex h-8 min-w-0 shrink items-center gap-1.5 rounded border border-border-default bg-background px-2 text-xs whitespace-nowrap text-neutral-grey-100 hover:bg-neutral-grey-5 disabled:cursor-wait disabled:opacity-60 disabled:hover:bg-background", className), children: [_jsx("span", { className: cls("inline-block h-2 w-2 rounded-full", on ? (onTone === "warning" ? "animate-pulse bg-feedback-red" : "animate-pulse bg-feedback-green") : "bg-neutral-grey-15") }), icon, _jsxs("span", { className: "shrink-0 text-neutral-grey-50", children: [label, ":"] }), _jsx("span", { className: "min-w-0 max-w-[220px] truncate", children: value }), _jsx(ChevronDown, { className: "h-3 w-3 text-neutral-grey-50", strokeWidth: 1.5 })] }));
|
|
91
97
|
});
|
|
92
98
|
export function Menu({ trigger, children, align = "start", testId, }) {
|
|
93
99
|
const [open, setOpen] = useState(false);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parhelia/alpaca",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.13030",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -42,12 +42,8 @@
|
|
|
42
42
|
"typescript": "npm:@typescript/typescript6@6.0.2"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@graphiql/plugin-explorer": "^5.1.5",
|
|
46
|
-
"@graphiql/react": "^0.39.0",
|
|
47
45
|
"@parhelia/core": "*",
|
|
48
46
|
"@uiw/react-textarea-code-editor": "^3.1.1",
|
|
49
|
-
"graphiql": "^5.4.0",
|
|
50
|
-
"graphql": "^17.0.2",
|
|
51
47
|
"lucide-react": "^1.38.0",
|
|
52
48
|
"postcss": "^8.5.26",
|
|
53
49
|
"react": "19.2.8",
|
package/dist/GraphQL.d.ts
DELETED
package/dist/GraphQL.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GraphQL.d.ts","sourceRoot":"","sources":["../src/GraphQL.tsx"],"names":[],"mappings":"AA6BA,wBAAgB,OAAO,uCAsRtB"}
|
package/dist/GraphQL.js
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useMemo, useState } from "react";
|
|
3
|
-
import { ActionButton, createAgentCommand, getComponentById, ParheliaAgentIcon, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, useCanvasSelection, useEditContext, } from "@parhelia/core";
|
|
4
|
-
import { getGraphQLSchema } from "./graphqlService";
|
|
5
|
-
import { GraphiQLPanel } from "./GraphiQLPanel";
|
|
6
|
-
function sameItem(left, right) {
|
|
7
|
-
return (!!left &&
|
|
8
|
-
!!right &&
|
|
9
|
-
left.id === right.id &&
|
|
10
|
-
left.language === right.language &&
|
|
11
|
-
left.version === right.version);
|
|
12
|
-
}
|
|
13
|
-
export function GraphQL() {
|
|
14
|
-
const editContext = useEditContext();
|
|
15
|
-
const canvasSelection = useCanvasSelection();
|
|
16
|
-
const pageItem = editContext?.page?.item ?? editContext?.item;
|
|
17
|
-
const selectionKey = canvasSelection.join("|");
|
|
18
|
-
const [query, setQuery] = useState("");
|
|
19
|
-
const [schemaResult, setSchemaResult] = useState({});
|
|
20
|
-
const [showSchemaSpinner, setShowSchemaSpinner] = useState(false);
|
|
21
|
-
const [schemaLoadKey, setSchemaLoadKey] = useState("");
|
|
22
|
-
const [aiGeneratedQuery, setAiGeneratedQuery] = useState("");
|
|
23
|
-
const [graphiqlVariables, setGraphiqlVariables] = useState("{}");
|
|
24
|
-
const [baseItem, setBaseItem] = useState(null);
|
|
25
|
-
const selectedComponent = useMemo(() => {
|
|
26
|
-
if (!editContext?.page || canvasSelection.length !== 1) {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
return getComponentById(canvasSelection[0], editContext.page) || null;
|
|
30
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
31
|
-
}, [editContext?.page, selectionKey]);
|
|
32
|
-
const baseItemDescriptor = useMemo(() => {
|
|
33
|
-
const componentItem = selectedComponent?.datasourceItem || selectedComponent?.items?.[0];
|
|
34
|
-
return componentItem || pageItem?.descriptor || pageItem || null;
|
|
35
|
-
}, [selectedComponent, pageItem]);
|
|
36
|
-
const currentItem = useMemo(() => baseItemDescriptor
|
|
37
|
-
? {
|
|
38
|
-
id: baseItemDescriptor.id,
|
|
39
|
-
language: baseItemDescriptor.language,
|
|
40
|
-
version: baseItemDescriptor.version,
|
|
41
|
-
}
|
|
42
|
-
: null, [
|
|
43
|
-
baseItemDescriptor?.id,
|
|
44
|
-
baseItemDescriptor?.language,
|
|
45
|
-
baseItemDescriptor?.version,
|
|
46
|
-
]);
|
|
47
|
-
const baseItemLabel = useMemo(() => {
|
|
48
|
-
const componentItem = selectedComponent?.datasourceItem || selectedComponent?.items?.[0];
|
|
49
|
-
return componentItem?.name || pageItem?.name || currentItem?.id || "";
|
|
50
|
-
}, [selectedComponent, pageItem?.name, currentItem?.id]);
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
let isCancelled = false;
|
|
53
|
-
const loadBaseItem = async () => {
|
|
54
|
-
if (!editContext || !baseItemDescriptor) {
|
|
55
|
-
setBaseItem(null);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (pageItem &&
|
|
59
|
-
sameItem({
|
|
60
|
-
id: pageItem.id,
|
|
61
|
-
language: pageItem.language,
|
|
62
|
-
version: pageItem.version,
|
|
63
|
-
}, {
|
|
64
|
-
id: baseItemDescriptor.id,
|
|
65
|
-
language: baseItemDescriptor.language,
|
|
66
|
-
version: baseItemDescriptor.version,
|
|
67
|
-
})) {
|
|
68
|
-
setBaseItem(pageItem);
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
try {
|
|
72
|
-
const nextItem = await editContext.itemsRepository.getItem(baseItemDescriptor);
|
|
73
|
-
if (!isCancelled) {
|
|
74
|
-
setBaseItem(nextItem || null);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
catch (error) {
|
|
78
|
-
console.error("Failed to load base item for GraphQL panel:", error);
|
|
79
|
-
if (!isCancelled) {
|
|
80
|
-
setBaseItem(null);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
void loadBaseItem();
|
|
85
|
-
return () => {
|
|
86
|
-
isCancelled = true;
|
|
87
|
-
};
|
|
88
|
-
}, [
|
|
89
|
-
editContext,
|
|
90
|
-
baseItemDescriptor?.id,
|
|
91
|
-
baseItemDescriptor?.language,
|
|
92
|
-
baseItemDescriptor?.version,
|
|
93
|
-
pageItem,
|
|
94
|
-
]);
|
|
95
|
-
const queryField = useMemo(() => baseItem?.fields?.find((field) => field.name === "_GraphQL" || field.name === "graphql_query") || null, [baseItem]);
|
|
96
|
-
useEffect(() => {
|
|
97
|
-
setQuery(queryField?.rawValue || "");
|
|
98
|
-
}, [queryField?.id, queryField?.rawValue]);
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
setSchemaResult({});
|
|
101
|
-
setSchemaLoadKey("");
|
|
102
|
-
setGraphiqlVariables("{}");
|
|
103
|
-
setAiGeneratedQuery("");
|
|
104
|
-
}, [currentItem?.id, currentItem?.language, currentItem?.version]);
|
|
105
|
-
const currentItemKey = currentItem
|
|
106
|
-
? `${currentItem.id}:${currentItem.language}:${currentItem.version}`
|
|
107
|
-
: "";
|
|
108
|
-
useEffect(() => {
|
|
109
|
-
if (currentItem &&
|
|
110
|
-
!schemaResult?.data &&
|
|
111
|
-
!schemaResult?.error &&
|
|
112
|
-
!showSchemaSpinner &&
|
|
113
|
-
schemaLoadKey !== currentItemKey) {
|
|
114
|
-
setSchemaLoadKey(currentItemKey);
|
|
115
|
-
void fetchSchema();
|
|
116
|
-
}
|
|
117
|
-
}, [
|
|
118
|
-
currentItem?.id,
|
|
119
|
-
currentItem?.language,
|
|
120
|
-
currentItem?.version,
|
|
121
|
-
currentItemKey,
|
|
122
|
-
schemaLoadKey,
|
|
123
|
-
schemaResult?.data,
|
|
124
|
-
schemaResult?.error,
|
|
125
|
-
showSchemaSpinner,
|
|
126
|
-
]);
|
|
127
|
-
useEffect(() => {
|
|
128
|
-
if (!editContext || !currentItem)
|
|
129
|
-
return;
|
|
130
|
-
const factoryName = "graphql:context:v1";
|
|
131
|
-
const factory = async () => ({
|
|
132
|
-
schema: schemaResult?.data || "",
|
|
133
|
-
currentQuery: query,
|
|
134
|
-
itemContext: {
|
|
135
|
-
id: currentItem.id,
|
|
136
|
-
language: currentItem.language,
|
|
137
|
-
version: currentItem.version,
|
|
138
|
-
},
|
|
139
|
-
});
|
|
140
|
-
editContext.registerContextFactory?.(factoryName, factory);
|
|
141
|
-
return () => editContext.unregisterContextFactory?.(factoryName);
|
|
142
|
-
}, [
|
|
143
|
-
editContext,
|
|
144
|
-
currentItem?.id,
|
|
145
|
-
currentItem?.language,
|
|
146
|
-
currentItem?.version,
|
|
147
|
-
query,
|
|
148
|
-
schemaResult?.data,
|
|
149
|
-
]);
|
|
150
|
-
if (!currentItem)
|
|
151
|
-
return null;
|
|
152
|
-
const activeItem = currentItem;
|
|
153
|
-
async function fetchSchema() {
|
|
154
|
-
setShowSchemaSpinner(true);
|
|
155
|
-
try {
|
|
156
|
-
const response = await getGraphQLSchema({
|
|
157
|
-
id: activeItem.id,
|
|
158
|
-
language: activeItem.language,
|
|
159
|
-
version: activeItem.version,
|
|
160
|
-
mode: "edit",
|
|
161
|
-
siteName: "website",
|
|
162
|
-
});
|
|
163
|
-
setSchemaResult(response.error
|
|
164
|
-
? {
|
|
165
|
-
status: response.status,
|
|
166
|
-
error: response.error,
|
|
167
|
-
transport: response.transport,
|
|
168
|
-
}
|
|
169
|
-
: {
|
|
170
|
-
data: response.data,
|
|
171
|
-
status: response.status,
|
|
172
|
-
transport: response.transport,
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
catch (error) {
|
|
176
|
-
console.error("Schema fetch error:", error);
|
|
177
|
-
setSchemaResult({ error: String(error) });
|
|
178
|
-
}
|
|
179
|
-
finally {
|
|
180
|
-
setShowSchemaSpinner(false);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
const applyQueryToEditor = (newQuery) => {
|
|
184
|
-
setQuery(newQuery);
|
|
185
|
-
setAiGeneratedQuery(newQuery);
|
|
186
|
-
};
|
|
187
|
-
return (_jsxs("div", { className: "relative flex h-full min-h-0 flex-col overflow-hidden text-xs", children: [aiGeneratedQuery && aiGeneratedQuery !== query && (_jsxs("div", { className: "shrink-0 flex items-center gap-2 border-b border-feedback-orange/30 bg-feedback-orange-light p-2 text-xs", children: [_jsx("span", { className: "text-feedback-orange", children: "AI generated a new query" }), _jsx(ActionButton, { onClick: () => applyQueryToEditor(aiGeneratedQuery), className: "p-1 text-xs", variant: "outline", children: "Apply" }), _jsx(ActionButton, { onClick: () => setAiGeneratedQuery(""), className: "p-1", variant: "ghost", children: "x" })] })), _jsx(GraphiQLPanel, { item: currentItem, itemLabel: baseItemLabel, query: query, variables: graphiqlVariables, onQueryChange: setQuery, onVariablesChange: setGraphiqlVariables, onExecutionResult: () => { }, headerActions: _jsx(TooltipProvider, { delayDuration: 300, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs(ActionButton, { variant: "outline", className: "h-8 w-8 rounded-full p-0", onClick: () => {
|
|
188
|
-
editContext?.executeCommand?.({
|
|
189
|
-
command: createAgentCommand,
|
|
190
|
-
data: {
|
|
191
|
-
profileName: "GraphQL Assistant",
|
|
192
|
-
contextFactory: "graphql:context:v1",
|
|
193
|
-
initialPrompt: "Help with the current GraphQL query and schema.",
|
|
194
|
-
additionalData: {
|
|
195
|
-
source: "GraphQLPanel",
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
});
|
|
199
|
-
}, children: [_jsx(ParheliaAgentIcon, { size: 16, strokeWidth: 1 }), _jsx("span", { className: "sr-only", children: "Start GraphQL Agent" })] }) }), _jsx(TooltipContent, { children: "Start GraphQL Agent" })] }) }) })] }));
|
|
200
|
-
}
|
package/dist/GraphiQLPanel.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import "graphiql/style.css";
|
|
2
|
-
import "@graphiql/plugin-explorer/style.css";
|
|
3
|
-
import "graphiql/setup-workers/webpack";
|
|
4
|
-
import { GraphiQLExecutionResult, GraphQLPanelItem } from "./graphqlService";
|
|
5
|
-
export declare function GraphiQLPanel({ item, query, variables, onQueryChange, onVariablesChange, onExecutionResult, itemLabel, headerActions, }: {
|
|
6
|
-
item: GraphQLPanelItem;
|
|
7
|
-
query: string;
|
|
8
|
-
variables: string;
|
|
9
|
-
onQueryChange: (query: string) => void;
|
|
10
|
-
onVariablesChange: (variables: string) => void;
|
|
11
|
-
onExecutionResult: (result: GraphiQLExecutionResult) => void;
|
|
12
|
-
itemLabel?: string;
|
|
13
|
-
headerActions?: React.ReactNode;
|
|
14
|
-
}): import("react").JSX.Element;
|
|
15
|
-
//# sourceMappingURL=GraphiQLPanel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GraphiQLPanel.d.ts","sourceRoot":"","sources":["../src/GraphiQLPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,qCAAqC,CAAC;AAC7C,OAAO,gCAAgC,CAAC;AAQxC,OAAO,EAGL,uBAAuB,EAEvB,gBAAgB,EAEjB,MAAM,kBAAkB,CAAC;AAiF1B,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,KAAK,EACL,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACT,aAAa,GACd,EAAE;IACD,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,iBAAiB,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACjC,+BAmOA"}
|
package/dist/GraphiQLPanel.js
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import "graphiql/style.css";
|
|
3
|
-
import "@graphiql/plugin-explorer/style.css";
|
|
4
|
-
import "graphiql/setup-workers/webpack";
|
|
5
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
6
|
-
import { GraphiQL as GraphiQLIDE } from "graphiql";
|
|
7
|
-
import { useGraphiQL, useGraphiQLActions } from "@graphiql/react";
|
|
8
|
-
import { explorerPlugin } from "@graphiql/plugin-explorer";
|
|
9
|
-
import { ActionButton } from "@parhelia/core";
|
|
10
|
-
import { RefreshCw } from "lucide-react";
|
|
11
|
-
import { executeGraphiQLRequest, fetchGraphiQLSchema, isSchemaIntrospectionQuery, } from "./graphqlService";
|
|
12
|
-
function GraphiQLSyncBridge({ query, variables, }) {
|
|
13
|
-
const { updateActiveTabValues } = useGraphiQLActions();
|
|
14
|
-
const activeQuery = useGraphiQL((state) => state.tabs[state.activeTabIndex]?.query ?? "");
|
|
15
|
-
const activeVariables = useGraphiQL((state) => state.tabs[state.activeTabIndex]?.variables ?? "");
|
|
16
|
-
const pendingExternalState = useRef(null);
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (activeQuery !== query || activeVariables !== variables) {
|
|
19
|
-
pendingExternalState.current = { query, variables };
|
|
20
|
-
updateActiveTabValues({ query, variables });
|
|
21
|
-
}
|
|
22
|
-
}, [activeQuery, activeVariables, query, updateActiveTabValues, variables]);
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
if (pendingExternalState.current &&
|
|
25
|
-
pendingExternalState.current.query === activeQuery &&
|
|
26
|
-
pendingExternalState.current.variables === activeVariables) {
|
|
27
|
-
pendingExternalState.current = null;
|
|
28
|
-
}
|
|
29
|
-
}, [activeQuery, activeVariables]);
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
function parseVariables(variables) {
|
|
33
|
-
if (!variables.trim()) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
return JSON.parse(variables);
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
throw new Error(error instanceof Error
|
|
41
|
-
? `Variables JSON is invalid: ${error.message}`
|
|
42
|
-
: "Variables JSON is invalid.");
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
function getSchemaErrorMessage(result) {
|
|
46
|
-
if (result.error) {
|
|
47
|
-
return result.error;
|
|
48
|
-
}
|
|
49
|
-
const firstError = Array.isArray(result.errors)
|
|
50
|
-
? result.errors[0]
|
|
51
|
-
: result.errors;
|
|
52
|
-
if (firstError) {
|
|
53
|
-
if (typeof firstError.message === "string") {
|
|
54
|
-
return firstError.message;
|
|
55
|
-
}
|
|
56
|
-
if (typeof firstError === "string") {
|
|
57
|
-
return firstError;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
if (result.status && result.status !== 200) {
|
|
61
|
-
return "Schema introspection failed";
|
|
62
|
-
}
|
|
63
|
-
return undefined;
|
|
64
|
-
}
|
|
65
|
-
export function GraphiQLPanel({ item, query, variables, onQueryChange, onVariablesChange, onExecutionResult, itemLabel, headerActions, }) {
|
|
66
|
-
const [schemaResult, setSchemaResult] = useState({});
|
|
67
|
-
const [isRefreshingSchema, setIsRefreshingSchema] = useState(false);
|
|
68
|
-
const [autoSchemaLoadKey, setAutoSchemaLoadKey] = useState("");
|
|
69
|
-
const activeSchemaRequestRef = useRef(0);
|
|
70
|
-
const failedSchemaRequestKeyRef = useRef("");
|
|
71
|
-
const explorer = useMemo(() => explorerPlugin(), []);
|
|
72
|
-
const plugins = useMemo(() => [explorer], [explorer]);
|
|
73
|
-
const handleEditHeaders = useCallback(() => { }, []);
|
|
74
|
-
const graphiqlSchema = schemaResult.schema ?? null;
|
|
75
|
-
const schemaRequestKey = useMemo(() => `${item.id}:${item.language}:${item.version}`, [item.id, item.language, item.version]);
|
|
76
|
-
const refreshSchema = useCallback(async () => {
|
|
77
|
-
const requestKey = schemaRequestKey;
|
|
78
|
-
const requestId = activeSchemaRequestRef.current + 1;
|
|
79
|
-
activeSchemaRequestRef.current = requestId;
|
|
80
|
-
setIsRefreshingSchema(true);
|
|
81
|
-
try {
|
|
82
|
-
const result = await fetchGraphiQLSchema(item);
|
|
83
|
-
if (activeSchemaRequestRef.current === requestId) {
|
|
84
|
-
const error = getSchemaErrorMessage(result);
|
|
85
|
-
if (error) {
|
|
86
|
-
failedSchemaRequestKeyRef.current = requestKey;
|
|
87
|
-
setSchemaResult({ ...result, error });
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
failedSchemaRequestKeyRef.current = "";
|
|
91
|
-
setSchemaResult(result);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
finally {
|
|
96
|
-
if (activeSchemaRequestRef.current === requestId) {
|
|
97
|
-
setIsRefreshingSchema(false);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}, [item.id, item.language, item.version, schemaRequestKey]);
|
|
101
|
-
useEffect(() => {
|
|
102
|
-
activeSchemaRequestRef.current += 1;
|
|
103
|
-
failedSchemaRequestKeyRef.current = "";
|
|
104
|
-
setAutoSchemaLoadKey("");
|
|
105
|
-
setSchemaResult({});
|
|
106
|
-
setIsRefreshingSchema(false);
|
|
107
|
-
}, [schemaRequestKey]);
|
|
108
|
-
useEffect(() => {
|
|
109
|
-
if (!graphiqlSchema &&
|
|
110
|
-
!schemaResult.error &&
|
|
111
|
-
!isRefreshingSchema &&
|
|
112
|
-
autoSchemaLoadKey !== schemaRequestKey) {
|
|
113
|
-
setAutoSchemaLoadKey(schemaRequestKey);
|
|
114
|
-
void refreshSchema();
|
|
115
|
-
}
|
|
116
|
-
}, [
|
|
117
|
-
autoSchemaLoadKey,
|
|
118
|
-
graphiqlSchema,
|
|
119
|
-
isRefreshingSchema,
|
|
120
|
-
refreshSchema,
|
|
121
|
-
schemaRequestKey,
|
|
122
|
-
schemaResult.error,
|
|
123
|
-
]);
|
|
124
|
-
const handleRefreshSchema = useCallback(() => {
|
|
125
|
-
failedSchemaRequestKeyRef.current = "";
|
|
126
|
-
setSchemaResult({});
|
|
127
|
-
setAutoSchemaLoadKey(schemaRequestKey);
|
|
128
|
-
void refreshSchema();
|
|
129
|
-
}, [refreshSchema, schemaRequestKey]);
|
|
130
|
-
const fetcher = useCallback(async (graphQLParams) => {
|
|
131
|
-
if (!graphQLParams.query) {
|
|
132
|
-
return {
|
|
133
|
-
errors: [{ message: "No GraphQL query was provided." }],
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
let parsedVariables = null;
|
|
137
|
-
try {
|
|
138
|
-
parsedVariables = parseVariables(variables);
|
|
139
|
-
}
|
|
140
|
-
catch (error) {
|
|
141
|
-
return {
|
|
142
|
-
errors: [
|
|
143
|
-
{ message: error instanceof Error ? error.message : String(error) },
|
|
144
|
-
],
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
const isIntrospectionQuery = isSchemaIntrospectionQuery(graphQLParams.query);
|
|
148
|
-
if (isIntrospectionQuery &&
|
|
149
|
-
failedSchemaRequestKeyRef.current === schemaRequestKey) {
|
|
150
|
-
const message = schemaResult.error ||
|
|
151
|
-
"Schema introspection failed. Use Retry to try loading the schema again.";
|
|
152
|
-
return {
|
|
153
|
-
data: null,
|
|
154
|
-
errors: [{ message }],
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
const result = await executeGraphiQLRequest({
|
|
158
|
-
item,
|
|
159
|
-
query: graphQLParams.query,
|
|
160
|
-
variables: graphQLParams.variables ?? parsedVariables,
|
|
161
|
-
operationName: graphQLParams.operationName,
|
|
162
|
-
});
|
|
163
|
-
if (isIntrospectionQuery) {
|
|
164
|
-
const error = getSchemaErrorMessage(result);
|
|
165
|
-
if (error) {
|
|
166
|
-
failedSchemaRequestKeyRef.current = schemaRequestKey;
|
|
167
|
-
setSchemaResult({ ...result, error });
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
failedSchemaRequestKeyRef.current = "";
|
|
171
|
-
setSchemaResult(result);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
onExecutionResult(result);
|
|
176
|
-
}
|
|
177
|
-
if (result.error) {
|
|
178
|
-
return {
|
|
179
|
-
data: result.data,
|
|
180
|
-
errors: [{ message: result.error }],
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
return {
|
|
184
|
-
data: result.data ?? null,
|
|
185
|
-
errors: result.errors,
|
|
186
|
-
};
|
|
187
|
-
}, [
|
|
188
|
-
item.id,
|
|
189
|
-
item.language,
|
|
190
|
-
item.version,
|
|
191
|
-
onExecutionResult,
|
|
192
|
-
schemaRequestKey,
|
|
193
|
-
schemaResult.error,
|
|
194
|
-
variables,
|
|
195
|
-
]);
|
|
196
|
-
const lastTransportMessage = useMemo(() => {
|
|
197
|
-
if (schemaResult.transport?.used === "v1-fallback") {
|
|
198
|
-
return `Schema fetch fell back to v1 after v2 status ${schemaResult.transport.fallbackFromStatus}.`;
|
|
199
|
-
}
|
|
200
|
-
return "";
|
|
201
|
-
}, [schemaResult.transport]);
|
|
202
|
-
return (_jsxs("div", { className: "flex min-h-0 flex-1 flex-col bg-white", children: [_jsx("style", { children: `
|
|
203
|
-
.alpaca-graphiql-shell .graphiql-logo {
|
|
204
|
-
display: none;
|
|
205
|
-
}
|
|
206
|
-
` }), _jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-border-default bg-neutral-grey-5 px-3 py-2 text-xs text-neutral-grey-50", children: [_jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [_jsxs("span", { children: ["Base item: ", _jsx("span", { className: "font-mono", children: itemLabel || item.id })] }), _jsxs("span", { children: [item.language, " v", item.version] })] }), headerActions && (_jsx("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: headerActions }))] }), !!lastTransportMessage && (_jsx("div", { className: "border-b border-feedback-orange/30 bg-feedback-orange-light px-3 py-2 text-xs text-feedback-orange", children: lastTransportMessage })), schemaResult.error && (_jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-feedback-red bg-feedback-red-light px-3 py-2 text-xs text-feedback-red", children: [_jsx("span", { children: schemaResult.error }), _jsxs(ActionButton, { className: "shrink-0", disabled: isRefreshingSchema, isLoading: isRefreshingSchema, loadingText: "Retrying", onClick: handleRefreshSchema, variant: "outline", children: [_jsx(RefreshCw, { strokeWidth: 1, className: "h-3.5 w-3.5" }), _jsx("span", { children: "Retry" })] })] })), _jsx("div", { className: "alpaca-graphiql-shell min-h-0 flex-1 bg-white [&_.graphiql-container]:h-full", children: _jsx(GraphiQLIDE, { className: "h-full", fetcher: fetcher, schema: graphiqlSchema, forcedTheme: "light", initialQuery: query, initialVariables: variables, initialHeaders: "", onEditQuery: onQueryChange, onEditVariables: onVariablesChange, onEditHeaders: handleEditHeaders, isHeadersEditorEnabled: false, defaultEditorToolsVisibility: "variables", plugins: plugins, children: _jsx(GraphiQLSyncBridge, { query: query, variables: variables }) }) })] }));
|
|
207
|
-
}
|
package/dist/Layout.d.ts
DELETED
package/dist/Layout.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../src/Layout.tsx"],"names":[],"mappings":"AAaA,wBAAgB,MAAM,uCA8GrB"}
|