@burdenoff/fluidgrids-fe-sdk 2026.706.3 → 2026.707.1

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-J3QYVOIS.js';
1
+ export { WorkflowBuilder } from './chunk-VJRIO6JW.js';
2
2
  import './chunk-7VEOUEIN.js';
3
3
  import './chunk-BQXHJIER.js';
4
4
  import './chunk-LUGJJ7LL.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-6I7NDTCJ.js.map
13
- //# sourceMappingURL=WorkflowBuilder-6I7NDTCJ.js.map
12
+ //# sourceMappingURL=WorkflowBuilder-HCFEF5VJ.js.map
13
+ //# sourceMappingURL=WorkflowBuilder-HCFEF5VJ.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"WorkflowBuilder-6I7NDTCJ.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"WorkflowBuilder-HCFEF5VJ.js"}
@@ -7979,12 +7979,14 @@ function useSaveWorkflow() {
7979
7979
  }
7980
7980
  }
7981
7981
  }
7982
+ return true;
7982
7983
  } catch (error) {
7983
7984
  const message = error instanceof Error ? error.message : "Unknown error";
7984
7985
  console.error("Error saving workflow:", message);
7985
7986
  toast.error("Failed to save workflow", {
7986
7987
  description: message
7987
7988
  });
7989
+ return false;
7988
7990
  } finally {
7989
7991
  setIsSaving(false);
7990
7992
  }
