@loopstack/loopstack-studio 0.23.0 → 0.24.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.
Files changed (90) hide show
  1. package/dist/api/index.js +12 -10
  2. package/dist/api/secrets.js +16 -0
  3. package/dist/components/dynamic-form/ArrayController.js +68 -64
  4. package/dist/components/dynamic-form/Form.js +56 -27
  5. package/dist/components/dynamic-form/FormElement.js +1 -1
  6. package/dist/components/dynamic-form/FormElementHeader.js +2 -2
  7. package/dist/components/dynamic-form/InputController.js +3 -1
  8. package/dist/components/dynamic-form/ObjectController.js +24 -21
  9. package/dist/components/dynamic-form/fields/BaseFieldWrapper.js +1 -1
  10. package/dist/components/dynamic-form/fields/InputField.js +20 -19
  11. package/dist/components/dynamic-form/fields/MarkdownViewField.js +20 -0
  12. package/dist/components/dynamic-form/fields/RadioField.js +18 -18
  13. package/dist/components/dynamic-form/fields/SelectField.js +19 -19
  14. package/dist/components/dynamic-form/fields/TextareaField.js +17 -17
  15. package/dist/components/layout/MainLayout.js +18 -31
  16. package/dist/components/layout/StudioSidebar.js +168 -108
  17. package/dist/components/page/PageBreadcrumbs.js +79 -32
  18. package/dist/components/ui-widgets/UiWidget.js +36 -27
  19. package/dist/components/ui-widgets/widgets/SecretInput.js +42 -0
  20. package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +80 -4
  21. package/dist/features/code-explorer/components/FileContentViewer.js +47 -30
  22. package/dist/features/code-explorer/components/FileTabsBar.js +3 -190
  23. package/dist/features/code-explorer/components/FileTabsBarBase.js +190 -0
  24. package/dist/features/code-explorer/index.js +2 -2
  25. package/dist/features/code-explorer/providers/CodeExplorerProvider.js +2 -162
  26. package/dist/features/code-explorer/utils/fileIcons.js +7 -4
  27. package/dist/features/debug/components/PipelineFlowViewer.js +46 -45
  28. package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +19 -19
  29. package/dist/features/documents/DocumentRenderer.js +20 -15
  30. package/dist/features/documents/components/DocumentList.js +5 -1
  31. package/dist/features/documents/renderers/AiMessage.js +11 -11
  32. package/dist/features/documents/renderers/ClaudeMessage.js +96 -0
  33. package/dist/features/documents/renderers/DocumentFormRenderer.js +17 -11
  34. package/dist/features/workbench/Workbench.js +64 -80
  35. package/dist/features/workbench/WorkflowItem.js +5 -5
  36. package/dist/features/workbench/components/RemoteFileTabsBar.js +18 -0
  37. package/dist/features/workbench/components/RemoteFileTree.js +90 -0
  38. package/dist/features/workbench/components/WorkbenchFilesPanel.js +67 -0
  39. package/dist/features/workbench/components/WorkbenchFloatingPanel.js +57 -49
  40. package/dist/features/workbench/components/WorkbenchFlowPanel.js +2 -2
  41. package/dist/features/workbench/components/WorkbenchIconSidebar.js +48 -28
  42. package/dist/features/workbench/components/WorkbenchSecretsPanel.js +182 -0
  43. package/dist/features/workbench/hooks/useWorkflowData.js +4 -4
  44. package/dist/features/workbench/providers/RemoteFileExplorerProvider.js +160 -0
  45. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +46 -43
  46. package/dist/features/workspaces/components/PipelineForm.js +1 -1
  47. package/dist/features/workspaces/components/WorkspaceHomePage.js +93 -0
  48. package/dist/hooks/index.js +1 -1
  49. package/dist/hooks/query-keys.js +41 -34
  50. package/dist/hooks/useFiles.js +1 -43
  51. package/dist/hooks/useSecrets.js +69 -0
  52. package/dist/index.d.ts +49 -0
  53. package/dist/index.js +3 -2
  54. package/dist/node_modules/@xyflow/react/dist/esm/index.js +1 -1
  55. package/dist/pages/DashboardPage.js +87 -35
  56. package/dist/pages/EmbedWorkbenchPage.js +43 -39
  57. package/dist/pages/PipelineDebugPage.js +1 -1
  58. package/dist/pages/PreviewWorkbenchPage.js +167 -70
  59. package/dist/pages/WorkspacePage.js +102 -50
  60. package/dist/pages/WorkspaceRunsPage.js +71 -0
  61. package/dist/routing/LocalRouter.js +6 -0
  62. package/dist/types/ai.types.js +13 -0
  63. package/package.json +2 -3
  64. package/dist/node_modules/@ai-sdk/provider/dist/index.js +0 -65
  65. package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js +0 -1008
  66. package/dist/node_modules/ai/dist/index.js +0 -1083
  67. package/dist/node_modules/zod/v3/ZodError.js +0 -79
  68. package/dist/node_modules/zod/v3/errors.js +0 -6
  69. package/dist/node_modules/zod/v3/helpers/errorUtil.js +0 -5
  70. package/dist/node_modules/zod/v3/helpers/parseUtil.js +0 -90
  71. package/dist/node_modules/zod/v3/helpers/util.js +0 -72
  72. package/dist/node_modules/zod/v3/locales/en.js +0 -58
  73. package/dist/node_modules/zod/v3/types.js +0 -2425
  74. package/dist/node_modules/zod/v4/classic/errors.js +0 -21
  75. package/dist/node_modules/zod/v4/classic/iso.js +0 -29
  76. package/dist/node_modules/zod/v4/classic/parse.js +0 -4
  77. package/dist/node_modules/zod/v4/classic/schemas.js +0 -392
  78. package/dist/node_modules/zod/v4/core/api.js +0 -532
  79. package/dist/node_modules/zod/v4/core/checks.js +0 -283
  80. package/dist/node_modules/zod/v4/core/core.js +0 -44
  81. package/dist/node_modules/zod/v4/core/doc.js +0 -21
  82. package/dist/node_modules/zod/v4/core/errors.js +0 -40
  83. package/dist/node_modules/zod/v4/core/json-schema-processors.js +0 -305
  84. package/dist/node_modules/zod/v4/core/parse.js +0 -66
  85. package/dist/node_modules/zod/v4/core/regexes.js +0 -28
  86. package/dist/node_modules/zod/v4/core/registries.js +0 -38
  87. package/dist/node_modules/zod/v4/core/schemas.js +0 -863
  88. package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -220
  89. package/dist/node_modules/zod/v4/core/util.js +0 -267
  90. package/dist/node_modules/zod/v4/core/versions.js +0 -6
