@datatechsolutions/ui 2.11.7 → 2.11.9

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.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkTKLALDY4_js = require('../chunk-TKLALDY4.js');
4
+ var chunkLFWRE3A3_js = require('../chunk-LFWRE3A3.js');
5
5
  require('../chunk-4XID6LOC.js');
6
6
  require('../chunk-S7KHTUHA.js');
7
7
  require('../chunk-UZ3CMNUJ.js');
@@ -13,7 +13,7 @@ require('../chunk-YXN2K77G.js');
13
13
 
14
14
  Object.defineProperty(exports, "Workspace", {
15
15
  enumerable: true,
16
- get: function () { return chunkTKLALDY4_js.Workspace; }
16
+ get: function () { return chunkLFWRE3A3_js.Workspace; }
17
17
  });
18
18
  //# sourceMappingURL=workflow-canvas.js.map
19
19
  //# sourceMappingURL=workflow-canvas.js.map
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- export { Workspace } from '../chunk-76MHUX4T.mjs';
2
+ export { Workspace } from '../chunk-VWKBMTTC.mjs';
3
3
  import '../chunk-46ZM5VJJ.mjs';
4
4
  import '../chunk-QWG2FMUN.mjs';
5
5
  import '../chunk-D2JF6C3E.mjs';
@@ -210,47 +210,84 @@ var useWorkflowStore = zustand.create((set, get) => ({
210
210
  });
211
211
  }
212
212
  }));
213
- var useModalStore = zustand.create((set) => ({
213
+ var EMPTY_STATE = {
214
214
  activeModal: null,
215
215
  agentData: null,
216
- subworkflowData: null,
217
216
  logicNodeData: null,
218
- pipelineSettingsData: null,
219
- openAgentModal: (agent, models, isCreateMode = false) => set({
220
- activeModal: "agent",
221
- agentData: { agent, models, isCreateMode },
222
- subworkflowData: null,
223
- logicNodeData: null,
224
- pipelineSettingsData: null
225
- }),
226
- openSubworkflowModal: (tool) => set({
227
- activeModal: "subworkflow",
228
- subworkflowData: { tool },
229
- agentData: null,
230
- logicNodeData: null,
231
- pipelineSettingsData: null
232
- }),
233
- openLogicNodeModal: (nodeId, nodeLabel, config) => set({
234
- activeModal: "logic-node",
235
- logicNodeData: { nodeId, nodeLabel, config },
236
- agentData: null,
237
- subworkflowData: null,
238
- pipelineSettingsData: null
239
- }),
240
- openPipelineSettingsModal: (name, description) => set({
241
- activeModal: "pipeline-settings",
242
- pipelineSettingsData: { name, description },
243
- agentData: null,
244
- subworkflowData: null,
245
- logicNodeData: null
246
- }),
247
- closeModal: () => set({
248
- activeModal: null,
249
- agentData: null,
250
- subworkflowData: null,
251
- logicNodeData: null,
252
- pipelineSettingsData: null
253
- })
217
+ pipelineSettingsData: null
218
+ };
219
+ var useModalStore = zustand.create((set, get) => ({
220
+ ...EMPTY_STATE,
221
+ stack: [],
222
+ openAgentModal: (agent, models, isCreateMode = false) => {
223
+ const current = get();
224
+ const entry = {
225
+ type: current.activeModal,
226
+ agentData: current.agentData,
227
+ logicNodeData: current.logicNodeData,
228
+ pipelineSettingsData: current.pipelineSettingsData
229
+ };
230
+ const newStack = current.activeModal ? [...current.stack, entry] : current.stack;
231
+ set({
232
+ activeModal: "agent",
233
+ agentData: { agent, models, isCreateMode },
234
+ logicNodeData: null,
235
+ pipelineSettingsData: null,
236
+ stack: newStack
237
+ });
238
+ },
239
+ openLogicNodeModal: (nodeId, nodeLabel, config) => {
240
+ const current = get();
241
+ const entry = {
242
+ type: current.activeModal,
243
+ agentData: current.agentData,
244
+ logicNodeData: current.logicNodeData,
245
+ pipelineSettingsData: current.pipelineSettingsData
246
+ };
247
+ const newStack = current.activeModal ? [...current.stack, entry] : current.stack;
248
+ set({
249
+ activeModal: "logic-node",
250
+ logicNodeData: { nodeId, nodeLabel, config },
251
+ agentData: null,
252
+ pipelineSettingsData: null,
253
+ stack: newStack
254
+ });
255
+ },
256
+ openPipelineSettingsModal: (name, description) => {
257
+ const current = get();
258
+ const entry = {
259
+ type: current.activeModal,
260
+ agentData: current.agentData,
261
+ logicNodeData: current.logicNodeData,
262
+ pipelineSettingsData: current.pipelineSettingsData
263
+ };
264
+ const newStack = current.activeModal ? [...current.stack, entry] : current.stack;
265
+ set({
266
+ activeModal: "pipeline-settings",
267
+ pipelineSettingsData: { name, description },
268
+ agentData: null,
269
+ logicNodeData: null,
270
+ stack: newStack
271
+ });
272
+ },
273
+ closeModal: () => {
274
+ const { stack } = get();
275
+ if (stack.length > 0) {
276
+ const previous = stack[stack.length - 1];
277
+ set({
278
+ activeModal: previous.type,
279
+ agentData: previous.agentData,
280
+ logicNodeData: previous.logicNodeData,
281
+ pipelineSettingsData: previous.pipelineSettingsData,
282
+ stack: stack.slice(0, -1)
283
+ });
284
+ } else {
285
+ set({ ...EMPTY_STATE, stack: [] });
286
+ }
287
+ },
288
+ closeAllModals: () => {
289
+ set({ ...EMPTY_STATE, stack: [] });
290
+ }
254
291
  }));
255
292
  var GRAPH_ACTIVE_EDGE_COLOR = "#14b8a6";
256
293
  var GRAPH_TRUE_EDGE_COLOR = "#22c55e";
@@ -7106,5 +7143,5 @@ exports.useModalStore = useModalStore;
7106
7143
  exports.useWorkflowBuilderClient = useWorkflowBuilderClient;
7107
7144
  exports.useWorkflowBuilderClientOptional = useWorkflowBuilderClientOptional;
7108
7145
  exports.useWorkflowStore = useWorkflowStore;
7109
- //# sourceMappingURL=chunk-TKLALDY4.js.map
7110
- //# sourceMappingURL=chunk-TKLALDY4.js.map
7146
+ //# sourceMappingURL=chunk-LFWRE3A3.js.map
7147
+ //# sourceMappingURL=chunk-LFWRE3A3.js.map