@@ -8011,6 +8013,11 @@ function NodePropertyPanel({
8011
8013
  const [filteredJobs, setFilteredJobs] = useState([]);
8012
8014
  const [searchTerm, setSearchTerm] = useState("");
8013
8015
  const [isLoading, setIsLoading] = useState(false);
8016
+ const [dataSinkSaveState, setDataSinkSaveState] = useState("idle");
8017
+ const [dataSinkSaveMessage, setDataSinkSaveMessage] = useState("");
8018
+ const [dataSinkKeyDraft, setDataSinkKeyDraft] = useState("");
8019
+ const dataSinkSaveInFlightRef = useRef(false);
8020
+ const dataSinkSaveNodeIdRef = useRef(null);
8014
8021
  useFlowStore((s) => s.workflow.id);
8015
8022
  const { saveToBackend, isSaving } = useSaveWorkflow();
8016
8023
  const operationsArray = useMemo(() => {
@@ -8098,6 +8105,20 @@ function NodePropertyPanel({
8098
8105
  () => String(type) === "store/bigconsole_datasink" && effectiveCurrentOperation?.name === "postDataToDataSink",
8099
8106
  [effectiveCurrentOperation?.name, type]
8100
8107
  );
8108
+ useEffect(() => {
8109
+ if (!shouldSaveConfigurationToBackend) {
8110
+ setDataSinkKeyDraft("");
8111
+ setDataSinkSaveState("idle");
8112
+ setDataSinkSaveMessage("");
8113
+ return;
8114
+ }
8115
+ setDataSinkKeyDraft(String(data?.args?.state?.dataSinkKey ?? ""));
8116
+ if (dataSinkSaveInFlightRef.current && dataSinkSaveNodeIdRef.current === id) {
8117
+ return;
8118
+ }
8119
+ setDataSinkSaveState("idle");
8120
+ setDataSinkSaveMessage("");
8121
+ }, [data?.args?.state?.dataSinkKey, id, shouldSaveConfigurationToBackend]);
8101
8122
  const connectionAdapters = useMemo(
8102
8123
  () => effectiveCurrentOperation?.connectionAdapters || effectiveCurrentOperation?.credentialAdapters || data?.nodeData?.connectionAdapters || data?.nodeData?.credentialAdapters || [],
8103
8124
  [
@@ -8168,18 +8189,73 @@ function NodePropertyPanel({
8168
8189
  }
8169
8190
  current[keys[keys.length - 1]] = value;
8170
8191
  }
8192
+ if (shouldSaveConfigurationToBackend && (isSaving || dataSinkSaveInFlightRef.current)) {
8193
+ setDataSinkSaveState("saving");
8194
+ setDataSinkSaveMessage("A workflow save is already in progress\u2026");
8195
+ toast.info("A workflow save is already in progress");
8196
+ return;
8197
+ }
8198
+ if (shouldSaveConfigurationToBackend) {
8199
+ const dataSinkKey = String(newState.dataSinkKey ?? "").trim();
8200
+ if (!dataSinkKey) {
8201
+ setDataSinkSaveState("error");
8202
+ setDataSinkSaveMessage("Enter a DataSink Key before saving.");
8203
+ toast.error("Enter a DataSink Key before saving");
8204
+ return;
8205
+ }
8206
+ dataSinkSaveInFlightRef.current = true;
8207
+ dataSinkSaveNodeIdRef.current = id;
8208
+ setDataSinkKeyDraft(dataSinkKey);
8209
+ newState.dataSinkKey = dataSinkKey;
8210
+ }
8171
8211
  updateData({
8172
8212
  args: {
8173
8213
  ...data?.args ?? {},
8174
8214
  state: newState
8175
8215
  }
8176
8216
  });
8177
- if (shouldSaveConfigurationToBackend && !isSaving) {
8217
+ if (shouldSaveConfigurationToBackend) {
8218
+ const dataSinkKey = String(newState.dataSinkKey ?? "");
8219
+ setDataSinkSaveState("saving");
8220
+ setDataSinkSaveMessage(`Saving DataSink key \u201C${dataSinkKey}\u201D\u2026`);
8221
+ const toastId = toast.loading("Saving DataSink key", {
8222
+ description: dataSinkKey
8223
+ });
8178
8224
  window.setTimeout(() => {
8179
- void saveToBackend().catch((error) => {
8225
+ void saveToBackend().then((saved) => {
8226
+ if (!saved) {
8227
+ setDataSinkSaveState("error");
8228
+ setDataSinkSaveMessage(
8229
+ "Workflow save failed. The DataSink key was not persisted."
8230
+ );
8231
+ toast.error("Failed to save DataSink key", {
8232
+ id: toastId,
8233
+ description: "Workflow save failed."
8234
+ });
8235
+ return;
8236
+ }
8237
+ setDataSinkSaveState("saved");
8238
+ setDataSinkSaveMessage(
8239
+ `DataSink key \u201C${dataSinkKey}\u201D saved to the workflow.`
8240
+ );
8241
+ toast.success("DataSink key saved", {
8242
+ id: toastId,
8243
+ description: "Workflow configuration was saved successfully."
8244
+ });
8245
+ }).catch((error) => {
8246
+ const message = error instanceof Error ? error.message : "Failed to save DataSink configuration";
8247
+ setDataSinkSaveState("error");
8248
+ setDataSinkSaveMessage(message);
8180
8249
  console.error("Error saving DataSink configuration:", error);
8250
+ toast.error("Failed to save DataSink key", {
8251
+ id: toastId,
8252
+ description: message
8253
+ });
8254
+ }).finally(() => {
8255
+ dataSinkSaveInFlightRef.current = false;
8256
+ dataSinkSaveNodeIdRef.current = null;
8181
8257
  });
8182
- }, 0);
8258
+ }, 100);
8183
8259
  }
8184
8260
  };
8185
8261
  const resolvedUi = useMemo(
@@ -8256,7 +8332,56 @@ function NodePropertyPanel({
8256
8332
  ] }),
8257
8333
  /* @__PURE__ */ jsxs("div", { className: "flex pt-5 flex-col", children: [
8258
8334
  /* @__PURE__ */ jsx("div", { className: "text-xs text-card-foreground/60 font-semibold", children: "Properties" }),
8259
- resolvedUi ? /* @__PURE__ */ jsx(
8335
+ shouldSaveConfigurationToBackend ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 pt-2", children: [
8336
+ /* @__PURE__ */ jsxs("div", { children: [
8337
+ /* @__PURE__ */ jsx("div", { className: "text-lg font-semibold text-card-foreground", children: "Send Data to BigConsole DataSink" }),
8338
+ /* @__PURE__ */ jsx("p", { className: "mt-3 text-sm text-muted-foreground", children: "Choose the DataSink key. Data is taken automatically from the previous node, and the BigConsole connection is handled automatically." })
8339
+ ] }),
8340
+ /* @__PURE__ */ jsxs("label", { className: "flex flex-col gap-2 text-sm font-medium text-card-foreground", children: [
8341
+ /* @__PURE__ */ jsxs("span", { children: [
8342
+ "DataSink Key",
8343
+ " ",
8344
+ /* @__PURE__ */ jsx("span", { className: "text-[var(--color-status-error-text)]", children: "*" })
8345
+ ] }),
8346
+ /* @__PURE__ */ jsx(
8347
+ "input",
8348
+ {
8349
+ type: "text",
8350
+ value: dataSinkKeyDraft,
8351
+ onChange: (event) => {
8352
+ setDataSinkKeyDraft(event.target.value);
8353
+ if (dataSinkSaveState !== "idle") {
8354
+ setDataSinkSaveState("idle");
8355
+ setDataSinkSaveMessage("");
8356
+ }
8357
+ },
8358
+ placeholder: "Target DataSink key (e.g., users_analytics)",
8359
+ className: "w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none transition-colors placeholder:text-muted-foreground focus:border-primary focus:ring-2 focus:ring-primary/20 disabled:opacity-50",
8360
+ disabled: dataSinkSaveState === "saving" || isSaving
8361
+ }
8362
+ )
8363
+ ] }),
8364
+ /* @__PURE__ */ jsx(
8365
+ "button",
8366
+ {
8367
+ type: "button",
8368
+ onClick: () => submittedData({ dataSinkKey: dataSinkKeyDraft }),
8369
+ disabled: dataSinkSaveState === "saving" || isSaving,
8370
+ className: "self-start rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",
8371
+ children: dataSinkSaveState === "saving" || isSaving ? "Saving\u2026" : "Save Configuration"
8372
+ }
8373
+ ),
8374
+ dataSinkSaveMessage ? /* @__PURE__ */ jsx(
8375
+ "div",
8376
+ {
8377
+ className: [
8378
+ "rounded-md border px-3 py-2 text-xs",
8379
+ dataSinkSaveState === "saved" ? "border-[var(--color-status-success-border)] bg-[var(--color-status-success-bg-subtle)] text-[var(--color-status-success-text)]" : dataSinkSaveState === "error" ? "border-[var(--color-status-error-border)] bg-[var(--color-status-error-bg-subtle)] text-[var(--color-status-error-text)]" : "border-border bg-muted/30 text-muted-foreground"
8380
+ ].join(" "),
8381
+ children: dataSinkSaveMessage
8382
+ }
8383
+ ) : null
8384
+ ] }) : resolvedUi ? /* @__PURE__ */ jsx(
8260
8385
  BlocksRenderer,
8261
8386
  {
8262
8387
  spec: resolvedUi.spec,
@@ -23104,5 +23229,5 @@ function WorkflowBuilder() {
23104
23229
  }
23105
23230
 
23106
23231
  export { Card2 as Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ConfigSchemaForm, ConnectionFormDialog, ConnectionSelector, FlowBuilderPage, FluidGridsProvider, ProviderPicker, TemplateCard, ThemeProvider, WorkflowBuilder, getProviderForm, listCustomBlocks, refetchStoreNodes, registerCustomBlock, resolveUiSpec, stripSubmitActions, useConnection, useConnectionDialog, useConnections, useConnectionsByProvider, useCreateConnection, useFluidGridsContext, useImportWorkflowTemplate, useInitiateOAuth, useNodeExecution, useProviderByKey, useProviderCatalog, useProviders, useWorkflowTemplates };
23107
- //# sourceMappingURL=chunk-J3QYVOIS.js.map
23108
- //# sourceMappingURL=chunk-J3QYVOIS.js.map
23232
+ //# sourceMappingURL=chunk-VJRIO6JW.js.map
23233
+ //# sourceMappingURL=chunk-VJRIO6JW.js.map