@@ -1,191 +1,4 @@
1
- import { cn } from "../../../lib/utils.js";
2
- import { Button } from "../../../components/ui/button.js";
3
- import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../../../components/ui/dropdown-menu.js";
4
- import { ScrollArea, ScrollBar } from "../../../components/ui/scroll-area.js";
5
- import { useCodeExplorerContext } from "../providers/CodeExplorerProvider.js";
6
- import { getFileIcon } from "../utils/fileIcons.js";
7
- import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger } from "../../../components/ui/context-menu.js";
1
+ import "../providers/CodeExplorerProvider.js";
2
+ import "./FileTabsBarBase.js";
8
3
  import { c } from "react/compiler-runtime";
9
- import { useEffect, useRef } from "react";
10
- import { jsx, jsxs } from "react/jsx-runtime";
11
- import { ClipboardCopy, MoreHorizontal, X, XCircle } from "lucide-react";
12
- function FileTabsBar() {
13
- let g = c(50), { openFiles: _, selectedFile: v, selectFile: y, closeFile: b, closeAll: x, closeOthers: S, closeToLeft: C, closeToRight: w } = useCodeExplorerContext(), T = useRef(null), E = useRef(_.length), D, O;
14
- g[0] === _.length ? (D = g[1], O = g[2]) : (D = () => {
15
- if (_.length > E.current && T.current) {
16
- let e = T.current.closest("[data-slot=\"scroll-area-viewport\"]");
17
- e && requestAnimationFrame(() => {
18
- e.scrollTo({
19
- left: e.scrollWidth,
20
- behavior: "smooth"
21
- });
22
- });
23
- }
24
- E.current = _.length;
25
- }, O = [_.length], g[0] = _.length, g[1] = D, g[2] = O), useEffect(D, O);
26
- let k, A;
27
- if (g[3] === v ? (k = g[4], A = g[5]) : (k = () => {
28
- if (v && T.current) {
29
- let e = T.current.querySelector(`[data-tab-path="${v.path}"]`);
30
- e && requestAnimationFrame(() => {
31
- e.scrollIntoView({
32
- behavior: "smooth",
33
- block: "nearest",
34
- inline: "nearest"
35
- });
36
- });
37
- }
38
- }, A = [v], g[3] = v, g[4] = k, g[5] = A), useEffect(k, A), _.length === 0) return null;
39
- let j;
40
- g[6] === y ? j = g[7] : (j = (e) => {
41
- y(e);
42
- }, g[6] = y, g[7] = j);
43
- let M = j, N;
44
- g[8] === b ? N = g[9] : (N = (e, l) => {
45
- e.stopPropagation(), b(l);
46
- }, g[8] = b, g[9] = N);
47
- let P = N, F = _temp2, I;
48
- g[10] === Symbol.for("react.memo_cache_sentinel") ? (I = { width: "max-content" }, g[10] = I) : I = g[10];
49
- let L;
50
- g[11] !== x || g[12] !== b || g[13] !== S || g[14] !== C || g[15] !== w || g[16] !== P || g[17] !== M || g[18] !== _ || g[19] !== v?.path ? (L = _.map((u) => {
51
- let d = getFileIcon(u.name), f = v?.path === u.path, p = _.findIndex((e) => e.path === u.path), m = p > 0, h = p < _.length - 1;
52
- return /* @__PURE__ */ jsxs(ContextMenu, { children: [/* @__PURE__ */ jsx(ContextMenuTrigger, {
53
- asChild: !0,
54
- children: /* @__PURE__ */ jsxs("button", {
55
- type: "button",
56
- "data-tab-path": u.path,
57
- onClick: () => M(u),
58
- className: cn("group relative flex h-9 min-w-[140px] max-w-[280px] shrink-0 items-center gap-2 border-r border-border/50 px-3 text-sm transition-all", "hover:bg-muted/70", f ? "bg-background text-foreground border-b-2 border-b-primary shadow-sm" : "text-muted-foreground bg-muted/30"),
59
- "aria-selected": f,
60
- "aria-label": `Tab: ${u.name}`,
61
- children: [
62
- /* @__PURE__ */ jsx(d, {
63
- className: "h-3.5 w-3.5 shrink-0",
64
- "aria-hidden": !0
65
- }),
66
- /* @__PURE__ */ jsx("span", {
67
- className: "truncate flex-1 text-left font-medium",
68
- children: u.name
69
- }),
70
- /* @__PURE__ */ jsx(Button, {
71
- variant: "ghost",
72
- size: "icon",
73
- className: cn("h-5 w-5 shrink-0 rounded opacity-0 group-hover:opacity-100 transition-opacity", "hover:bg-destructive/10 hover:text-destructive", f && "opacity-70"),
74
- onClick: (e) => P(e, u),
75
- "aria-label": `Close ${u.name}`,
76
- children: /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5" })
77
- })
78
- ]
79
- })
80
- }), /* @__PURE__ */ jsxs(ContextMenuContent, {
81
- className: "min-w-[180px]",
82
- children: [
83
- /* @__PURE__ */ jsx(ContextMenuItem, {
84
- onClick: () => b(u),
85
- children: "Close"
86
- }),
87
- /* @__PURE__ */ jsx(ContextMenuItem, {
88
- onClick: () => S(u),
89
- disabled: _.length <= 1,
90
- children: "Close Others"
91
- }),
92
- /* @__PURE__ */ jsx(ContextMenuItem, {
93
- onClick: () => C(u),
94
- disabled: !m,
95
- children: "Close to the Left"
96
- }),
97
- /* @__PURE__ */ jsx(ContextMenuItem, {
98
- onClick: () => w(u),
99
- disabled: !h,
100
- children: "Close to the Right"
101
- }),
102
- /* @__PURE__ */ jsx(ContextMenuSeparator, {}),
103
- /* @__PURE__ */ jsx(ContextMenuItem, {
104
- onClick: x,
105
- children: "Close All"
106
- }),
107
- /* @__PURE__ */ jsx(ContextMenuSeparator, {}),
108
- /* @__PURE__ */ jsxs(ContextMenuItem, {
109
- onClick: () => F(u.path),
110
- children: [/* @__PURE__ */ jsx(ClipboardCopy, { className: "h-4 w-4" }), "Copy Path"]
111
- })
112
- ]
113
- })] }, u.path);
114
- }), g[11] = x, g[12] = b, g[13] = S, g[14] = C, g[15] = w, g[16] = P, g[17] = M, g[18] = _, g[19] = v?.path, g[20] = L) : L = g[20];
115
- let R;
116
- g[21] === L ? R = g[22] : (R = /* @__PURE__ */ jsx("div", {
117
- ref: T,
118
- className: "flex h-9 items-center",
119
- style: I,
120
- children: L
121
- }), g[21] = L, g[22] = R);
122
- let z;
123
- g[23] === Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ jsx(ScrollBar, { orientation: "horizontal" }), g[23] = z) : z = g[23];
124
- let B;
125
- g[24] === R ? B = g[25] : (B = /* @__PURE__ */ jsxs(ScrollArea, {
126
- className: "flex-1 min-w-0",
127
- children: [R, z]
128
- }), g[24] = R, g[25] = B);
129
- let V;
130
- g[26] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ jsx(DropdownMenuTrigger, {
131
- asChild: !0,
132
- children: /* @__PURE__ */ jsx(Button, {
133
- variant: "ghost",
134
- size: "icon",
135
- className: "h-9 w-9 rounded-none text-muted-foreground hover:bg-muted/70 hover:text-foreground",
136
- "aria-label": "Tab actions",
137
- children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" })
138
- })
139
- }), g[26] = V) : V = g[26];
140
- let H;
141
- g[27] !== b || g[28] !== v ? (H = () => v && b(v), g[27] = b, g[28] = v, g[29] = H) : H = g[29];
142
- let U = !v, W;
143
- g[30] !== H || g[31] !== U ? (W = /* @__PURE__ */ jsx(DropdownMenuItem, {
144
- onClick: H,
145
- disabled: U,
146
- children: "Close Active Tab"
147
- }), g[30] = H, g[31] = U, g[32] = W) : W = g[32];
148
- let G;
149
- g[33] !== S || g[34] !== v ? (G = () => v && S(v), g[33] = S, g[34] = v, g[35] = G) : G = g[35];
150
- let K = !v || _.length <= 1, q;
151
- g[36] !== G || g[37] !== K ? (q = /* @__PURE__ */ jsx(DropdownMenuItem, {
152
- onClick: G,
153
- disabled: K,
154
- children: "Close Other Tabs"
155
- }), g[36] = G, g[37] = K, g[38] = q) : q = g[38];
156
- let J;
157
- g[39] === Symbol.for("react.memo_cache_sentinel") ? (J = /* @__PURE__ */ jsx(DropdownMenuSeparator, {}), g[39] = J) : J = g[39];
158
- let Y;
159
- g[40] === Symbol.for("react.memo_cache_sentinel") ? (Y = /* @__PURE__ */ jsx(XCircle, { className: "h-4 w-4" }), g[40] = Y) : Y = g[40];
160
- let Z;
161
- g[41] === x ? Z = g[42] : (Z = /* @__PURE__ */ jsxs(DropdownMenuItem, {
162
- onClick: x,
163
- children: [Y, "Close All Tabs"]
164
- }), g[41] = x, g[42] = Z);
165
- let Q;
166
- g[43] !== W || g[44] !== q || g[45] !== Z ? (Q = /* @__PURE__ */ jsx("div", {
167
- className: "shrink-0 border-l border-border/50 bg-muted/30 h-9 flex items-center",
168
- children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [V, /* @__PURE__ */ jsxs(DropdownMenuContent, {
169
- align: "end",
170
- className: "min-w-[180px]",
171
- children: [
172
- W,
173
- q,
174
- J,
175
- Z
176
- ]
177
- })] })
178
- }), g[43] = W, g[44] = q, g[45] = Z, g[46] = Q) : Q = g[46];
179
- let $;
180
- return g[47] !== B || g[48] !== Q ? ($ = /* @__PURE__ */ jsxs("div", {
181
- className: "shrink-0 border-b bg-muted/50 flex items-center overflow-hidden",
182
- children: [B, Q]
183
- }), g[47] = B, g[48] = Q, g[49] = $) : $ = g[49], $;
184
- }
185
- function _temp2(e) {
186
- navigator.clipboard.writeText(e).catch(_temp);
187
- }
188
- function _temp(e) {
189
- console.error("Failed to copy path:", e);
190
- }
191
- export { FileTabsBar };
4
+ import { jsx } from "react/jsx-runtime";
@@ -0,0 +1,190 @@
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { Button } from "../../../components/ui/button.js";
3
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../../../components/ui/dropdown-menu.js";
4
+ import { ScrollArea, ScrollBar } from "../../../components/ui/scroll-area.js";
5
+ import { getFileIcon } from "../utils/fileIcons.js";
6
+ import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger } from "../../../components/ui/context-menu.js";
7
+ import { c } from "react/compiler-runtime";
8
+ import { useEffect, useRef } from "react";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ import { ClipboardCopy, MoreHorizontal, X, XCircle } from "lucide-react";
11
+ function FileTabsBarBase(h) {
12
+ let g = c(50), { openFiles: _, selectedFile: v, selectFile: y, closeFile: b, closeAll: x, closeOthers: S, closeToLeft: C, closeToRight: w } = h, T = useRef(null), E = useRef(_.length), D, O;
13
+ g[0] === _.length ? (D = g[1], O = g[2]) : (D = () => {
14
+ if (_.length > E.current && T.current) {
15
+ let e = T.current.closest("[data-slot=\"scroll-area-viewport\"]");
16
+ e && requestAnimationFrame(() => {
17
+ e.scrollTo({
18
+ left: e.scrollWidth,
19
+ behavior: "smooth"
20
+ });
21
+ });
22
+ }
23
+ E.current = _.length;
24
+ }, O = [_.length], g[0] = _.length, g[1] = D, g[2] = O), useEffect(D, O);
25
+ let k, A;
26
+ if (g[3] === v ? (k = g[4], A = g[5]) : (k = () => {
27
+ if (v && T.current) {
28
+ let e = T.current.querySelector(`[data-tab-path="${v.path}"]`);
29
+ e && requestAnimationFrame(() => {
30
+ e.scrollIntoView({
31
+ behavior: "smooth",
32
+ block: "nearest",
33
+ inline: "nearest"
34
+ });
35
+ });
36
+ }
37
+ }, A = [v], g[3] = v, g[4] = k, g[5] = A), useEffect(k, A), _.length === 0) return null;
38
+ let j;
39
+ g[6] === y ? j = g[7] : (j = (e) => {
40
+ y(e);
41
+ }, g[6] = y, g[7] = j);
42
+ let M = j, N;
43
+ g[8] === b ? N = g[9] : (N = (e, s) => {
44
+ e.stopPropagation(), b(s);
45
+ }, g[8] = b, g[9] = N);
46
+ let P = N, F = _temp2, I;
47
+ g[10] === Symbol.for("react.memo_cache_sentinel") ? (I = { width: "max-content" }, g[10] = I) : I = g[10];
48
+ let L;
49
+ g[11] !== x || g[12] !== b || g[13] !== S || g[14] !== C || g[15] !== w || g[16] !== P || g[17] !== M || g[18] !== _ || g[19] !== v?.path ? (L = _.map((l) => {
50
+ let u = getFileIcon(l.name), d = v?.path === l.path, f = _.findIndex((e) => e.path === l.path), p = f > 0, m = f < _.length - 1;
51
+ return /* @__PURE__ */ jsxs(ContextMenu, { children: [/* @__PURE__ */ jsx(ContextMenuTrigger, {
52
+ asChild: !0,
53
+ children: /* @__PURE__ */ jsxs("button", {
54
+ type: "button",
55
+ "data-tab-path": l.path,
56
+ onClick: () => M(l),
57
+ className: cn("group relative flex h-9 min-w-[140px] max-w-[280px] shrink-0 items-center gap-2 border-r border-border/50 px-3 text-sm transition-all", "hover:bg-muted/70", d ? "bg-background text-foreground border-b-2 border-b-primary shadow-sm" : "text-muted-foreground bg-muted/30"),
58
+ "aria-selected": d,
59
+ "aria-label": `Tab: ${l.name}`,
60
+ children: [
61
+ /* @__PURE__ */ jsx(u, {
62
+ className: "h-3.5 w-3.5 shrink-0",
63
+ "aria-hidden": !0
64
+ }),
65
+ /* @__PURE__ */ jsx("span", {
66
+ className: "truncate flex-1 text-left font-medium",
67
+ children: l.name
68
+ }),
69
+ /* @__PURE__ */ jsx(Button, {
70
+ variant: "ghost",
71
+ size: "icon",
72
+ className: cn("h-5 w-5 shrink-0 rounded opacity-0 group-hover:opacity-100 transition-opacity", "hover:bg-destructive/10 hover:text-destructive", d && "opacity-70"),
73
+ onClick: (e) => P(e, l),
74
+ "aria-label": `Close ${l.name}`,
75
+ children: /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5" })
76
+ })
77
+ ]
78
+ })
79
+ }), /* @__PURE__ */ jsxs(ContextMenuContent, {
80
+ className: "min-w-[180px]",
81
+ children: [
82
+ /* @__PURE__ */ jsx(ContextMenuItem, {
83
+ onClick: () => b(l),
84
+ children: "Close"
85
+ }),
86
+ /* @__PURE__ */ jsx(ContextMenuItem, {
87
+ onClick: () => S(l),
88
+ disabled: _.length <= 1,
89
+ children: "Close Others"
90
+ }),
91
+ /* @__PURE__ */ jsx(ContextMenuItem, {
92
+ onClick: () => C(l),
93
+ disabled: !p,
94
+ children: "Close to the Left"
95
+ }),
96
+ /* @__PURE__ */ jsx(ContextMenuItem, {
97
+ onClick: () => w(l),
98
+ disabled: !m,
99
+ children: "Close to the Right"
100
+ }),
101
+ /* @__PURE__ */ jsx(ContextMenuSeparator, {}),
102
+ /* @__PURE__ */ jsx(ContextMenuItem, {
103
+ onClick: x,
104
+ children: "Close All"
105
+ }),
106
+ /* @__PURE__ */ jsx(ContextMenuSeparator, {}),
107
+ /* @__PURE__ */ jsxs(ContextMenuItem, {
108
+ onClick: () => F(l.path),
109
+ children: [/* @__PURE__ */ jsx(ClipboardCopy, { className: "h-4 w-4" }), "Copy Path"]
110
+ })
111
+ ]
112
+ })] }, l.path);
113
+ }), g[11] = x, g[12] = b, g[13] = S, g[14] = C, g[15] = w, g[16] = P, g[17] = M, g[18] = _, g[19] = v?.path, g[20] = L) : L = g[20];
114
+ let R;
115
+ g[21] === L ? R = g[22] : (R = /* @__PURE__ */ jsx("div", {
116
+ ref: T,
117
+ className: "flex h-9 items-center",
118
+ style: I,
119
+ children: L
120
+ }), g[21] = L, g[22] = R);
121
+ let z;
122
+ g[23] === Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ jsx(ScrollBar, { orientation: "horizontal" }), g[23] = z) : z = g[23];
123
+ let B;
124
+ g[24] === R ? B = g[25] : (B = /* @__PURE__ */ jsxs(ScrollArea, {
125
+ className: "flex-1 min-w-0",
126
+ children: [R, z]
127
+ }), g[24] = R, g[25] = B);
128
+ let V;
129
+ g[26] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ jsx(DropdownMenuTrigger, {
130
+ asChild: !0,
131
+ children: /* @__PURE__ */ jsx(Button, {
132
+ variant: "ghost",
133
+ size: "icon",
134
+ className: "h-9 w-9 rounded-none text-muted-foreground hover:bg-muted/70 hover:text-foreground",
135
+ "aria-label": "Tab actions",
136
+ children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" })
137
+ })
138
+ }), g[26] = V) : V = g[26];
139
+ let H;
140
+ g[27] !== b || g[28] !== v ? (H = () => v && b(v), g[27] = b, g[28] = v, g[29] = H) : H = g[29];
141
+ let U = !v, W;
142
+ g[30] !== H || g[31] !== U ? (W = /* @__PURE__ */ jsx(DropdownMenuItem, {
143
+ onClick: H,
144
+ disabled: U,
145
+ children: "Close Active Tab"
146
+ }), g[30] = H, g[31] = U, g[32] = W) : W = g[32];
147
+ let G;
148
+ g[33] !== S || g[34] !== v ? (G = () => v && S(v), g[33] = S, g[34] = v, g[35] = G) : G = g[35];
149
+ let K = !v || _.length <= 1, q;
150
+ g[36] !== G || g[37] !== K ? (q = /* @__PURE__ */ jsx(DropdownMenuItem, {
151
+ onClick: G,
152
+ disabled: K,
153
+ children: "Close Other Tabs"
154
+ }), g[36] = G, g[37] = K, g[38] = q) : q = g[38];
155
+ let J;
156
+ g[39] === Symbol.for("react.memo_cache_sentinel") ? (J = /* @__PURE__ */ jsx(DropdownMenuSeparator, {}), g[39] = J) : J = g[39];
157
+ let Y;
158
+ g[40] === Symbol.for("react.memo_cache_sentinel") ? (Y = /* @__PURE__ */ jsx(XCircle, { className: "h-4 w-4" }), g[40] = Y) : Y = g[40];
159
+ let Z;
160
+ g[41] === x ? Z = g[42] : (Z = /* @__PURE__ */ jsxs(DropdownMenuItem, {
161
+ onClick: x,
162
+ children: [Y, "Close All Tabs"]
163
+ }), g[41] = x, g[42] = Z);
164
+ let Q;
165
+ g[43] !== W || g[44] !== q || g[45] !== Z ? (Q = /* @__PURE__ */ jsx("div", {
166
+ className: "shrink-0 border-l border-border/50 bg-muted/30 h-9 flex items-center",
167
+ children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [V, /* @__PURE__ */ jsxs(DropdownMenuContent, {
168
+ align: "end",
169
+ className: "min-w-[180px]",
170
+ children: [
171
+ W,
172
+ q,
173
+ J,
174
+ Z
175
+ ]
176
+ })] })
177
+ }), g[43] = W, g[44] = q, g[45] = Z, g[46] = Q) : Q = g[46];
178
+ let $;
179
+ return g[47] !== B || g[48] !== Q ? ($ = /* @__PURE__ */ jsxs("div", {
180
+ className: "shrink-0 border-b bg-muted/50 flex items-center overflow-hidden",
181
+ children: [B, Q]
182
+ }), g[47] = B, g[48] = Q, g[49] = $) : $ = g[49], $;
183
+ }
184
+ function _temp2(e) {
185
+ navigator.clipboard.writeText(e).catch(_temp);
186
+ }
187
+ function _temp(e) {
188
+ console.error("Failed to copy path:", e);
189
+ }
190
+ export { FileTabsBarBase };
@@ -1,4 +1,4 @@
1
- import { CodeExplorerProvider, useCodeExplorerContext } from "./providers/CodeExplorerProvider.js";
1
+ import "./providers/CodeExplorerProvider.js";
2
2
  import "./CodeExplorer.js";
