@loopstack/loopstack-studio 0.21.2 → 0.22.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/auth.js +10 -0
- package/dist/api/client.js +13 -0
- package/dist/api/config.js +10 -0
- package/dist/api/dashboard.js +4 -0
- package/dist/api/documents.js +7 -0
- package/dist/api/index.js +24 -0
- package/dist/api/namespaces.js +7 -0
- package/dist/api/pipelines.js +13 -0
- package/dist/api/processor.js +4 -0
- package/dist/api/workflows.js +8 -0
- package/dist/api/workspaces.js +12 -0
- package/dist/app/EnvironmentEmbedRoot.js +33 -0
- package/dist/components/data-table/DataTableFilters.js +74 -63
- package/dist/components/layout/MainLayout.js +7 -4
- package/dist/components/page/PageBreadcrumbs.js +1 -1
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/sidebar.js +359 -359
- package/dist/components/ui/textarea.js +1 -1
- package/dist/components/ui-widgets/UiActions.js +22 -15
- package/dist/components/ui-widgets/UiWidget.js +31 -26
- package/dist/components/ui-widgets/widgets/AiPromptInput.js +27 -27
- package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +12 -12
- package/dist/components/ui-widgets/widgets/SandboxRun.js +32 -0
- package/dist/components/ui-widgets/widgets/SubmitButton.js +11 -11
- package/dist/features/code-explorer/utils/fileIcons.js +4 -7
- package/dist/features/oauth/OAuthPromptRenderer.js +1 -1
- package/dist/features/runs/Runs.js +197 -0
- package/dist/features/workbench/NavigationItems.js +1 -1
- package/dist/features/workbench/Workbench.js +109 -75
- package/dist/features/workbench/WorkflowItem.js +8 -11
- package/dist/features/workbench/WorkflowList.js +29 -20
- package/dist/features/workbench/components/DocumentList.js +20 -20
- package/dist/features/workbench/components/NewRunDialog.js +328 -0
- package/dist/features/workbench/components/WorkbenchFloatingPanel.js +88 -0
- package/dist/features/workbench/components/WorkbenchFlowPanel.js +48 -0
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +68 -0
- package/dist/features/workbench/components/WorkbenchPreviewPanel.js +128 -0
- package/dist/features/workbench/components/WorkflowForms.js +7 -6
- package/dist/features/workbench/components/WorkflowHistoryItem.js +68 -63
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +79 -61
- package/dist/features/workbench/components/document-renderer/DocumentFormRenderer.js +6 -5
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +77 -0
- package/dist/features/workspaces/Workspaces.js +2 -2
- package/dist/features/workspaces/components/CreateWorkspace.js +164 -81
- package/dist/features/workspaces/components/EnvironmentSlotSelector.js +63 -0
- package/dist/features/workspaces/components/ExecutionTimeline.js +69 -68
- package/dist/features/workspaces/components/PipelineForm.js +4 -4
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/useApi.js +9 -33
- package/dist/hooks/useAuth.js +18 -38
- package/dist/hooks/useConfig.js +31 -33
- package/dist/hooks/useDashboard.js +1 -4
- package/dist/hooks/useDocuments.js +4 -8
- package/dist/hooks/useFiles.js +31 -41
- package/dist/hooks/useNamespaces.js +5 -8
- package/dist/hooks/usePipelines.js +98 -108
- package/dist/hooks/useProcessor.js +1 -4
- package/dist/hooks/useWorkflows.js +25 -41
- package/dist/hooks/useWorkspaces.js +45 -72
- package/dist/index.d.ts +266 -48
- package/dist/index.js +10 -2
- package/dist/packages/contracts/dist/enums/index.js +25 -0
- package/dist/packages/contracts/dist/enums/pipeline-state.js +10 -0
- package/dist/packages/contracts/dist/enums/registry.enum.js +20 -0
- package/dist/packages/contracts/dist/enums/sort-order.enum.js +10 -0
- package/dist/packages/contracts/dist/enums/user-type.enum.js +10 -0
- package/dist/packages/contracts/dist/enums/workflow-state.enum.js +10 -0
- package/dist/pages/DebugPage.js +12 -14
- package/dist/pages/DebugWorkflowDetailsPage.js +1 -1
- package/dist/pages/DebugWorkflowsPage.js +3 -4
- package/dist/pages/EmbedWorkbenchPage.js +4 -3
- package/dist/pages/PipelineDebugPage.js +2 -2
- package/dist/pages/PreviewWorkbenchPage.js +416 -0
- package/dist/pages/RunsListPage.js +36 -0
- package/dist/pages/RunsPage.js +49 -0
- package/dist/pages/StudioLandingPage.js +145 -0
- package/dist/pages/WorkbenchPage.js +75 -51
- package/dist/providers/InvalidationEventsProvider.js +7 -7
- package/dist/providers/QueryProvider.js +21 -0
- package/dist/routing/LocalRouter.js +9 -0
- package/dist/services/createApiClient.js +4 -10
- package/dist/services/index.js +1 -1
- package/package.json +2 -3
- package/dist/features/code-explorer/CodeExplorer.js +0 -69
- package/dist/features/code-explorer/components/CodeExplorerTree.js +0 -43
- package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +0 -82
- package/dist/features/workbench/components/WorkbenchSidebar.js +0 -109
- package/dist/features/workbench/providers/WorkbenchContextProvider.js +0 -3
|
@@ -1,101 +1,135 @@
|
|
|
1
1
|
import { useWorkspace } from "../../hooks/useWorkspaces.js";
|
|
2
|
-
import
|
|
2
|
+
import PageBreadcrumbs_default from "../../components/page/PageBreadcrumbs.js";
|
|
3
3
|
import { FileContentViewer } from "../code-explorer/components/FileContentViewer.js";
|
|
4
4
|
import { CodeExplorerProvider, useCodeExplorerContext } from "../code-explorer/providers/CodeExplorerProvider.js";
|
|
5
5
|
import { FileTabsBar } from "../code-explorer/components/FileTabsBar.js";
|
|
6
|
-
import {
|
|
7
|
-
import { WorkbenchContextProvider } from "./providers/WorkbenchContextProvider.js";
|
|
6
|
+
import { WorkbenchContextProvider, WorkbenchLayoutProvider, useWorkbenchLayout } from "./providers/WorkbenchLayoutProvider.js";
|
|
8
7
|
import WorkflowList_default from "./WorkflowList.js";
|
|
9
8
|
import { ScrollProvider } from "./providers/ScrollProvider.js";
|
|
10
|
-
import
|
|
9
|
+
import { WorkbenchFloatingPanel } from "./components/WorkbenchFloatingPanel.js";
|
|
10
|
+
import { WorkbenchFlowPanel } from "./components/WorkbenchFlowPanel.js";
|
|
11
|
+
import { WorkbenchIconSidebar } from "./components/WorkbenchIconSidebar.js";
|
|
12
|
+
import { WorkbenchPreviewPanel } from "./components/WorkbenchPreviewPanel.js";
|
|
11
13
|
import { c } from "react/compiler-runtime";
|
|
12
|
-
import {
|
|
14
|
+
import { useMemo } from "react";
|
|
13
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
16
|
function WorkbenchContent(e) {
|
|
15
|
-
let a = c(
|
|
16
|
-
a[0] ===
|
|
17
|
-
className: "flex-
|
|
18
|
-
children: /* @__PURE__ */ jsx(
|
|
19
|
-
className: "
|
|
20
|
-
children:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
a[2]
|
|
17
|
+
let a = c(16), { pipeline: l, breadcrumbData: u } = e, { openFiles: d, selectedFile: m, fileContent: h, workflowConfig: g, isContentLoading: _ } = useCodeExplorerContext(), v;
|
|
18
|
+
a[0] === u ? v = a[1] : (v = /* @__PURE__ */ jsx("div", {
|
|
19
|
+
className: "border-b flex h-12 shrink-0 items-center",
|
|
20
|
+
children: u ? /* @__PURE__ */ jsx(PageBreadcrumbs_default, { breadcrumbData: u }) : /* @__PURE__ */ jsx("span", {
|
|
21
|
+
className: "px-3 text-sm font-medium",
|
|
22
|
+
children: "Workflows"
|
|
23
|
+
})
|
|
24
|
+
}), a[0] = u, a[1] = v);
|
|
25
|
+
let b;
|
|
26
|
+
a[2] === l ? b = a[3] : (b = /* @__PURE__ */ jsx(ScrollProvider, { children: /* @__PURE__ */ jsx("div", {
|
|
27
|
+
className: "flex-1 overflow-auto",
|
|
28
|
+
children: /* @__PURE__ */ jsx(WorkflowList_default, { pipeline: l })
|
|
29
|
+
}) }), a[2] = l, a[3] = b);
|
|
30
|
+
let x;
|
|
31
|
+
a[4] !== v || a[5] !== b ? (x = /* @__PURE__ */ jsxs("div", {
|
|
32
|
+
className: "flex flex-1 flex-col overflow-hidden",
|
|
33
|
+
children: [v, b]
|
|
34
|
+
}), a[4] = v, a[5] = b, a[6] = x) : x = a[6];
|
|
35
|
+
let S;
|
|
36
|
+
a[7] !== h || a[8] !== _ || a[9] !== d.length || a[10] !== m || a[11] !== g ? (S = d.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
28
37
|
className: "w-full md:w-1/2 shrink-0 overflow-hidden flex flex-col",
|
|
29
38
|
children: [/* @__PURE__ */ jsx(FileTabsBar, {}), /* @__PURE__ */ jsx("div", {
|
|
30
39
|
className: "flex-1 overflow-hidden",
|
|
31
40
|
children: /* @__PURE__ */ jsx(FileContentViewer, {
|
|
32
|
-
selectedFile:
|
|
33
|
-
content:
|
|
34
|
-
workflowConfig:
|
|
41
|
+
selectedFile: m,
|
|
42
|
+
content: h,
|
|
43
|
+
workflowConfig: g,
|
|
35
44
|
isLoading: _,
|
|
36
45
|
className: "h-full"
|
|
37
46
|
})
|
|
38
47
|
})]
|
|
39
|
-
}), a[
|
|
40
|
-
let
|
|
41
|
-
return a[
|
|
48
|
+
}), a[7] = h, a[8] = _, a[9] = d.length, a[10] = m, a[11] = g, a[12] = S) : S = a[12];
|
|
49
|
+
let C;
|
|
50
|
+
return a[13] !== x || a[14] !== S ? (C = /* @__PURE__ */ jsx("div", {
|
|
42
51
|
className: "flex h-full flex-col",
|
|
43
52
|
children: /* @__PURE__ */ jsxs("div", {
|
|
44
53
|
className: "flex flex-1 gap-4 overflow-hidden md:flex-row flex-col",
|
|
45
|
-
children: [
|
|
54
|
+
children: [x, S]
|
|
46
55
|
})
|
|
47
|
-
}), a[
|
|
56
|
+
}), a[13] = x, a[14] = S, a[15] = C) : C = a[15], C;
|
|
48
57
|
}
|
|
49
|
-
function
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
let
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
let
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
pipeline: f,
|
|
77
|
-
workspaceConfig: j
|
|
78
|
-
}), d[9] = h, d[10] = f, d[11] = j, d[12] = M) : M = d[12];
|
|
79
|
-
let N;
|
|
80
|
-
d[13] !== A || d[14] !== M ? (N = /* @__PURE__ */ jsxs(SidebarProvider, {
|
|
81
|
-
defaultOpen: !0,
|
|
82
|
-
className: "workbench-sidebar min-h-0",
|
|
58
|
+
function WorkbenchInner(e) {
|
|
59
|
+
let r = c(26), { pipeline: i, breadcrumbData: a } = e, { activeSidePanel: o, activeSectionId: s, setActiveSectionId: u } = useWorkbenchLayout(), f;
|
|
60
|
+
r[0] === s ? f = r[1] : (f = { activeSectionId: s }, r[0] = s, r[1] = f);
|
|
61
|
+
let p;
|
|
62
|
+
r[2] !== u || r[3] !== f ? (p = {
|
|
63
|
+
state: f,
|
|
64
|
+
setActiveSectionId: u
|
|
65
|
+
}, r[2] = u, r[3] = f, r[4] = p) : p = r[4];
|
|
66
|
+
let v = p, x = o ? "w-1/2 overflow-hidden" : "w-full overflow-hidden", S;
|
|
67
|
+
r[5] !== a || r[6] !== i ? (S = /* @__PURE__ */ jsx(WorkbenchContent, {
|
|
68
|
+
pipeline: i,
|
|
69
|
+
breadcrumbData: a
|
|
70
|
+
}), r[5] = a, r[6] = i, r[7] = S) : S = r[7];
|
|
71
|
+
let C;
|
|
72
|
+
r[8] !== x || r[9] !== S ? (C = /* @__PURE__ */ jsx("div", {
|
|
73
|
+
className: x,
|
|
74
|
+
children: S
|
|
75
|
+
}), r[8] = x, r[9] = S, r[10] = C) : C = r[10];
|
|
76
|
+
let w;
|
|
77
|
+
r[11] === o ? w = r[12] : (w = o === "preview" && /* @__PURE__ */ jsx(WorkbenchPreviewPanel, {}), r[11] = o, r[12] = w);
|
|
78
|
+
let T;
|
|
79
|
+
r[13] === o ? T = r[14] : (T = o === "flow" && /* @__PURE__ */ jsx(WorkbenchFlowPanel, {}), r[13] = o, r[14] = T);
|
|
80
|
+
let E;
|
|
81
|
+
r[15] === Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ jsx(WorkbenchFloatingPanel, {}), r[15] = E) : E = r[15];
|
|
82
|
+
let D;
|
|
83
|
+
r[16] !== C || r[17] !== w || r[18] !== T ? (D = /* @__PURE__ */ jsxs("div", {
|
|
84
|
+
className: "relative flex flex-1 overflow-hidden",
|
|
83
85
|
children: [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
C,
|
|
87
|
+
w,
|
|
88
|
+
T,
|
|
89
|
+
E
|
|
87
90
|
]
|
|
88
|
-
}),
|
|
89
|
-
let
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
91
|
+
}), r[16] = C, r[17] = w, r[18] = T, r[19] = D) : D = r[19];
|
|
92
|
+
let O;
|
|
93
|
+
r[20] === Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ jsx(WorkbenchIconSidebar, {}), r[20] = O) : O = r[20];
|
|
94
|
+
let k;
|
|
95
|
+
r[21] === D ? k = r[22] : (k = /* @__PURE__ */ jsxs("div", {
|
|
96
|
+
className: "flex h-full w-full",
|
|
97
|
+
children: [D, O]
|
|
98
|
+
}), r[21] = D, r[22] = k);
|
|
99
|
+
let A;
|
|
100
|
+
return r[23] !== v || r[24] !== k ? (A = /* @__PURE__ */ jsx(WorkbenchContextProvider.Provider, {
|
|
101
|
+
value: v,
|
|
102
|
+
children: k
|
|
103
|
+
}), r[23] = v, r[24] = k, r[25] = A) : A = r[25], A;
|
|
104
|
+
}
|
|
105
|
+
function Workbench(r) {
|
|
106
|
+
let i = c(19), { pipeline: o, breadcrumbData: s, previewPanelOpen: l, onPreviewPanelOpenChange: d, isDeveloperMode: f, getPreviewUrl: p, getEnvironmentPreviewUrl: m, environments: h } = r, g = o?.workspaceId, _ = useWorkspace(g), v = _.data?.features?.fileExplorer?.enabled ?? !1, y;
|
|
107
|
+
i[0] === _.data ? y = i[1] : (y = _.data ? {
|
|
108
|
+
volumes: _.data.volumes,
|
|
109
|
+
features: _.data.features
|
|
110
|
+
} : void 0, i[0] = _.data, i[1] = y);
|
|
111
|
+
let b = y, S = h ?? _.data?.environments, C = o?.id, w;
|
|
112
|
+
i[2] !== s || i[3] !== o ? (w = /* @__PURE__ */ jsx(WorkbenchInner, {
|
|
113
|
+
pipeline: o,
|
|
114
|
+
breadcrumbData: s
|
|
115
|
+
}), i[2] = s, i[3] = o, i[4] = w) : w = i[4];
|
|
116
|
+
let T;
|
|
117
|
+
i[5] !== v || i[6] !== C || i[7] !== w ? (T = /* @__PURE__ */ jsx(CodeExplorerProvider, {
|
|
118
|
+
pipelineId: C,
|
|
119
|
+
fileExplorerEnabled: v,
|
|
120
|
+
children: w
|
|
121
|
+
}), i[5] = v, i[6] = C, i[7] = w, i[8] = T) : T = i[8];
|
|
122
|
+
let E;
|
|
123
|
+
return i[9] !== m || i[10] !== p || i[11] !== f || i[12] !== d || i[13] !== o || i[14] !== l || i[15] !== S || i[16] !== T || i[17] !== b ? (E = /* @__PURE__ */ jsx(WorkbenchLayoutProvider, {
|
|
124
|
+
pipeline: o,
|
|
125
|
+
isDeveloperMode: f,
|
|
126
|
+
workspaceConfig: b,
|
|
127
|
+
getPreviewUrl: p,
|
|
128
|
+
getEnvironmentPreviewUrl: m,
|
|
129
|
+
environments: S,
|
|
130
|
+
previewPanelOpen: l,
|
|
131
|
+
onPreviewPanelOpenChange: d,
|
|
132
|
+
children: T
|
|
133
|
+
}), i[9] = m, i[10] = p, i[11] = f, i[12] = d, i[13] = o, i[14] = l, i[15] = S, i[16] = T, i[17] = b, i[18] = E) : E = i[18], E;
|
|
100
134
|
}
|
|
101
135
|
export { Workbench as default };
|
|
@@ -3,15 +3,15 @@ import { useWorkflow } from "../../hooks/useWorkflows.js";
|
|
|
3
3
|
import { cn } from "../../lib/utils.js";
|
|
4
4
|
import ErrorSnackbar_default from "../../components/snackbars/ErrorSnackbar.js";
|
|
5
5
|
import LoadingCentered_default from "../../components/LoadingCentered.js";
|
|
6
|
+
import { require_enums } from "../../packages/contracts/dist/enums/index.js";
|
|
6
7
|
import { useRunPipeline } from "../../hooks/useProcessor.js";
|
|
7
8
|
import DocumentList_default from "./components/DocumentList.js";
|
|
8
9
|
import WorkflowForms_default from "./components/WorkflowForms.js";
|
|
9
10
|
import ErrorAlert_default from "../../components/content/ErrorAlert.js";
|
|
10
|
-
import WorkflowButtons_default from "./components/buttons/WorkflowButtons.js";
|
|
11
11
|
import React, { useCallback, useEffect, useMemo } from "react";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useParams } from "react-router-dom";
|
|
14
|
-
var WorkflowItem_default = ({ pipeline: g, workflowId: _, scrollTo: v, settings: y, embed: b }) => {
|
|
14
|
+
var import_enums = require_enums(), WorkflowItem_default = ({ pipeline: g, workflowId: _, scrollTo: v, settings: y, embed: b }) => {
|
|
15
15
|
let { workflowId: x, clickId: S } = useParams(), C = useWorkflow(_), w = useFilterDocuments(_);
|
|
16
16
|
useEffect(() => {
|
|
17
17
|
x === _ && C.isSuccess && w.isSuccess && v(_);
|
|
@@ -35,9 +35,9 @@ var WorkflowItem_default = ({ pipeline: g, workflowId: _, scrollTo: v, settings:
|
|
|
35
35
|
payload: p
|
|
36
36
|
} }
|
|
37
37
|
});
|
|
38
|
-
}, k = D.isPending || C.data?.status ===
|
|
38
|
+
}, k = D.isPending || C.data?.status === import_enums.WorkflowState.Running;
|
|
39
39
|
return /* @__PURE__ */ jsxs("div", {
|
|
40
|
-
className: cn("flex flex-col", b ? "p-0" : "
|
|
40
|
+
className: cn("flex flex-col", b ? "p-0" : "p-4"),
|
|
41
41
|
children: [
|
|
42
42
|
/* @__PURE__ */ jsx(LoadingCentered_default, { loading: C.isLoading || w.isLoading }),
|
|
43
43
|
/* @__PURE__ */ jsx(ErrorSnackbar_default, { error: w.error }),
|
|
@@ -51,15 +51,12 @@ var WorkflowItem_default = ({ pipeline: g, workflowId: _, scrollTo: v, settings:
|
|
|
51
51
|
isLoading: k
|
|
52
52
|
}),
|
|
53
53
|
/* @__PURE__ */ jsx(LoadingCentered_default, { loading: k }),
|
|
54
|
-
!!C.data && !b && /* @__PURE__ */
|
|
55
|
-
className: "mt-
|
|
56
|
-
children:
|
|
54
|
+
!!C.data && !b && /* @__PURE__ */ jsx("div", {
|
|
55
|
+
className: "mt-6",
|
|
56
|
+
children: /* @__PURE__ */ jsx(WorkflowForms_default, {
|
|
57
57
|
workflow: C.data,
|
|
58
58
|
onSubmit: O
|
|
59
|
-
})
|
|
60
|
-
pipeline: g,
|
|
61
|
-
workflow: C.data
|
|
62
|
-
})]
|
|
59
|
+
})
|
|
63
60
|
})
|
|
64
61
|
]
|
|
65
62
|
});
|
|
@@ -3,16 +3,17 @@ import { cn } from "../../lib/utils.js";
|
|
|
3
3
|
import { Button } from "../../components/ui/button.js";
|
|
4
4
|
import ErrorSnackbar_default from "../../components/snackbars/ErrorSnackbar.js";
|
|
5
5
|
import LoadingCentered_default from "../../components/LoadingCentered.js";
|
|
6
|
+
import { WorkbenchContextProvider } from "./providers/WorkbenchLayoutProvider.js";
|
|
6
7
|
import WorkflowItem_default from "./WorkflowItem.js";
|
|
7
8
|
import { useScrollToBottom } from "./hooks/useAutoScrollBottom.js";
|
|
8
9
|
import { useIntersectionObserver } from "./hooks/useIntersectionObserver.js";
|
|
9
10
|
import { useScrollToListItem } from "./hooks/useScrollToListItem.js";
|
|
10
|
-
import { WorkbenchContextProvider } from "./providers/WorkbenchContextProvider.js";
|
|
11
11
|
import WorkbenchSettingsModal_default from "./components/WorkbenchSettingsModal.js";
|
|
12
|
+
import WorkflowButtons_default from "./components/buttons/WorkflowButtons.js";
|
|
12
13
|
import { c } from "react/compiler-runtime";
|
|
13
14
|
import React, { useContext, useEffect, useState } from "react";
|
|
14
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
-
import { ArrowDownIcon,
|
|
16
|
+
import { ArrowDownIcon, ChevronRightIcon, Play } from "lucide-react";
|
|
16
17
|
var WorkflowList_default = (S) => {
|
|
17
18
|
let C = c(33), { pipeline: w } = S, T = useFetchWorkflowsByPipeline(w.id), [E, D] = useState(!1), O;
|
|
18
19
|
C[0] === Symbol.for("react.memo_cache_sentinel") ? (O = {}, C[0] = O) : O = C[0];
|
|
@@ -31,18 +32,18 @@ var WorkflowList_default = (S) => {
|
|
|
31
32
|
let U, W;
|
|
32
33
|
C[6] !== P || C[7] !== T.data ? (U = () => {
|
|
33
34
|
if (T.data && T.data.length > 0) {
|
|
34
|
-
let t = T.data.length - 1,
|
|
35
|
+
let t = T.data.length - 1, _ = T.data[t], v = `section-${_.index}-${_.id}`;
|
|
35
36
|
A({
|
|
36
|
-
[
|
|
37
|
-
...P && P !==
|
|
37
|
+
[v]: !0,
|
|
38
|
+
...P && P !== v ? { [P]: !0 } : {}
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
41
|
}, W = [T.data, P], C[6] = P, C[7] = T.data, C[8] = U, C[9] = W) : (U = C[8], W = C[9]), useEffect(U, W);
|
|
41
42
|
let G;
|
|
42
43
|
C[10] === Symbol.for("react.memo_cache_sentinel") ? (G = (t) => {
|
|
43
|
-
A((
|
|
44
|
-
...
|
|
45
|
-
[t]: !
|
|
44
|
+
A((_) => ({
|
|
45
|
+
..._,
|
|
46
|
+
[t]: !_[t]
|
|
46
47
|
}));
|
|
47
48
|
}, C[10] = G) : G = C[10];
|
|
48
49
|
let K = G, q;
|
|
@@ -62,33 +63,41 @@ var WorkflowList_default = (S) => {
|
|
|
62
63
|
className: "mb-10",
|
|
63
64
|
ref: I,
|
|
64
65
|
children: /* @__PURE__ */ jsx("div", { children: T.data.map((t) => {
|
|
65
|
-
let
|
|
66
|
+
let v = `section-${t.index}-${t.id}`, y = P === v, b = T.data.length === 1, x = b || k[v];
|
|
66
67
|
return /* @__PURE__ */ jsxs("div", {
|
|
67
68
|
ref: (t) => F(t),
|
|
68
|
-
"data-id":
|
|
69
|
-
className: "space-y-0",
|
|
69
|
+
"data-id": v,
|
|
70
70
|
children: [/* @__PURE__ */ jsx("div", {
|
|
71
71
|
className: "bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-10 backdrop-blur",
|
|
72
72
|
children: /* @__PURE__ */ jsxs("div", {
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
role: "button",
|
|
74
|
+
tabIndex: b ? void 0 : 0,
|
|
75
|
+
className: cn("flex w-full items-center gap-2 rounded-md p-2 px-3 text-left text-sm font-medium", !b && "hover:bg-accent hover:text-accent-foreground cursor-pointer", b && "cursor-default"),
|
|
76
|
+
onClick: b ? void 0 : () => K(v),
|
|
77
|
+
onKeyDown: b ? void 0 : (t) => {
|
|
78
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), K(v));
|
|
79
|
+
},
|
|
75
80
|
children: [
|
|
76
|
-
|
|
77
|
-
/* @__PURE__ */ jsx(LayersIcon, { className: cn("size-4", x ? "text-primary" : "text-muted-foreground") }),
|
|
81
|
+
/* @__PURE__ */ jsx(Play, { className: "text-primary h-3.5 w-3.5 fill-current" }),
|
|
78
82
|
/* @__PURE__ */ jsx("span", {
|
|
79
|
-
className:
|
|
83
|
+
className: "flex-1 truncate text-sm",
|
|
80
84
|
children: t.title ?? t.blockName
|
|
81
85
|
}),
|
|
82
|
-
|
|
86
|
+
/* @__PURE__ */ jsx(WorkflowButtons_default, {
|
|
87
|
+
pipeline: w,
|
|
88
|
+
workflowId: t.id
|
|
89
|
+
}),
|
|
90
|
+
y && /* @__PURE__ */ jsx(WorkbenchSettingsModal_default, {
|
|
83
91
|
settings: M,
|
|
84
92
|
onSettingsChange: N,
|
|
85
93
|
open: E,
|
|
86
94
|
onOpenChange: D
|
|
87
|
-
})
|
|
95
|
+
}),
|
|
96
|
+
!b && /* @__PURE__ */ jsx(ChevronRightIcon, { className: cn("text-muted-foreground h-3.5 w-3.5 transition-transform", x && "rotate-90") })
|
|
88
97
|
]
|
|
89
98
|
})
|
|
90
|
-
}),
|
|
91
|
-
className: "max-w-4xl
|
|
99
|
+
}), x && /* @__PURE__ */ jsx("div", {
|
|
100
|
+
className: "max-w-4xl py-1",
|
|
92
101
|
children: /* @__PURE__ */ jsx(WorkflowItem_default, {
|
|
93
102
|
pipeline: w,
|
|
94
103
|
workflowId: t.id,
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
+
import { require_enums } from "../../../packages/contracts/dist/enums/index.js";
|
|
1
2
|
import DocumentItem_default from "./DocumentItem.js";
|
|
2
3
|
import { c } from "react/compiler-runtime";
|
|
3
4
|
import React, { useEffect } from "react";
|
|
4
|
-
import { WorkflowState } from "@loopstack/api-client";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { useParams } from "react-router-dom";
|
|
7
|
-
var DocumentList_default = (
|
|
8
|
-
let
|
|
9
|
-
|
|
7
|
+
var import_enums = require_enums(), DocumentList_default = (e) => {
|
|
8
|
+
let o = c(23), { pipeline: l, workflow: u, documents: d, scrollTo: f, settings: p } = e, { workflowId: m, clickId: h } = useParams(), g;
|
|
9
|
+
o[0] !== m || o[1] !== f || o[2] !== u.id ? (g = () => {
|
|
10
10
|
m === u.id && f(u.id);
|
|
11
|
-
},
|
|
11
|
+
}, o[0] = m, o[1] = f, o[2] = u.id, o[3] = g) : g = o[3];
|
|
12
12
|
let _;
|
|
13
|
-
|
|
13
|
+
o[4] !== h || o[5] !== m || o[6] !== f || o[7] !== u.id ? (_ = [
|
|
14
14
|
u.id,
|
|
15
15
|
m,
|
|
16
16
|
h,
|
|
17
17
|
f
|
|
18
|
-
],
|
|
19
|
-
let v = u.status === WorkflowState.Waiting, y;
|
|
20
|
-
if (
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
let
|
|
18
|
+
], o[4] = h, o[5] = m, o[6] = f, o[7] = u.id, o[8] = _) : _ = o[8], useEffect(g, _);
|
|
19
|
+
let v = u.status === import_enums.WorkflowState.Waiting, y;
|
|
20
|
+
if (o[9] !== d || o[10] !== v || o[11] !== l || o[12] !== p || o[13] !== u) {
|
|
21
|
+
let e;
|
|
22
|
+
o[15] !== d.length || o[16] !== v || o[17] !== l || o[18] !== p || o[19] !== u ? (e = (e, a) => {
|
|
23
|
+
let o = e, s = e.place === u.place || !!o.meta?.enableAtPlaces?.includes(u.place);
|
|
24
24
|
return /* @__PURE__ */ jsx(DocumentItem_default, {
|
|
25
|
-
document:
|
|
25
|
+
document: e,
|
|
26
26
|
workflow: u,
|
|
27
27
|
pipeline: l,
|
|
28
|
-
isActive: v &&
|
|
29
|
-
isLastItem:
|
|
28
|
+
isActive: v && s,
|
|
29
|
+
isLastItem: a === d.length - 1,
|
|
30
30
|
settings: p
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
} else y =
|
|
31
|
+
}, e.id);
|
|
32
|
+
}, o[15] = d.length, o[16] = v, o[17] = l, o[18] = p, o[19] = u, o[20] = e) : e = o[20], y = d.map(e), o[9] = d, o[10] = v, o[11] = l, o[12] = p, o[13] = u, o[14] = y;
|
|
33
|
+
} else y = o[14];
|
|
34
34
|
let b;
|
|
35
|
-
return
|
|
35
|
+
return o[21] === y ? b = o[22] : (b = /* @__PURE__ */ jsx("div", {
|
|
36
36
|
className: "flex flex-col gap-6",
|
|
37
37
|
children: y
|
|
38
|
-
}),
|
|
38
|
+
}), o[21] = y, o[22] = b), b;
|
|
39
39
|
};
|
|
40
40
|
export { DocumentList_default as default };
|