@loopstack/loopstack-studio 0.25.2 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/environments.js +4 -0
- package/dist/api/index.js +13 -9
- package/dist/app/EnvironmentEmbedRoot.js +29 -19
- package/dist/components/data-table/DataList.js +93 -91
- package/dist/components/data-table/DataTable.js +128 -126
- package/dist/components/feedback/Snackbar.js +1 -1
- package/dist/components/layout/StudioSidebar.js +124 -131
- package/dist/components/ui/sidebar.js +2 -2
- package/dist/components/ui/slider.js +37 -26
- package/dist/components/ui-widgets/widgets/SandboxRun.js +16 -14
- package/dist/features/code-explorer/components/CodeExplorerTree.js +1 -0
- package/dist/features/code-explorer/components/FileContentViewer.js +1 -1
- package/dist/features/dashboard/RunItem.js +39 -37
- package/dist/features/debug/lib/flow-utils.js +1 -1
- package/dist/features/documents/DocumentRenderer.js +59 -58
- package/dist/features/documents/renderers/useDocumentTransition.js +29 -24
- package/dist/features/feature-registry/FeatureRegistryProvider.js +17 -0
- package/dist/features/feature-registry/index.js +1 -0
- package/dist/features/file-explorer/api/files.js +7 -0
- package/dist/features/file-explorer/components/FileExplorerPanel.js +95 -0
- package/dist/features/{workbench/components/RemoteFileTabsBar.js → file-explorer/components/FileTabsBar.js} +4 -4
- package/dist/features/{workbench/components/RemoteFileTree.js → file-explorer/components/FileTree.js} +6 -6
- package/dist/features/file-explorer/file-explorer-feature.js +12 -0
- package/dist/features/file-explorer/hooks/useFileExplorer.js +44 -0
- package/dist/features/file-explorer/index.js +2 -0
- package/dist/features/file-explorer/providers/FileExplorerProvider.js +112 -0
- package/dist/features/oauth/OAuthPromptRenderer.js +162 -132
- package/dist/features/runs/Runs.js +1 -1
- package/dist/features/secrets/components/WorkbenchSecretsPanel.js +178 -0
- package/dist/features/secrets/index.js +1 -0
- package/dist/features/{documents → secrets}/renderers/SecretInputRenderer.js +17 -17
- package/dist/features/secrets/secrets-feature.js +14 -0
- package/dist/features/workbench/Workbench.js +32 -82
- package/dist/features/workbench/WorkflowList.js +109 -46
- package/dist/features/workbench/components/SidebarPanel.js +155 -0
- package/dist/features/workbench/components/WorkbenchEnvironmentPanel.js +82 -0
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +128 -60
- package/dist/features/workbench/components/WorkbenchPreviewPanel.js +127 -114
- package/dist/features/workbench/components/WorkbenchRunsPanel.js +32 -0
- package/dist/features/workbench/components/WorkbenchSidebarShell.js +80 -0
- package/dist/features/workbench/hooks/useWorkflowData.js +3 -3
- package/dist/features/workbench/index.js +3 -2
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +60 -62
- package/dist/features/workspaces/Workspaces.js +1 -1
- package/dist/features/workspaces/components/EnvironmentSlotSelector.js +68 -51
- package/dist/features/workspaces/components/WorkflowRunForm.js +1 -1
- package/dist/features/workspaces/components/WorkspaceHomePage.js +1 -1
- package/dist/hooks/useEnvironmentPreviewUrl.js +13 -0
- package/dist/hooks/useEnvironments.js +8 -0
- package/dist/hooks/useWorkflows.js +28 -26
- package/dist/hooks/useWorkspaces.js +28 -26
- package/dist/index.d.ts +98 -7
- package/dist/index.js +8 -1
- package/dist/loopstack-studio.css +1 -1
- package/dist/node_modules/@shikijs/core/dist/index.js +105 -643
- package/dist/node_modules/@shikijs/engine-oniguruma/dist/index.js +135 -122
- package/dist/node_modules/@shikijs/langs/dist/bird2.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/cobol.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/css.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/dart.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/emacs-lisp.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/es-tag-sql.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/go.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/kusto.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/nextflow-groovy.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/php.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/ruby.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/typespec.js +1 -1
- package/dist/node_modules/@shikijs/primitive/dist/index.js +538 -0
- package/dist/node_modules/@shikijs/themes/dist/horizon-bright.js +1 -1
- package/dist/node_modules/@xyflow/react/dist/esm/index.js +1 -1
- package/dist/node_modules/shiki/dist/bundle-full.js +6 -5
- package/dist/node_modules/shiki/dist/chunk-CtajNgzt.js +15 -0
- package/dist/node_modules/shiki/dist/engine-oniguruma.js +5 -0
- package/dist/node_modules/shiki/dist/{langs.js → langs-bundle-full-DfKZStlK.js} +1 -1
- package/dist/node_modules/shiki/dist/themes.js +1 -1
- package/dist/pages/DashboardPage.js +54 -79
- package/dist/pages/DebugWorkflowDetailsPage.js +41 -55
- package/dist/pages/DebugWorkflowsPage.js +151 -112
- package/dist/pages/EmbedWorkbenchPage.js +2 -1
- package/dist/pages/PreviewWorkbenchPage.js +77 -59
- package/dist/pages/RunsListPage.js +27 -41
- package/dist/pages/RunsPage.js +21 -36
- package/dist/pages/WorkbenchPage.js +48 -70
- package/dist/pages/WorkflowDebugPage.js +65 -79
- package/dist/pages/WorkspacePage.js +59 -86
- package/dist/pages/WorkspaceRunsPage.js +59 -54
- package/dist/pages/WorkspacesPage.js +11 -27
- package/dist/providers/StudioPreferencesProvider.js +54 -0
- package/package.json +29 -29
- package/dist/features/workbench/components/WorkbenchFilesPanel.js +0 -67
- package/dist/features/workbench/components/WorkbenchFloatingPanel.js +0 -57
- package/dist/features/workbench/components/WorkbenchFlowPanel.js +0 -47
- package/dist/features/workbench/components/WorkbenchSecretsPanel.js +0 -182
- package/dist/features/workbench/providers/RemoteFileExplorerProvider.js +0 -160
- /package/dist/{node_modules → frontend/studio/node_modules}/@dagrejs/dagre/dist/dagre.esm.js +0 -0
|
@@ -4,164 +4,185 @@ import { useOAuthPopup } from "./useOAuthPopup.js";
|
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
5
5
|
import React, { useCallback, useEffect, useRef } from "react";
|
|
6
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
var OAuthPromptRenderer = (
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
var OAuthPromptRenderer = (p) => {
|
|
8
|
+
let m = c(47), { parentWorkflow: _, workflow: v, document: y, isActive: b } = p, x = y.content, S = y.ui, C = S?.widgets, w;
|
|
9
|
+
m[0] !== S?.actions || m[1] !== C?.[0]?.options?.transition ? (w = C?.[0]?.options?.transition ?? (S?.actions)?.map(_temp).find(_temp2), m[0] = S?.actions, m[1] = C?.[0]?.options?.transition, m[2] = w) : w = m[2];
|
|
10
|
+
let T = w, E = useRunWorkflow(), { result: D, open: O, reset: k } = useOAuthPopup(), A = useRef(!1), j;
|
|
11
|
+
m[3] === v.availableTransitions ? j = m[4] : (j = v.availableTransitions?.map(_temp3) ?? [], m[3] = v.availableTransitions, m[4] = j);
|
|
12
|
+
let M = j, N;
|
|
13
|
+
m[5] !== M || m[6] !== _.id || m[7] !== E || m[8] !== T || m[9] !== v.id ? (N = (t, u) => {
|
|
14
|
+
!T || !M.includes(T) || E.mutate({
|
|
15
|
+
workflowId: _.id,
|
|
11
16
|
runWorkflowPayloadDto: { transition: {
|
|
12
|
-
id:
|
|
13
|
-
workflowId:
|
|
17
|
+
id: T,
|
|
18
|
+
workflowId: v.id,
|
|
14
19
|
payload: {
|
|
15
|
-
code:
|
|
16
|
-
state:
|
|
20
|
+
code: t,
|
|
21
|
+
state: u
|
|
17
22
|
}
|
|
18
23
|
} }
|
|
19
24
|
});
|
|
20
|
-
}, [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
]);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
authUrl: g.authUrl,
|
|
33
|
-
state: g.state
|
|
25
|
+
}, m[5] = M, m[6] = _.id, m[7] = E, m[8] = T, m[9] = v.id, m[10] = N) : N = m[10];
|
|
26
|
+
let P = N, F;
|
|
27
|
+
m[11] !== D.code || m[12] !== D.state || m[13] !== D.status || m[14] !== P ? (F = () => {
|
|
28
|
+
D.status === "success" && !A.current && (A.current = !0, P(D.code, D.state));
|
|
29
|
+
}, m[11] = D.code, m[12] = D.state, m[13] = D.status, m[14] = P, m[15] = F) : F = m[15];
|
|
30
|
+
let I;
|
|
31
|
+
m[16] !== D || m[17] !== P ? (I = [D, P], m[16] = D, m[17] = P, m[18] = I) : I = m[18], useEffect(F, I);
|
|
32
|
+
let L;
|
|
33
|
+
m[19] !== x.authUrl || m[20] !== x.state || m[21] !== O ? (L = () => {
|
|
34
|
+
A.current = !1, O({
|
|
35
|
+
authUrl: x.authUrl,
|
|
36
|
+
state: x.state
|
|
34
37
|
});
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
}, m[19] = x.authUrl, m[20] = x.state, m[21] = O, m[22] = L) : L = m[22];
|
|
39
|
+
let R = L, z;
|
|
40
|
+
m[23] !== x.authUrl || m[24] !== x.state || m[25] !== O || m[26] !== k ? (z = () => {
|
|
41
|
+
k(), A.current = !1, O({
|
|
42
|
+
authUrl: x.authUrl,
|
|
43
|
+
state: x.state
|
|
39
44
|
});
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
message:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
message:
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
|
|
45
|
+
}, m[23] = x.authUrl, m[24] = x.state, m[25] = O, m[26] = k, m[27] = z) : z = m[27];
|
|
46
|
+
let B = z;
|
|
47
|
+
if (x.status === "success") {
|
|
48
|
+
let u;
|
|
49
|
+
return m[28] !== x.message || m[29] !== x.provider ? (u = /* @__PURE__ */ jsx(CompletionMessagePaper_default, { children: /* @__PURE__ */ jsx(StatusDisplay, {
|
|
50
|
+
status: "success",
|
|
51
|
+
provider: x.provider,
|
|
52
|
+
message: x.message
|
|
53
|
+
}) }), m[28] = x.message, m[29] = x.provider, m[30] = u) : u = m[30], u;
|
|
54
|
+
}
|
|
55
|
+
if (x.status === "error") {
|
|
56
|
+
let u;
|
|
57
|
+
m[31] !== x.message || m[32] !== x.provider ? (u = /* @__PURE__ */ jsx(StatusDisplay, {
|
|
58
|
+
status: "error",
|
|
59
|
+
provider: x.provider,
|
|
60
|
+
message: x.message
|
|
61
|
+
}), m[31] = x.message, m[32] = x.provider, m[33] = u) : u = m[33];
|
|
62
|
+
let d;
|
|
63
|
+
m[34] !== B || m[35] !== b ? (d = b && /* @__PURE__ */ jsx(RetryButton, { onClick: B }), m[34] = B, m[35] = b, m[36] = d) : d = m[36];
|
|
64
|
+
let f;
|
|
65
|
+
return m[37] !== u || m[38] !== d ? (f = /* @__PURE__ */ jsxs(CompletionMessagePaper_default, { children: [u, d] }), m[37] = u, m[38] = d, m[39] = f) : f = m[39], f;
|
|
66
|
+
}
|
|
67
|
+
let V;
|
|
68
|
+
return m[40] !== x.provider || m[41] !== B || m[42] !== R || m[43] !== b || m[44] !== D || m[45] !== E.isPending ? (V = /* @__PURE__ */ jsx(CompletionMessagePaper_default, { children: /* @__PURE__ */ jsx(PopupResultView, {
|
|
69
|
+
result: D,
|
|
70
|
+
provider: x.provider,
|
|
71
|
+
isActive: b,
|
|
72
|
+
isSubmitting: E.isPending,
|
|
73
|
+
onSignIn: R,
|
|
74
|
+
onRetry: B
|
|
75
|
+
}) }), m[40] = x.provider, m[41] = B, m[42] = R, m[43] = b, m[44] = D, m[45] = E.isPending, m[46] = V) : V = m[46], V;
|
|
76
|
+
}, ProviderLabel = (t) => {
|
|
77
|
+
let u = c(4), { provider: d } = t, p;
|
|
78
|
+
u[0] === d ? p = u[1] : (p = d.charAt(0).toUpperCase(), u[0] = d, u[1] = p);
|
|
79
|
+
let m = p + d.slice(1), h;
|
|
80
|
+
return u[2] === m ? h = u[3] : (h = /* @__PURE__ */ jsx(Fragment$1, { children: m }), u[2] = m, u[3] = h), h;
|
|
81
|
+
}, StatusDisplay = (t) => {
|
|
82
|
+
let u = c(4), { status: d, provider: p, message: m } = t, h;
|
|
83
|
+
return u[0] !== m || u[1] !== p || u[2] !== d ? (h = /* @__PURE__ */ jsx("div", {
|
|
63
84
|
className: "flex items-center gap-3 py-1",
|
|
64
|
-
children:
|
|
85
|
+
children: d === "success" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
65
86
|
className: "flex h-6 w-6 items-center justify-center rounded-full bg-green-100 text-green-600 text-sm",
|
|
66
87
|
children: "✓"
|
|
67
88
|
}), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
|
|
68
89
|
className: "text-sm font-medium",
|
|
69
|
-
children: ["Connected to ", /* @__PURE__ */ jsx(ProviderLabel, { provider:
|
|
70
|
-
}),
|
|
90
|
+
children: ["Connected to ", /* @__PURE__ */ jsx(ProviderLabel, { provider: p })]
|
|
91
|
+
}), m && /* @__PURE__ */ jsx("div", {
|
|
71
92
|
className: "text-xs text-gray-500 mt-0.5",
|
|
72
|
-
children:
|
|
93
|
+
children: m
|
|
73
94
|
})] })] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
74
95
|
className: "flex h-6 w-6 items-center justify-center rounded-full bg-red-100 text-red-600 text-sm",
|
|
75
96
|
children: "✗"
|
|
76
97
|
}), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
|
|
77
98
|
className: "text-sm font-medium",
|
|
78
99
|
children: "Authentication failed"
|
|
79
|
-
}),
|
|
100
|
+
}), m && /* @__PURE__ */ jsx("div", {
|
|
80
101
|
className: "text-xs text-red-500 mt-0.5",
|
|
81
|
-
children:
|
|
102
|
+
children: m
|
|
82
103
|
})] })] })
|
|
83
|
-
}),
|
|
84
|
-
}, RetryButton = (
|
|
85
|
-
let
|
|
86
|
-
return
|
|
87
|
-
onClick:
|
|
104
|
+
}), u[0] = m, u[1] = p, u[2] = d, u[3] = h) : h = u[3], h;
|
|
105
|
+
}, RetryButton = (t) => {
|
|
106
|
+
let u = c(2), { onClick: d } = t, p;
|
|
107
|
+
return u[0] === d ? p = u[1] : (p = /* @__PURE__ */ jsx("button", {
|
|
108
|
+
onClick: d,
|
|
88
109
|
className: "mt-3 rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50",
|
|
89
110
|
children: "Try again"
|
|
90
|
-
}),
|
|
91
|
-
}, PopupResultView = (
|
|
92
|
-
let
|
|
93
|
-
switch (
|
|
111
|
+
}), u[0] = d, u[1] = p), p;
|
|
112
|
+
}, PopupResultView = (t) => {
|
|
113
|
+
let u = c(47), { result: d, provider: p, isActive: m, isSubmitting: h, onSignIn: g, onRetry: _ } = t;
|
|
114
|
+
switch (d.status) {
|
|
94
115
|
case "idle": {
|
|
95
|
-
let
|
|
96
|
-
|
|
116
|
+
let t;
|
|
117
|
+
u[0] === p ? t = u[1] : (t = /* @__PURE__ */ jsxs("div", {
|
|
97
118
|
className: "text-sm font-medium mb-1",
|
|
98
119
|
children: [
|
|
99
120
|
"Connect your ",
|
|
100
|
-
/* @__PURE__ */ jsx(ProviderLabel, { provider:
|
|
121
|
+
/* @__PURE__ */ jsx(ProviderLabel, { provider: p }),
|
|
101
122
|
" account"
|
|
102
123
|
]
|
|
103
|
-
}),
|
|
104
|
-
let
|
|
105
|
-
|
|
124
|
+
}), u[0] = p, u[1] = t);
|
|
125
|
+
let d;
|
|
126
|
+
u[2] === p ? d = u[3] : (d = /* @__PURE__ */ jsxs("div", {
|
|
106
127
|
className: "text-xs text-gray-500 mb-3",
|
|
107
128
|
children: [
|
|
108
129
|
"This workflow needs access to your ",
|
|
109
|
-
/* @__PURE__ */ jsx(ProviderLabel, { provider:
|
|
130
|
+
/* @__PURE__ */ jsx(ProviderLabel, { provider: p }),
|
|
110
131
|
" resources."
|
|
111
132
|
]
|
|
112
|
-
}),
|
|
113
|
-
let l;
|
|
114
|
-
o[4] !== d || o[5] !== p || o[6] !== u ? (l = d && /* @__PURE__ */ jsxs("button", {
|
|
115
|
-
onClick: p,
|
|
116
|
-
className: "rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50",
|
|
117
|
-
children: ["Sign in with ", /* @__PURE__ */ jsx(ProviderLabel, { provider: u })]
|
|
118
|
-
}), o[4] = d, o[5] = p, o[6] = u, o[7] = l) : l = o[7];
|
|
133
|
+
}), u[2] = p, u[3] = d);
|
|
119
134
|
let f;
|
|
120
|
-
|
|
135
|
+
u[4] !== m || u[5] !== g || u[6] !== p ? (f = m && /* @__PURE__ */ jsxs("button", {
|
|
136
|
+
onClick: g,
|
|
137
|
+
className: "rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50",
|
|
138
|
+
children: ["Sign in with ", /* @__PURE__ */ jsx(ProviderLabel, { provider: p })]
|
|
139
|
+
}), u[4] = m, u[5] = g, u[6] = p, u[7] = f) : f = u[7];
|
|
140
|
+
let h;
|
|
141
|
+
return u[8] !== t || u[9] !== d || u[10] !== f ? (h = /* @__PURE__ */ jsxs("div", {
|
|
121
142
|
className: "py-1",
|
|
122
143
|
children: [
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
144
|
+
t,
|
|
145
|
+
d,
|
|
146
|
+
f
|
|
126
147
|
]
|
|
127
|
-
}),
|
|
148
|
+
}), u[8] = t, u[9] = d, u[10] = f, u[11] = h) : h = u[11], h;
|
|
128
149
|
}
|
|
129
150
|
case "pending": {
|
|
130
|
-
let
|
|
131
|
-
|
|
151
|
+
let t, d;
|
|
152
|
+
u[12] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ jsxs("div", {
|
|
132
153
|
className: "flex items-center gap-3",
|
|
133
154
|
children: [/* @__PURE__ */ jsx("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-600" }), /* @__PURE__ */ jsx("div", {
|
|
134
155
|
className: "text-sm font-medium",
|
|
135
156
|
children: "Waiting for authentication..."
|
|
136
157
|
})]
|
|
137
|
-
}),
|
|
158
|
+
}), d = /* @__PURE__ */ jsx("div", {
|
|
138
159
|
className: "text-xs text-gray-500 mt-2",
|
|
139
160
|
children: "Complete the sign-in in the popup window."
|
|
140
|
-
}),
|
|
141
|
-
let
|
|
142
|
-
|
|
161
|
+
}), u[12] = t, u[13] = d) : (t = u[12], d = u[13]);
|
|
162
|
+
let f;
|
|
163
|
+
u[14] !== m || u[15] !== _ ? (f = m && /* @__PURE__ */ jsx("div", {
|
|
143
164
|
className: "mt-3 flex gap-2",
|
|
144
165
|
children: /* @__PURE__ */ jsx("button", {
|
|
145
|
-
onClick:
|
|
166
|
+
onClick: _,
|
|
146
167
|
className: "rounded-md border border-gray-300 bg-white px-3 py-1.5 text-xs font-medium text-gray-600 hover:bg-gray-50",
|
|
147
168
|
children: "Retry"
|
|
148
169
|
})
|
|
149
|
-
}),
|
|
150
|
-
let
|
|
151
|
-
return
|
|
170
|
+
}), u[14] = m, u[15] = _, u[16] = f) : f = u[16];
|
|
171
|
+
let p;
|
|
172
|
+
return u[17] === f ? p = u[18] : (p = /* @__PURE__ */ jsxs("div", {
|
|
152
173
|
className: "py-1",
|
|
153
174
|
children: [
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
175
|
+
t,
|
|
176
|
+
d,
|
|
177
|
+
f
|
|
157
178
|
]
|
|
158
|
-
}),
|
|
179
|
+
}), u[17] = f, u[18] = p), p;
|
|
159
180
|
}
|
|
160
181
|
case "success": {
|
|
161
|
-
let
|
|
162
|
-
return
|
|
182
|
+
let t;
|
|
183
|
+
return u[19] !== h || u[20] !== p ? (t = /* @__PURE__ */ jsx("div", {
|
|
163
184
|
className: "py-1",
|
|
164
|
-
children:
|
|
185
|
+
children: h ? /* @__PURE__ */ jsxs("div", {
|
|
165
186
|
className: "flex items-center gap-3",
|
|
166
187
|
children: [/* @__PURE__ */ jsx("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-600" }), /* @__PURE__ */ jsx("div", {
|
|
167
188
|
className: "text-sm font-medium",
|
|
@@ -169,55 +190,64 @@ var OAuthPromptRenderer = ({ parentWorkflow: l, workflow: u, document: m, isActi
|
|
|
169
190
|
})]
|
|
170
191
|
}) : /* @__PURE__ */ jsx(StatusDisplay, {
|
|
171
192
|
status: "success",
|
|
172
|
-
provider:
|
|
193
|
+
provider: p
|
|
173
194
|
})
|
|
174
|
-
}),
|
|
195
|
+
}), u[19] = h, u[20] = p, u[21] = t) : t = u[21], t;
|
|
175
196
|
}
|
|
176
197
|
case "error": {
|
|
177
|
-
let
|
|
178
|
-
|
|
198
|
+
let t;
|
|
199
|
+
u[22] !== p || u[23] !== d.error ? (t = /* @__PURE__ */ jsx(StatusDisplay, {
|
|
179
200
|
status: "error",
|
|
180
|
-
provider:
|
|
181
|
-
message:
|
|
182
|
-
}),
|
|
183
|
-
let l;
|
|
184
|
-
o[25] !== d || o[26] !== m ? (l = d && /* @__PURE__ */ jsx(RetryButton, { onClick: m }), o[25] = d, o[26] = m, o[27] = l) : l = o[27];
|
|
201
|
+
provider: p,
|
|
202
|
+
message: d.error
|
|
203
|
+
}), u[22] = p, u[23] = d.error, u[24] = t) : t = u[24];
|
|
185
204
|
let f;
|
|
186
|
-
|
|
205
|
+
u[25] !== m || u[26] !== _ ? (f = m && /* @__PURE__ */ jsx(RetryButton, { onClick: _ }), u[25] = m, u[26] = _, u[27] = f) : f = u[27];
|
|
206
|
+
let h;
|
|
207
|
+
return u[28] !== t || u[29] !== f ? (h = /* @__PURE__ */ jsxs("div", {
|
|
187
208
|
className: "py-1",
|
|
188
|
-
children: [
|
|
189
|
-
}),
|
|
209
|
+
children: [t, f]
|
|
210
|
+
}), u[28] = t, u[29] = f, u[30] = h) : h = u[30], h;
|
|
190
211
|
}
|
|
191
212
|
case "timeout": {
|
|
192
|
-
let
|
|
193
|
-
|
|
213
|
+
let t;
|
|
214
|
+
u[31] === p ? t = u[32] : (t = /* @__PURE__ */ jsx(StatusDisplay, {
|
|
194
215
|
status: "error",
|
|
195
|
-
provider:
|
|
216
|
+
provider: p,
|
|
196
217
|
message: "Authentication timed out."
|
|
197
|
-
}),
|
|
198
|
-
let
|
|
199
|
-
|
|
200
|
-
let
|
|
201
|
-
return
|
|
218
|
+
}), u[31] = p, u[32] = t);
|
|
219
|
+
let d;
|
|
220
|
+
u[33] !== m || u[34] !== _ ? (d = m && /* @__PURE__ */ jsx(RetryButton, { onClick: _ }), u[33] = m, u[34] = _, u[35] = d) : d = u[35];
|
|
221
|
+
let f;
|
|
222
|
+
return u[36] !== t || u[37] !== d ? (f = /* @__PURE__ */ jsxs("div", {
|
|
202
223
|
className: "py-1",
|
|
203
|
-
children: [
|
|
204
|
-
}),
|
|
224
|
+
children: [t, d]
|
|
225
|
+
}), u[36] = t, u[37] = d, u[38] = f) : f = u[38], f;
|
|
205
226
|
}
|
|
206
227
|
case "blocked": {
|
|
207
|
-
let
|
|
208
|
-
|
|
228
|
+
let t;
|
|
229
|
+
u[39] === p ? t = u[40] : (t = /* @__PURE__ */ jsx(StatusDisplay, {
|
|
209
230
|
status: "error",
|
|
210
|
-
provider:
|
|
231
|
+
provider: p,
|
|
211
232
|
message: "Popup was blocked by the browser. Please allow popups for this site and try again."
|
|
212
|
-
}),
|
|
213
|
-
let
|
|
214
|
-
|
|
215
|
-
let
|
|
216
|
-
return
|
|
233
|
+
}), u[39] = p, u[40] = t);
|
|
234
|
+
let d;
|
|
235
|
+
u[41] !== m || u[42] !== _ ? (d = m && /* @__PURE__ */ jsx(RetryButton, { onClick: _ }), u[41] = m, u[42] = _, u[43] = d) : d = u[43];
|
|
236
|
+
let f;
|
|
237
|
+
return u[44] !== t || u[45] !== d ? (f = /* @__PURE__ */ jsxs("div", {
|
|
217
238
|
className: "py-1",
|
|
218
|
-
children: [
|
|
219
|
-
}),
|
|
239
|
+
children: [t, d]
|
|
240
|
+
}), u[44] = t, u[45] = d, u[46] = f) : f = u[46], f;
|
|
220
241
|
}
|
|
221
242
|
}
|
|
222
243
|
}, OAuthPromptRenderer_default = OAuthPromptRenderer;
|
|
244
|
+
function _temp(t) {
|
|
245
|
+
return t.options?.transition;
|
|
246
|
+
}
|
|
247
|
+
function _temp2(t) {
|
|
248
|
+
return !!t;
|
|
249
|
+
}
|
|
250
|
+
function _temp3(t) {
|
|
251
|
+
return t.id;
|
|
252
|
+
}
|
|
223
253
|
export { OAuthPromptRenderer_default as default };
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { Button } from "../../../components/ui/button.js";
|
|
2
|
+
import { Input } from "../../../components/ui/input.js";
|
|
3
|
+
import { Label } from "../../../components/ui/label.js";
|
|
4
|
+
import { useWorkbenchLayout } from "../../workbench/providers/WorkbenchLayoutProvider.js";
|
|
5
|
+
import { SidebarPanel } from "../../workbench/components/SidebarPanel.js";
|
|
6
|
+
import "../../workbench/index.js";
|
|
7
|
+
import { useCreateSecret, useDeleteSecret, useUpdateSecret, useWorkspaceSecrets } from "../../../hooks/useSecrets.js";
|
|
8
|
+
import { c } from "react/compiler-runtime";
|
|
9
|
+
import { useState } from "react";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { KeyRound, Loader2, Plus, Trash2 } from "lucide-react";
|
|
12
|
+
function WorkbenchSecretsPanel(h) {
|
|
13
|
+
let g = c(51), { workspaceId: _ } = h, { panelSize: v, setPanelSize: y, closePanel: b } = useWorkbenchLayout(), { data: x, isLoading: S } = useWorkspaceSecrets(_), C = useCreateSecret(), w = useUpdateSecret(), T = useDeleteSecret(), [E, D] = useState(""), [O, k] = useState(""), [A, j] = useState(null), [M, N] = useState(""), P;
|
|
14
|
+
g[0] !== C || g[1] !== E || g[2] !== O || g[3] !== _ ? (P = async () => {
|
|
15
|
+
!_ || !E.trim() || !O.trim() || (await C.mutateAsync({
|
|
16
|
+
workspaceId: _,
|
|
17
|
+
key: E.trim(),
|
|
18
|
+
value: O
|
|
19
|
+
}), D(""), k(""));
|
|
20
|
+
}, g[0] = C, g[1] = E, g[2] = O, g[3] = _, g[4] = P) : P = g[4];
|
|
21
|
+
let F = P, I;
|
|
22
|
+
g[5] !== M || g[6] !== w || g[7] !== _ ? (I = async (n) => {
|
|
23
|
+
!_ || !M || (await w.mutateAsync({
|
|
24
|
+
workspaceId: _,
|
|
25
|
+
id: n,
|
|
26
|
+
value: M
|
|
27
|
+
}), j(null), N(""));
|
|
28
|
+
}, g[5] = M, g[6] = w, g[7] = _, g[8] = I) : I = g[8];
|
|
29
|
+
let L = I, R;
|
|
30
|
+
g[9] !== T || g[10] !== _ ? (R = async (n) => {
|
|
31
|
+
_ && await T.mutateAsync({
|
|
32
|
+
workspaceId: _,
|
|
33
|
+
id: n
|
|
34
|
+
});
|
|
35
|
+
}, g[9] = T, g[10] = _, g[11] = R) : R = g[11];
|
|
36
|
+
let z = R, B;
|
|
37
|
+
g[12] === Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ jsx(KeyRound, { className: "h-4 w-4" }), g[12] = B) : B = g[12];
|
|
38
|
+
let V;
|
|
39
|
+
g[13] !== M || g[14] !== A || g[15] !== z || g[16] !== L || g[17] !== S || g[18] !== x ? (V = /* @__PURE__ */ jsx("div", {
|
|
40
|
+
className: "flex-1 overflow-y-auto px-4 py-3",
|
|
41
|
+
children: S ? /* @__PURE__ */ jsxs("div", {
|
|
42
|
+
className: "flex items-center gap-2 py-4",
|
|
43
|
+
children: [/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), /* @__PURE__ */ jsx("span", {
|
|
44
|
+
className: "text-muted-foreground text-sm",
|
|
45
|
+
children: "Loading..."
|
|
46
|
+
})]
|
|
47
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
48
|
+
className: "space-y-2",
|
|
49
|
+
children: [x?.map((m) => /* @__PURE__ */ jsxs("div", {
|
|
50
|
+
className: "bg-muted/50 flex items-center gap-2 rounded-md px-3 py-2",
|
|
51
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
52
|
+
className: "flex-1",
|
|
53
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
54
|
+
className: "font-mono text-sm",
|
|
55
|
+
children: m.key
|
|
56
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
57
|
+
className: "text-muted-foreground text-xs",
|
|
58
|
+
children: m.hasValue ? "Value set" : "No value"
|
|
59
|
+
})]
|
|
60
|
+
}), A === m.id ? /* @__PURE__ */ jsxs("div", {
|
|
61
|
+
className: "flex items-center gap-1",
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ jsx(Input, {
|
|
64
|
+
type: "password",
|
|
65
|
+
value: M,
|
|
66
|
+
onChange: (n) => N(n.target.value),
|
|
67
|
+
placeholder: "New value",
|
|
68
|
+
className: "h-7 w-32 text-xs"
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ jsx(Button, {
|
|
71
|
+
size: "sm",
|
|
72
|
+
variant: "outline",
|
|
73
|
+
className: "h-7 text-xs",
|
|
74
|
+
onClick: () => void L(m.id),
|
|
75
|
+
children: "Save"
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ jsx(Button, {
|
|
78
|
+
size: "sm",
|
|
79
|
+
variant: "ghost",
|
|
80
|
+
className: "h-7 text-xs",
|
|
81
|
+
onClick: () => {
|
|
82
|
+
j(null), N("");
|
|
83
|
+
},
|
|
84
|
+
children: "Cancel"
|
|
85
|
+
})
|
|
86
|
+
]
|
|
87
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
88
|
+
className: "flex items-center gap-1",
|
|
89
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
90
|
+
size: "sm",
|
|
91
|
+
variant: "ghost",
|
|
92
|
+
className: "h-7 text-xs",
|
|
93
|
+
onClick: () => {
|
|
94
|
+
j(m.id), N("");
|
|
95
|
+
},
|
|
96
|
+
children: "Update"
|
|
97
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
98
|
+
size: "sm",
|
|
99
|
+
variant: "ghost",
|
|
100
|
+
className: "h-7",
|
|
101
|
+
onClick: () => void z(m.id),
|
|
102
|
+
children: /* @__PURE__ */ jsx(Trash2, { className: "h-3 w-3" })
|
|
103
|
+
})]
|
|
104
|
+
})]
|
|
105
|
+
}, m.id)), x?.length === 0 && /* @__PURE__ */ jsx("p", {
|
|
106
|
+
className: "text-muted-foreground py-4 text-center text-sm",
|
|
107
|
+
children: "No secrets yet."
|
|
108
|
+
})]
|
|
109
|
+
})
|
|
110
|
+
}), g[13] = M, g[14] = A, g[15] = z, g[16] = L, g[17] = S, g[18] = x, g[19] = V) : V = g[19];
|
|
111
|
+
let H;
|
|
112
|
+
g[20] === Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ jsx(Label, {
|
|
113
|
+
className: "text-xs",
|
|
114
|
+
children: "Add Secret"
|
|
115
|
+
}), g[20] = H) : H = g[20];
|
|
116
|
+
let U;
|
|
117
|
+
g[21] === Symbol.for("react.memo_cache_sentinel") ? (U = (n) => D(n.target.value), g[21] = U) : U = g[21];
|
|
118
|
+
let W;
|
|
119
|
+
g[22] === E ? W = g[23] : (W = /* @__PURE__ */ jsx(Input, {
|
|
120
|
+
value: E,
|
|
121
|
+
onChange: U,
|
|
122
|
+
placeholder: "KEY_NAME",
|
|
123
|
+
className: "font-mono text-sm"
|
|
124
|
+
}), g[22] = E, g[23] = W);
|
|
125
|
+
let G;
|
|
126
|
+
g[24] === Symbol.for("react.memo_cache_sentinel") ? (G = (n) => k(n.target.value), g[24] = G) : G = g[24];
|
|
127
|
+
let K;
|
|
128
|
+
g[25] === O ? K = g[26] : (K = /* @__PURE__ */ jsx(Input, {
|
|
129
|
+
type: "password",
|
|
130
|
+
value: O,
|
|
131
|
+
onChange: G,
|
|
132
|
+
placeholder: "Value",
|
|
133
|
+
className: "text-sm"
|
|
134
|
+
}), g[25] = O, g[26] = K);
|
|
135
|
+
let q;
|
|
136
|
+
g[27] !== C.isPending || g[28] !== E || g[29] !== O ? (q = !E.trim() || !O.trim() || C.isPending, g[27] = C.isPending, g[28] = E, g[29] = O, g[30] = q) : q = g[30];
|
|
137
|
+
let J;
|
|
138
|
+
g[31] === F ? J = g[32] : (J = () => void F(), g[31] = F, g[32] = J);
|
|
139
|
+
let Y;
|
|
140
|
+
g[33] === C.isPending ? Y = g[34] : (Y = C.isPending ? /* @__PURE__ */ jsx(Loader2, { className: "mr-1 h-3 w-3 animate-spin" }) : /* @__PURE__ */ jsx(Plus, { className: "mr-1 h-3 w-3" }), g[33] = C.isPending, g[34] = Y);
|
|
141
|
+
let X;
|
|
142
|
+
g[35] !== q || g[36] !== J || g[37] !== Y ? (X = /* @__PURE__ */ jsxs(Button, {
|
|
143
|
+
size: "sm",
|
|
144
|
+
className: "w-full",
|
|
145
|
+
disabled: q,
|
|
146
|
+
onClick: J,
|
|
147
|
+
children: [Y, "Add Secret"]
|
|
148
|
+
}), g[35] = q, g[36] = J, g[37] = Y, g[38] = X) : X = g[38];
|
|
149
|
+
let Z;
|
|
150
|
+
g[39] !== K || g[40] !== X || g[41] !== W ? (Z = /* @__PURE__ */ jsx("div", {
|
|
151
|
+
className: "border-t px-4 py-3",
|
|
152
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
153
|
+
className: "space-y-2",
|
|
154
|
+
children: [
|
|
155
|
+
H,
|
|
156
|
+
W,
|
|
157
|
+
K,
|
|
158
|
+
X
|
|
159
|
+
]
|
|
160
|
+
})
|
|
161
|
+
}), g[39] = K, g[40] = X, g[41] = W, g[42] = Z) : Z = g[42];
|
|
162
|
+
let Q;
|
|
163
|
+
g[43] !== Z || g[44] !== V ? (Q = /* @__PURE__ */ jsxs("div", {
|
|
164
|
+
className: "flex h-full flex-col",
|
|
165
|
+
children: [V, Z]
|
|
166
|
+
}), g[43] = Z, g[44] = V, g[45] = Q) : Q = g[45];
|
|
167
|
+
let $;
|
|
168
|
+
return g[46] !== b || g[47] !== v || g[48] !== y || g[49] !== Q ? ($ = /* @__PURE__ */ jsx(SidebarPanel, {
|
|
169
|
+
icon: B,
|
|
170
|
+
title: "Secrets",
|
|
171
|
+
description: "Manage environment variables for this workspace.",
|
|
172
|
+
size: v,
|
|
173
|
+
onSizeChange: y,
|
|
174
|
+
onClose: b,
|
|
175
|
+
children: Q
|
|
176
|
+
}), g[46] = b, g[47] = v, g[48] = y, g[49] = Q, g[50] = $) : $ = g[50], $;
|
|
177
|
+
}
|
|
178
|
+
export { WorkbenchSecretsPanel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { secretsFeature } from "./secrets-feature.js";
|