@datatechsolutions/ui 2.11.7 → 2.11.8

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.
@@ -208,47 +208,84 @@ var useWorkflowStore = create((set, get) => ({
208
208
  });
209
209
  }
210
210
  }));
211
- var useModalStore = create((set) => ({
211
+ var EMPTY_STATE = {
212
212
  activeModal: null,
213
213
  agentData: null,
214
- subworkflowData: null,
215
214
  logicNodeData: null,
216
- pipelineSettingsData: null,
217
- openAgentModal: (agent, models, isCreateMode = false) => set({
218
- activeModal: "agent",
219
- agentData: { agent, models, isCreateMode },
220
- subworkflowData: null,
221
- logicNodeData: null,
222
- pipelineSettingsData: null
223
- }),
224
- openSubworkflowModal: (tool) => set({
225
- activeModal: "subworkflow",
226
- subworkflowData: { tool },
227
- agentData: null,
228
- logicNodeData: null,
229
- pipelineSettingsData: null
230
- }),
231
- openLogicNodeModal: (nodeId, nodeLabel, config) => set({
232
- activeModal: "logic-node",
233
- logicNodeData: { nodeId, nodeLabel, config },
234
- agentData: null,
235
- subworkflowData: null,
236
- pipelineSettingsData: null
237
- }),
238
- openPipelineSettingsModal: (name, description) => set({
239
- activeModal: "pipeline-settings",
240
- pipelineSettingsData: { name, description },
241
- agentData: null,
242
- subworkflowData: null,
243
- logicNodeData: null
244
- }),
245
- closeModal: () => set({
246
- activeModal: null,
247
- agentData: null,
248
- subworkflowData: null,
249
- logicNodeData: null,
250
- pipelineSettingsData: null
251
- })
215
+ pipelineSettingsData: null
216
+ };
217
+ var useModalStore = create((set, get) => ({
218
+ ...EMPTY_STATE,
219
+ stack: [],
220
+ openAgentModal: (agent, models, isCreateMode = false) => {
221
+ const current = get();
222
+ const entry = {
223
+ type: current.activeModal,
224
+ agentData: current.agentData,
225
+ logicNodeData: current.logicNodeData,
226
+ pipelineSettingsData: current.pipelineSettingsData
227
+ };
228
+ const newStack = current.activeModal ? [...current.stack, entry] : current.stack;
229
+ set({
230
+ activeModal: "agent",
231
+ agentData: { agent, models, isCreateMode },
232
+ logicNodeData: null,
233
+ pipelineSettingsData: null,
234
+ stack: newStack
235
+ });
236
+ },
237
+ openLogicNodeModal: (nodeId, nodeLabel, config) => {
238
+ const current = get();
239
+ const entry = {
240
+ type: current.activeModal,
241
+ agentData: current.agentData,
242
+ logicNodeData: current.logicNodeData,
243
+ pipelineSettingsData: current.pipelineSettingsData
244
+ };
245
+ const newStack = current.activeModal ? [...current.stack, entry] : current.stack;
246
+ set({
247
+ activeModal: "logic-node",
248
+ logicNodeData: { nodeId, nodeLabel, config },
249
+ agentData: null,
250
+ pipelineSettingsData: null,
251
+ stack: newStack
252
+ });
253
+ },
254
+ openPipelineSettingsModal: (name, description) => {
255
+ const current = get();
256
+ const entry = {
257
+ type: current.activeModal,
258
+ agentData: current.agentData,
259
+ logicNodeData: current.logicNodeData,
260
+ pipelineSettingsData: current.pipelineSettingsData
261
+ };
262
+ const newStack = current.activeModal ? [...current.stack, entry] : current.stack;
263
+ set({
264
+ activeModal: "pipeline-settings",
265
+ pipelineSettingsData: { name, description },
266
+ agentData: null,
267
+ logicNodeData: null,
268
+ stack: newStack
269
+ });
270
+ },
271
+ closeModal: () => {
272
+ const { stack } = get();
273
+ if (stack.length > 0) {
274
+ const previous = stack[stack.length - 1];
275
+ set({
276
+ activeModal: previous.type,
277
+ agentData: previous.agentData,
278
+ logicNodeData: previous.logicNodeData,
279
+ pipelineSettingsData: previous.pipelineSettingsData,
280
+ stack: stack.slice(0, -1)
281
+ });
282
+ } else {
283
+ set({ ...EMPTY_STATE, stack: [] });
284
+ }
285
+ },
286
+ closeAllModals: () => {
287
+ set({ ...EMPTY_STATE, stack: [] });
288
+ }
252
289
  }));
253
290
  var GRAPH_ACTIVE_EDGE_COLOR = "#14b8a6";
254
291
  var GRAPH_TRUE_EDGE_COLOR = "#22c55e";
@@ -7046,5 +7083,5 @@ function Workspace({
7046
7083
  }
7047
7084
 
7048
7085
  export { AgentFlowNode, AgentToolFlowNode, AnswerFlowNode, AnthropicIcon, CATEGORY_COLORS, CATEGORY_PILL_COLORS, CodeFlowNode, CrewAIIcon, DocumentExtractorFlowNode, EndFlowNode, EntityFlowNode, FRAMEWORK_META, GoogleADKIcon, GroupFlowNode, HttpRequestFlowNode, ICON_MAP, IfElseFlowNode, IterationFlowNode, IterationStartFlowNode, KnowledgeBaseFlowNode, LOGIC_ICON_MAP, LOGIC_NODE_BADGE_COLORS, LOGIC_NODE_GRADIENTS, LOGIC_NODE_HANDLE_COLORS, LangChainIcon, ListOperatorFlowNode, LogicNodeModal, MINIMAP_NODE_COLORS, NodeCard, NodeContextMenu, NoteFlowNode, OpenAIIcon, PanelContextMenu, ParameterExtractorFlowNode, QuestionClassifierFlowNode, RuleFlowNode, SelectionContextMenu, StartFlowNode, StrandsIcon, TemplateTransformFlowNode, ToolFlowNode, VariableAggregatorFlowNode, VariableAssignerFlowNode, WorkflowBuilderProvider, WorkflowCanvas, Workspace, getCompatibleModels, getDefaultFrameworkForModel, getEntityBadgeColor, getEntityGradient, getEntityHandleColor, getEntityIcon, getEntityMinimapColor, getFrameworkMeta, isModelCompatibleWithFramework, useModalStore, useWorkflowBuilderClient, useWorkflowBuilderClientOptional, useWorkflowStore };
7049
- //# sourceMappingURL=chunk-76MHUX4T.mjs.map
7050
- //# sourceMappingURL=chunk-76MHUX4T.mjs.map
7086
+ //# sourceMappingURL=chunk-VWKBMTTC.mjs.map
7087
+ //# sourceMappingURL=chunk-VWKBMTTC.mjs.map