3
3
  import { FileContentViewer } from "./components/FileContentViewer.js";
4
- import { FileTabsBar } from "./components/FileTabsBar.js";
4
+ import "./components/FileTabsBar.js";
@@ -1,165 +1,5 @@
1
- import { useFileContent, useFileTree } from "../../../hooks/useFiles.js";
1
+ import "../../../hooks/useFiles.js";
2
2
  import { c } from "react/compiler-runtime";
3
3
  import { createContext, useCallback, useContext, useEffect, useMemo, useState } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
- function extractErrorMessage(e) {
6
- if (!e) return null;
7
- if ("isAxiosError" in e && e.isAxiosError) {
8
- let t = e.response?.data;
9
- if (typeof t == "object" && t && "message" in t) return Error(String(t.message));
10
- if (typeof t == "string") return Error(t);
11
- }
12
- return e;
13
- }
14
- var CodeExplorerContext = createContext(null);
15
- function mapDtoToNode(e) {
16
- return {
17
- id: e.id,
18
- name: e.name,
19
- path: e.path,
20
- type: e.type,
21
- children: e.children?.map(mapDtoToNode)
22
- };
23
- }
24
- function CodeExplorerProvider(r) {
25
- let i = c(49), { children: a, pipelineId: o, initialSelectedPath: s, fileExplorerEnabled: l } = r, u = l === void 0 ? !1 : l, d;
26
- i[0] === Symbol.for("react.memo_cache_sentinel") ? (d = [], i[0] = d) : d = i[0];
27
- let [f, p] = useState(d), [m, h] = useState(null), [g, _] = useState(""), v;
28
- i[1] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ new Set(), i[1] = v) : v = i[1];
29
- let [y, b] = useState(v), x = useFileTree(o, u), S = useFileContent(o, m?.path, u), C;
30
- bb0: {
31
- if (!x.data) {
32
- let e;
33
- i[2] === Symbol.for("react.memo_cache_sentinel") ? (e = [], i[2] = e) : e = i[2], C = e;
34
- break bb0;
35
- }
36
- let e;
37
- i[3] === x.data ? e = i[4] : (e = x.data.map(mapDtoToNode), i[3] = x.data, i[4] = e), C = e;
38
- }
39
- let w = C, T = S.data?.content ?? null, E = S.data?.workflowConfig ?? null, D = x.isLoading && !x.data, O = S.isLoading && m !== null && !S.data, k;
40
- i[5] !== S.error || i[6] !== x.error ? (k = extractErrorMessage(x.error) || extractErrorMessage(S.error) || null, i[5] = S.error, i[6] = x.error, i[7] = k) : k = i[7];
41
- let A = k, j, M;
42
- i[8] !== w || i[9] !== s || i[10] !== f.length || i[11] !== m ? (j = () => {
43
- if (s && w.length > 0 && !m && f.length === 0) {
44
- let e = (t, n) => {
45
- for (let r of t) {
46
- if (r.path === n) return r;
47
- if (r.children) {
48
- let t = e(r.children, n);
49
- if (t) return t;
50
- }
51
- }
52
- return null;
53
- }, t = e(w, s);
54
- t && t.type === "file" && (p([t]), h(t));
55
- }
56
- }, M = [
57
- s,
58
- w,
59
- m,
60
- f.length
61
- ], i[8] = w, i[9] = s, i[10] = f.length, i[11] = m, i[12] = j, i[13] = M) : (j = i[12], M = i[13]), useEffect(j, M);
62
- let N;
63
- i[14] === Symbol.for("react.memo_cache_sentinel") ? (N = (e) => {
64
- e.type === "file" && p((t) => {
65
- if (t.findIndex((t) => t.path === e.path) >= 0) return h(e), t;
66
- {
67
- let n = [...t, e];
68
- return h(e), n;
69
- }
70
- });
71
- }, i[14] = N) : N = i[14];
72
- let P = N, F;
73
- i[15] === m ? F = i[16] : (F = () => {
74
- m && p((e) => {
75
- let t = e.filter((e) => e.path !== m.path);
76
- if (t.length > 0) {
77
- let n = e.findIndex((e) => e.path === m.path);
78
- h(t[n > 0 ? n - 1 : 0]);
79
- } else h(null);
80
- return t;
81
- });
82
- }, i[15] = m, i[16] = F);
83
- let I = F, L;
84
- i[17] === m?.path ? L = i[18] : (L = (e) => {
85
- p((t) => {
86
- let n = t.filter((t) => t.path !== e.path);
87
- if (m?.path === e.path) if (n.length > 0) {
88
- let r = t.findIndex((t) => t.path === e.path);
89
- h(n[r > 0 ? r - 1 : 0]);
90
- } else h(null);
91
- return n;
92
- });
93
- }, i[17] = m?.path, i[18] = L);
94
- let R = L, z;
95
- i[19] === Symbol.for("react.memo_cache_sentinel") ? (z = () => {
96
- p([]), h(null);
97
- }, i[19] = z) : z = i[19];
98
- let B = z, V;
99
- i[20] === Symbol.for("react.memo_cache_sentinel") ? (V = (e) => {
100
- p([e]), h(e);
101
- }, i[20] = V) : V = i[20];
102
- let H = V, U;
103
- i[21] === m ? U = i[22] : (U = (e) => {
104
- p((t) => {
105
- let n = t.findIndex((t) => t.path === e.path);
106
- if (n <= 0) return t;
107
- let r = t.slice(n);
108
- return m && t.findIndex((e) => e.path === m.path) < n && h(e), r;
109
- });
110
- }, i[21] = m, i[22] = U);
111
- let W = U, G;
112
- i[23] === m ? G = i[24] : (G = (e) => {
113
- p((t) => {
114
- let n = t.findIndex((t) => t.path === e.path);
115
- if (n < 0 || n >= t.length - 1) return t;
116
- let r = t.slice(0, n + 1);
117
- return m && t.findIndex((e) => e.path === m.path) > n && h(e), r;
118
- });
119
- }, i[23] = m, i[24] = G);
120
- let K = G, q;
121
- i[25] !== S || i[26] !== x || i[27] !== m ? (q = async () => {
122
- await x.refetch(), m && await S.refetch();
123
- }, i[25] = S, i[26] = x, i[27] = m, i[28] = q) : q = i[28];
124
- let J = q, Y;
125
- i[29] === Symbol.for("react.memo_cache_sentinel") ? (Y = (e) => {
126
- b((t) => {
127
- let n = new Set(t);
128
- return n.has(e) ? n.delete(e) : n.add(e), n;
129
- });
130
- }, i[29] = Y) : Y = i[29];
131
- let X = Y, Z;
132
- i[30] !== I || i[31] !== R || i[32] !== W || i[33] !== K || i[34] !== A || i[35] !== y || i[36] !== T || i[37] !== w || i[38] !== O || i[39] !== D || i[40] !== f || i[41] !== J || i[42] !== g || i[43] !== m || i[44] !== E ? (Z = {
133
- fileTree: w,
134
- openFiles: f,
135
- selectedFile: m,
136
- fileContent: T,
137
- workflowConfig: E,
138
- isTreeLoading: D,
139
- isContentLoading: O,
140
- error: A,
141
- searchQuery: g,
142
- setSearchQuery: _,
143
- selectFile: P,
144
- clearSelection: I,
145
- closeFile: R,
146
- closeAll: B,
147
- closeOthers: H,
148
- closeToLeft: W,
149
- closeToRight: K,
150
- refresh: J,
151
- expandedFolders: y,
152
- toggleFolder: X
153
- }, i[30] = I, i[31] = R, i[32] = W, i[33] = K, i[34] = A, i[35] = y, i[36] = T, i[37] = w, i[38] = O, i[39] = D, i[40] = f, i[41] = J, i[42] = g, i[43] = m, i[44] = E, i[45] = Z) : Z = i[45];
154
- let Q = Z, $;
155
- return i[46] !== a || i[47] !== Q ? ($ = /* @__PURE__ */ jsx(CodeExplorerContext.Provider, {
156
- value: Q,
157
- children: a
158
- }), i[46] = a, i[47] = Q, i[48] = $) : $ = i[48], $;
159
- }
160
- function useCodeExplorerContext() {
161
- let e = useContext(CodeExplorerContext);
162
- if (!e) throw Error("useCodeExplorerContext must be used within CodeExplorerProvider");
163
- return e;
164
- }
165
- export { CodeExplorerProvider, useCodeExplorerContext };
5
+ createContext(null);
@@ -1,4 +1,4 @@
1
- import { File, FileCode, FileJson, FileText } from "lucide-react";
1
+ import { File, FileCode, FileJson, FileText, Folder, FolderOpen } from "lucide-react";
2
2
  var EXTENSION_ICON_MAP = {
3
3
  ".ts": FileCode,
4
4
  ".tsx": FileCode,
@@ -33,7 +33,10 @@ var EXTENSION_ICON_MAP = {
33
33
  ".log": FileText,
34
34
  ".env": FileText
35
35
  };
36
- function getFileIcon(a) {
37
- return EXTENSION_ICON_MAP[a.includes(".") ? a.slice(a.lastIndexOf(".")).toLowerCase() : ""] ?? File;
36
+ function getFileIcon(c) {
37
+ return EXTENSION_ICON_MAP[c.includes(".") ? c.slice(c.lastIndexOf(".")).toLowerCase() : ""] ?? File;
38
38
  }
39
- export { getFileIcon };
39
+ function getFolderIcon(e) {
40
+ return e ? FolderOpen : Folder;
41
+ }
42
+ export { getFileIcon, getFolderIcon };