@squeed/flow-sdk 2.0.16 → 2.0.18

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.
package/dist/index.d.cts CHANGED
@@ -125,6 +125,8 @@ export declare interface ConnectionsOnlyToggleProps {
125
125
  label?: string;
126
126
  }
127
127
 
128
+ export declare type ContentFormat = "markdown" | "html" | "jsx";
129
+
128
130
  export declare const contentObjTheme: (color: any) => {
129
131
  background: any;
130
132
  highlight: string;
@@ -203,6 +205,13 @@ export declare function createJsonStream<Document>(options: JsonStreamOptions<Do
203
205
  cancel(): void;
204
206
  };
205
207
 
208
+ export declare function createWorkflowExecution<Input>(adapter: WorkflowExecutionAdapter<Input>, onChange: (state: WorkflowExecutionState) => void): {
209
+ getState: () => WorkflowExecutionState;
210
+ run(input: Input, executionId?: string): Promise<WorkflowExecutionState>;
211
+ cancel(): Promise<void>;
212
+ dispose(): void;
213
+ };
214
+
206
215
  export declare interface CustomEdgeContext {
207
216
  edge: FlowDiagramEdge["data"];
208
217
  source: Box;
@@ -355,6 +364,7 @@ export declare interface FlowDiagramCallbacks {
355
364
  onDirectionChange?: (direction: FlowDirection) => void;
356
365
  onThemeColorChange?: (color: string) => void;
357
366
  onEdgeModeChange?: (mode: EdgeMode) => void;
367
+ onWorkflowConfigurationOpen?: () => void;
358
368
  onWorkflowContractChange?: (contract: WorkflowContract | undefined) => void;
359
369
  /** Fires when array/set mode toggles in bottom bar */
360
370
  onArrayModeChange?: (isArrayMode: boolean) => void;
@@ -613,11 +623,11 @@ export declare interface FlowEngine {
613
623
  centerAndFit(padding?: number, animate?: boolean): void;
614
624
  /** Centre all elements at the current zoom */
615
625
  center(animate?: boolean): void;
616
- /** Fit one currently laid-out node; padding is in screen pixels (default 50). */
617
- focusNode(id: string, padding?: number, animate?: boolean): void;
626
+ /** Fit one node; afterViewChange waits for opening geometry. Padding is in screen pixels (default 50). */
627
+ focusNode(id: string, padding?: number, animate?: boolean, afterViewChange?: boolean): void;
618
628
  /** Fit laid-out hierarchy descendants and outgoing reachable nodes. Does not expand collapsed nodes. Animate overrides config.animateViewport. */
619
629
  focusBranch(id: string, padding?: number, animate?: boolean): void;
620
- focusConnections(id: string, padding?: number, animate?: boolean): void;
630
+ focusConnections(id: string, padding?: number, animate?: boolean, afterViewChange?: boolean): void;
621
631
  isolateConnections(id: string, padding?: number, animate?: boolean): void;
622
632
  /** Temporarily show only this branch and fit it, preserving graph data. */
623
633
  isolateBranch(id: string, padding?: number, animate?: boolean): void;
@@ -836,7 +846,7 @@ export declare function NodeForm({ nodeAddress, structured, }: {
836
846
  structured?: boolean;
837
847
  }): JSX_2.Element;
838
848
 
839
- export declare function NodeFormPopover({ nodeAddress, active, label, open, onClose, children, filter, height, }: {
849
+ export declare function NodeFormPopover({ nodeAddress, active, label, open, onClose, children, filter, height, width, }: {
840
850
  nodeAddress: string;
841
851
  active: boolean;
842
852
  label: string;
@@ -845,6 +855,7 @@ export declare function NodeFormPopover({ nodeAddress, active, label, open, onCl
845
855
  children?: ReactNode;
846
856
  filter?: ReactNode;
847
857
  height?: number;
858
+ width?: number;
848
859
  }): JSX_2.Element;
849
860
 
850
861
  export declare function NodeIconPicker({ nodeId, edgeId, value, open: requestedOpen, onOpenChange, }: {
@@ -1082,7 +1093,7 @@ export declare type SqueedEdgeKey = "$edgeIcon" | "$edgeType" | "$sourceLabel" |
1082
1093
  export declare type SqueedJson = Record<string, any> | any[];
1083
1094
 
1084
1095
  /** Schema keys that live on a node */
1085
- export declare type SqueedNodeKey = "$view" | "$label" | "$subtitle" | "$form" | "$bgColor" | "$textColor" | "$borderColor" | "$borderStyle" | "$borderWidth" | "$borderRadius" | "$fontSize" | "$icon" | "$content" | "$media" | "$collapsed" | "$parent" | "$outline" | "$isNodeAnimated" | "$nodeAnimationVariant" | "$connections" | "$ports";
1096
+ export declare type SqueedNodeKey = "$view" | "$label" | "$subtitle" | "$form" | "$bgColor" | "$textColor" | "$borderColor" | "$borderStyle" | "$borderWidth" | "$borderRadius" | "$fontSize" | "$icon" | "$content" | "$contentFormat" | "$media" | "$collapsed" | "$parent" | "$outline" | "$isNodeAnimated" | "$nodeAnimationVariant" | "$connections" | "$ports";
1086
1097
 
1087
1098
  export declare interface StateFormBinding {
1088
1099
  address: string;
@@ -1163,6 +1174,7 @@ export declare function ToolbarDivider(): JSX_2.Element;
1163
1174
 
1164
1175
  export declare const ToolbarIconButton: ForwardRefExoticComponent<Omit<IconButtonProps & RefAttributes<HTMLButtonElement> & {
1165
1176
  icon: React.ReactElement;
1177
+ rememberAction?: boolean;
1166
1178
  }, "ref"> & RefAttributes<HTMLButtonElement>>;
1167
1179
 
1168
1180
  export declare const ToolbarRangeInput: ForwardRefExoticComponent<Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & RefAttributes<HTMLInputElement>>;
@@ -1174,7 +1186,7 @@ export declare function ToolbarScrollContainer({ children, background, border, e
1174
1186
  endElement?: ReactNode;
1175
1187
  }): JSX_2.Element;
1176
1188
 
1177
- export declare function ToolbarSelect({ children, value, onValueChange, disabled, style, title, icon, popupContent, labelCase, "aria-label": label, ...triggerProps }: {
1189
+ export declare function ToolbarSelect({ children, value, onValueChange, disabled, style, title, icon, popupContent, footer, labelCase, "aria-label": label, ...triggerProps }: {
1178
1190
  children: ReactNode;
1179
1191
  value: string;
1180
1192
  onValueChange: (value: string) => void;
@@ -1183,6 +1195,7 @@ export declare function ToolbarSelect({ children, value, onValueChange, disabled
1183
1195
  title?: string;
1184
1196
  icon?: ReactNode;
1185
1197
  popupContent?: ReactNode;
1198
+ footer?: ReactNode;
1186
1199
  labelCase?: "title" | "preserve";
1187
1200
  "aria-label": string;
1188
1201
  } & Pick<React.ComponentProps<"button">, "id" | "aria-required" | "aria-invalid" | "aria-describedby">): JSX_2.Element;
@@ -1295,4 +1308,41 @@ export declare function WorkflowControls({ showDivider, compact, }?: {
1295
1308
  compact?: boolean;
1296
1309
  }): JSX_2.Element;
1297
1310
 
1311
+ export declare interface WorkflowExecutionAdapter<Input> {
1312
+ execute: (request: WorkflowExecutionRequest<Input>) => Promise<WorkflowExecutionUpdate | void>;
1313
+ subscribe: (request: WorkflowExecutionRequest<Input>, receive: (update: WorkflowExecutionUpdate) => void) => (() => void) | Promise<() => void>;
1314
+ cancel?: (request: WorkflowExecutionRequest<Input>) => Promise<void>;
1315
+ }
1316
+
1317
+ export declare interface WorkflowExecutionRequest<Input> {
1318
+ executionId: string;
1319
+ input: Input;
1320
+ signal: AbortSignal;
1321
+ }
1322
+
1323
+ export declare interface WorkflowExecutionState {
1324
+ executionId: string;
1325
+ status: WorkflowRunStatus;
1326
+ output?: unknown;
1327
+ error?: string;
1328
+ steps: Record<string, NonNullable<WorkflowExecutionUpdate["step"]>>;
1329
+ }
1330
+
1331
+ export declare interface WorkflowExecutionUpdate {
1332
+ executionId: string;
1333
+ status?: WorkflowRunStatus;
1334
+ output?: unknown;
1335
+ error?: string;
1336
+ step?: {
1337
+ id: string;
1338
+ status: WorkflowStepStatus;
1339
+ output?: unknown;
1340
+ error?: string;
1341
+ };
1342
+ }
1343
+
1344
+ export declare type WorkflowRunStatus = "subscribing" | "running" | "paused" | "completed" | "failed" | "cancelled";
1345
+
1346
+ export declare type WorkflowStepStatus = "pending" | "running" | "completed" | "failed" | "skipped";
1347
+
1298
1348
  export { }
package/dist/index.d.ts CHANGED
@@ -125,6 +125,8 @@ export declare interface ConnectionsOnlyToggleProps {
125
125
  label?: string;
126
126
  }
127
127
 
128
+ export declare type ContentFormat = "markdown" | "html" | "jsx";
129
+
128
130
  export declare const contentObjTheme: (color: any) => {
129
131
  background: any;
130
132
  highlight: string;
@@ -203,6 +205,13 @@ export declare function createJsonStream<Document>(options: JsonStreamOptions<Do
203
205
  cancel(): void;
204
206
  };
205
207
 
208
+ export declare function createWorkflowExecution<Input>(adapter: WorkflowExecutionAdapter<Input>, onChange: (state: WorkflowExecutionState) => void): {
209
+ getState: () => WorkflowExecutionState;
210
+ run(input: Input, executionId?: string): Promise<WorkflowExecutionState>;
211
+ cancel(): Promise<void>;
212
+ dispose(): void;
213
+ };
214
+
206
215
  export declare interface CustomEdgeContext {
207
216
  edge: FlowDiagramEdge["data"];
208
217
  source: Box;
@@ -355,6 +364,7 @@ export declare interface FlowDiagramCallbacks {
355
364
  onDirectionChange?: (direction: FlowDirection) => void;
356
365
  onThemeColorChange?: (color: string) => void;
357
366
  onEdgeModeChange?: (mode: EdgeMode) => void;
367
+ onWorkflowConfigurationOpen?: () => void;
358
368
  onWorkflowContractChange?: (contract: WorkflowContract | undefined) => void;
359
369
  /** Fires when array/set mode toggles in bottom bar */
360
370
  onArrayModeChange?: (isArrayMode: boolean) => void;
@@ -613,11 +623,11 @@ export declare interface FlowEngine {
613
623
  centerAndFit(padding?: number, animate?: boolean): void;
614
624
  /** Centre all elements at the current zoom */
615
625
  center(animate?: boolean): void;
616
- /** Fit one currently laid-out node; padding is in screen pixels (default 50). */
617
- focusNode(id: string, padding?: number, animate?: boolean): void;
626
+ /** Fit one node; afterViewChange waits for opening geometry. Padding is in screen pixels (default 50). */
627
+ focusNode(id: string, padding?: number, animate?: boolean, afterViewChange?: boolean): void;
618
628
  /** Fit laid-out hierarchy descendants and outgoing reachable nodes. Does not expand collapsed nodes. Animate overrides config.animateViewport. */
619
629
  focusBranch(id: string, padding?: number, animate?: boolean): void;
620
- focusConnections(id: string, padding?: number, animate?: boolean): void;
630
+ focusConnections(id: string, padding?: number, animate?: boolean, afterViewChange?: boolean): void;
621
631
  isolateConnections(id: string, padding?: number, animate?: boolean): void;
622
632
  /** Temporarily show only this branch and fit it, preserving graph data. */
623
633
  isolateBranch(id: string, padding?: number, animate?: boolean): void;
@@ -836,7 +846,7 @@ export declare function NodeForm({ nodeAddress, structured, }: {
836
846
  structured?: boolean;
837
847
  }): JSX_2.Element;
838
848
 
839
- export declare function NodeFormPopover({ nodeAddress, active, label, open, onClose, children, filter, height, }: {
849
+ export declare function NodeFormPopover({ nodeAddress, active, label, open, onClose, children, filter, height, width, }: {
840
850
  nodeAddress: string;
841
851
  active: boolean;
842
852
  label: string;
@@ -845,6 +855,7 @@ export declare function NodeFormPopover({ nodeAddress, active, label, open, onCl
845
855
  children?: ReactNode;
846
856
  filter?: ReactNode;
847
857
  height?: number;
858
+ width?: number;
848
859
  }): JSX_2.Element;
849
860
 
850
861
  export declare function NodeIconPicker({ nodeId, edgeId, value, open: requestedOpen, onOpenChange, }: {
@@ -1082,7 +1093,7 @@ export declare type SqueedEdgeKey = "$edgeIcon" | "$edgeType" | "$sourceLabel" |
1082
1093
  export declare type SqueedJson = Record<string, any> | any[];
1083
1094
 
1084
1095
  /** Schema keys that live on a node */
1085
- export declare type SqueedNodeKey = "$view" | "$label" | "$subtitle" | "$form" | "$bgColor" | "$textColor" | "$borderColor" | "$borderStyle" | "$borderWidth" | "$borderRadius" | "$fontSize" | "$icon" | "$content" | "$media" | "$collapsed" | "$parent" | "$outline" | "$isNodeAnimated" | "$nodeAnimationVariant" | "$connections" | "$ports";
1096
+ export declare type SqueedNodeKey = "$view" | "$label" | "$subtitle" | "$form" | "$bgColor" | "$textColor" | "$borderColor" | "$borderStyle" | "$borderWidth" | "$borderRadius" | "$fontSize" | "$icon" | "$content" | "$contentFormat" | "$media" | "$collapsed" | "$parent" | "$outline" | "$isNodeAnimated" | "$nodeAnimationVariant" | "$connections" | "$ports";
1086
1097
 
1087
1098
  export declare interface StateFormBinding {
1088
1099
  address: string;
@@ -1163,6 +1174,7 @@ export declare function ToolbarDivider(): JSX_2.Element;
1163
1174
 
1164
1175
  export declare const ToolbarIconButton: ForwardRefExoticComponent<Omit<IconButtonProps & RefAttributes<HTMLButtonElement> & {
1165
1176
  icon: React.ReactElement;
1177
+ rememberAction?: boolean;
1166
1178
  }, "ref"> & RefAttributes<HTMLButtonElement>>;
1167
1179
 
1168
1180
  export declare const ToolbarRangeInput: ForwardRefExoticComponent<Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & RefAttributes<HTMLInputElement>>;
@@ -1174,7 +1186,7 @@ export declare function ToolbarScrollContainer({ children, background, border, e
1174
1186
  endElement?: ReactNode;
1175
1187
  }): JSX_2.Element;
1176
1188
 
1177
- export declare function ToolbarSelect({ children, value, onValueChange, disabled, style, title, icon, popupContent, labelCase, "aria-label": label, ...triggerProps }: {
1189
+ export declare function ToolbarSelect({ children, value, onValueChange, disabled, style, title, icon, popupContent, footer, labelCase, "aria-label": label, ...triggerProps }: {
1178
1190
  children: ReactNode;
1179
1191
  value: string;
1180
1192
  onValueChange: (value: string) => void;
@@ -1183,6 +1195,7 @@ export declare function ToolbarSelect({ children, value, onValueChange, disabled
1183
1195
  title?: string;
1184
1196
  icon?: ReactNode;
1185
1197
  popupContent?: ReactNode;
1198
+ footer?: ReactNode;
1186
1199
  labelCase?: "title" | "preserve";
1187
1200
  "aria-label": string;
1188
1201
  } & Pick<React.ComponentProps<"button">, "id" | "aria-required" | "aria-invalid" | "aria-describedby">): JSX_2.Element;
@@ -1295,4 +1308,41 @@ export declare function WorkflowControls({ showDivider, compact, }?: {
1295
1308
  compact?: boolean;
1296
1309
  }): JSX_2.Element;
1297
1310
 
1311
+ export declare interface WorkflowExecutionAdapter<Input> {
1312
+ execute: (request: WorkflowExecutionRequest<Input>) => Promise<WorkflowExecutionUpdate | void>;
1313
+ subscribe: (request: WorkflowExecutionRequest<Input>, receive: (update: WorkflowExecutionUpdate) => void) => (() => void) | Promise<() => void>;
1314
+ cancel?: (request: WorkflowExecutionRequest<Input>) => Promise<void>;
1315
+ }
1316
+
1317
+ export declare interface WorkflowExecutionRequest<Input> {
1318
+ executionId: string;
1319
+ input: Input;
1320
+ signal: AbortSignal;
1321
+ }
1322
+
1323
+ export declare interface WorkflowExecutionState {
1324
+ executionId: string;
1325
+ status: WorkflowRunStatus;
1326
+ output?: unknown;
1327
+ error?: string;
1328
+ steps: Record<string, NonNullable<WorkflowExecutionUpdate["step"]>>;
1329
+ }
1330
+
1331
+ export declare interface WorkflowExecutionUpdate {
1332
+ executionId: string;
1333
+ status?: WorkflowRunStatus;
1334
+ output?: unknown;
1335
+ error?: string;
1336
+ step?: {
1337
+ id: string;
1338
+ status: WorkflowStepStatus;
1339
+ output?: unknown;
1340
+ error?: string;
1341
+ };
1342
+ }
1343
+
1344
+ export declare type WorkflowRunStatus = "subscribing" | "running" | "paused" | "completed" | "failed" | "cancelled";
1345
+
1346
+ export declare type WorkflowStepStatus = "pending" | "running" | "completed" | "failed" | "skipped";
1347
+
1298
1348
  export { }