@burdenoff/fluidgrids-fe-sdk 2026.715.1 → 2026.716.2

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,4 +1,4 @@
1
- export { WorkflowBuilder } from './chunk-LRHIL5LS.js';
1
+ export { WorkflowBuilder } from './chunk-H4BLEXEZ.js';
2
2
  import './chunk-7VEOUEIN.js';
3
3
  import './chunk-BQXHJIER.js';
4
4
  import './chunk-UYPB5TWQ.js';
@@ -9,5 +9,5 @@ import './chunk-5BDQNSP3.js';
9
9
  import './chunk-WWU2O2SR.js';
10
10
  import './chunk-XQP33UJR.js';
11
11
  import './chunk-Z54K22LP.js';
12
- //# sourceMappingURL=WorkflowBuilder-IQKOCRDB.js.map
13
- //# sourceMappingURL=WorkflowBuilder-IQKOCRDB.js.map
12
+ //# sourceMappingURL=WorkflowBuilder-BB566UM2.js.map
13
+ //# sourceMappingURL=WorkflowBuilder-BB566UM2.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"WorkflowBuilder-IQKOCRDB.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"WorkflowBuilder-BB566UM2.js"}
@@ -13554,10 +13554,39 @@ function DesktopSidebarFragment({
13554
13554
  toast.error("Failed to load template details");
13555
13555
  return;
13556
13556
  }
13557
- const content = fullTemplate.content;
13557
+ let content = fullTemplate.content;
13558
13558
  if (!content?.definitionJson) {
13559
- toast.error("Template does not contain valid workflow data");
13560
- return;
13559
+ const m = fullTemplate.manifest;
13560
+ let nodes;
13561
+ let edges = [];
13562
+ let workflowName;
13563
+ if (m) {
13564
+ if (Array.isArray(m.nodes)) {
13565
+ nodes = m.nodes;
13566
+ edges = m.edges ?? [];
13567
+ workflowName = m.name;
13568
+ } else if (typeof m.jsonContent === "string") {
13569
+ try {
13570
+ const parsed = JSON.parse(m.jsonContent);
13571
+ if (Array.isArray(parsed.nodes)) {
13572
+ nodes = parsed.nodes;
13573
+ edges = parsed.edges ?? [];
13574
+ workflowName = parsed.name;
13575
+ }
13576
+ } catch {
13577
+ }
13578
+ }
13579
+ }
13580
+ if (nodes) {
13581
+ content = {
13582
+ definitionJson: { nodes, edges },
13583
+ requiredNodeTypes: [],
13584
+ defaultWorkflowName: workflowName ?? fullTemplate.name
13585
+ };
13586
+ } else {
13587
+ toast.error("Template does not contain valid workflow data");
13588
+ return;
13589
+ }
13561
13590
  }
13562
13591
  const nodeCheck = buildNodeCheck(content);
13563
13592
  const needsConfig = content.requiredInputs && content.requiredInputs.length > 0 || nodeCheck.missing.length > 0 || nodeCheck.missingPaid.length > 0 || content.requiredCredentialTypes && content.requiredCredentialTypes.length > 0;
@@ -23141,16 +23170,17 @@ var FlowBuilderPage = ({
23141
23170
  const isReadOnly = readOnly || searchParams.get("readonly") === "true";
23142
23171
  const resetWorkflow = useFlowStore((s) => s.actions.resetWorkflow);
23143
23172
  const [isStoreReady, setIsStoreReady] = useState(false);
23144
- const hasHydrated = useRef(false);
23173
+ const syncedWorkflowRef = useRef(null);
23145
23174
  useLayoutEffect(() => {
23146
- if (hasHydrated.current) return;
23147
- hasHydrated.current = true;
23148
- if (workflow?.nodes) {
23149
- registerWorkflowNodeTypes(workflow.nodes);
23150
- }
23151
- resetWorkflow();
23152
- if (workflow) {
23153
- setWorkflow(workflow);
23175
+ if (syncedWorkflowRef.current !== workflow) {
23176
+ syncedWorkflowRef.current = workflow;
23177
+ if (workflow?.nodes) {
23178
+ registerWorkflowNodeTypes(workflow.nodes);
23179
+ }
23180
+ resetWorkflow();
23181
+ if (workflow) {
23182
+ setWorkflow(workflow);
23183
+ }
23154
23184
  }
23155
23185
  setIsStoreReady(true);
23156
23186
  }, [resetWorkflow, setWorkflow, workflow]);
@@ -23185,6 +23215,8 @@ function WorkflowItem({
23185
23215
  const { getWorkflow } = useLazyWorkflowDefinition();
23186
23216
  const { createWorkflow } = useCreateWorkflow();
23187
23217
  const creatingRef = useRef(false);
23218
+ const fromSharedLoadedRef = useRef(false);
23219
+ const fetchedWorkflowRef = useRef(null);
23188
23220
  const newWorkflow = useMemo(
23189
23221
  () => ({
23190
23222
  id: id ?? "",
@@ -23209,12 +23241,15 @@ function WorkflowItem({
23209
23241
  const loadWorkflow = async () => {
23210
23242
  try {
23211
23243
  resetWorkflow();
23244
+ if (version && mounted) {
23245
+ setIsLoading(true);
23246
+ }
23212
23247
  if (!version) {
23213
23248
  const fromSharedId = typeof window !== "undefined" ? new URLSearchParams(window.location.search).get("fromShared") : null;
23214
- const pendingManifestJson = fromSharedId && typeof sessionStorage !== "undefined" ? sessionStorage.getItem("pendingSharedWorkflow") : null;
23249
+ const pendingManifestJson = fromSharedId && typeof localStorage !== "undefined" ? localStorage.getItem("pendingSharedWorkflow") : null;
23215
23250
  if (fromSharedId && pendingManifestJson) {
23216
23251
  try {
23217
- sessionStorage.removeItem("pendingSharedWorkflow");
23252
+ localStorage.removeItem("pendingSharedWorkflow");
23218
23253
  const manifest = JSON.parse(pendingManifestJson);
23219
23254
  if (mounted) {
23220
23255
  setWorkflow({
@@ -23224,12 +23259,18 @@ function WorkflowItem({
23224
23259
  edges: manifest.edges ?? []
23225
23260
  });
23226
23261
  setIsLoading(false);
23262
+ fromSharedLoadedRef.current = true;
23227
23263
  }
23228
23264
  return;
23229
- } catch {
23230
- sessionStorage.removeItem("pendingSharedWorkflow");
23265
+ } catch (e) {
23266
+ console.error("[WorkflowItem] parse error:", e);
23267
+ localStorage.removeItem("pendingSharedWorkflow");
23231
23268
  }
23232
23269
  }
23270
+ if (fromSharedId && fromSharedLoadedRef.current) {
23271
+ if (mounted) setIsLoading(false);
23272
+ return;
23273
+ }
23233
23274
  if (mounted) {
23234
23275
  setWorkflow(newWorkflow);
23235
23276
  setIsLoading(false);
@@ -23239,8 +23280,8 @@ function WorkflowItem({
23239
23280
  const result = await getWorkflow(id, void 0, version);
23240
23281
  const definitionJson = result?.definitionJson;
23241
23282
  const defData = definitionJson?.data ?? (definitionJson?.nodes ? definitionJson : void 0);
23242
- if (mounted && defData) {
23243
- setWorkflow({
23283
+ if (defData) {
23284
+ const workflowState = {
23244
23285
  ...defData,
23245
23286
  id: result?.workflowKey ?? "",
23246
23287
  workflowKey: result?.workflowKey ?? "",
@@ -23249,8 +23290,18 @@ function WorkflowItem({
23249
23290
  alias: result?.alias ?? "",
23250
23291
  dbId: result?.id ?? "",
23251
23292
  status: result?.status ?? "DRAFT"
23252
- });
23253
- } else if (mounted) {
23293
+ };
23294
+ fetchedWorkflowRef.current = workflowState;
23295
+ if (mounted) {
23296
+ setWorkflow(workflowState);
23297
+ }
23298
+ return;
23299
+ }
23300
+ if (mounted) {
23301
+ if (fetchedWorkflowRef.current) {
23302
+ setWorkflow(fetchedWorkflowRef.current);
23303
+ return;
23304
+ }
23254
23305
  if (!creatingRef.current) {
23255
23306
  creatingRef.current = true;
23256
23307
  const initialDefinitionJson = {
@@ -23285,26 +23336,20 @@ function WorkflowItem({
23285
23336
  status: created.status ?? "DRAFT"
23286
23337
  });
23287
23338
  } else if (mounted) {
23288
- console.warn(
23289
- "[debug] Workflow creation returned null, using template"
23290
- );
23291
23339
  setWorkflow(newWorkflow);
23292
23340
  }
23293
23341
  } catch (createError) {
23294
- console.error("[debug] Error creating workflow:", createError);
23342
+ console.error("[WorkflowItem] Error creating workflow:", createError);
23295
23343
  if (mounted) {
23296
- setWorkflow(newWorkflow);
23344
+ setWorkflow(fetchedWorkflowRef.current ?? newWorkflow);
23297
23345
  }
23298
23346
  }
23299
23347
  }
23300
23348
  }
23301
23349
  } catch (error) {
23302
- console.error(
23303
- "[debug][workflowItem.useEffect] Error fetching workflow:",
23304
- error
23305
- );
23350
+ console.error("[WorkflowItem] Error loading workflow:", error);
23306
23351
  if (mounted) {
23307
- setWorkflow(newWorkflow);
23352
+ setWorkflow(fetchedWorkflowRef.current ?? newWorkflow);
23308
23353
  }
23309
23354
  } finally {
23310
23355
  if (mounted) {
@@ -23360,5 +23405,5 @@ function WorkflowBuilder() {
23360
23405
  }
23361
23406
 
23362
23407
  export { Card2 as Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ConfigSchemaForm, ConnectionFormDialog, ConnectionSelector, FlowBuilderPage, FluidGridsProvider, ProviderPicker, TemplateCard, WorkflowBuilder, getProviderForm, listCustomBlocks, refetchStoreNodes, registerCustomBlock, resolveUiSpec, stripSubmitActions, useConnection, useConnectionDialog, useConnections, useConnectionsByProvider, useCreateConnection, useFluidGridsContext, useImportWorkflowTemplate, useInitiateOAuth, useNodeExecution, useProviderByKey, useProviderCatalog, useProviders, useWorkflowTemplates };
23363
- //# sourceMappingURL=chunk-LRHIL5LS.js.map
23364
- //# sourceMappingURL=chunk-LRHIL5LS.js.map
23408
+ //# sourceMappingURL=chunk-H4BLEXEZ.js.map
23409
+ //# sourceMappingURL=chunk-H4BLEXEZ.js.map