@squeed/flow-sdk 2.0.34 → 2.0.36

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
@@ -6,6 +6,7 @@ import { IconButtonProps } from '@chakra-ui/react';
6
6
  import { InputHTMLAttributes } from 'react';
7
7
  import { JSX as JSX_2 } from 'react/jsx-runtime';
8
8
  import { MemoExoticComponent } from 'react';
9
+ import { MouseEventHandler } from 'react';
9
10
  import { MutableRefObject } from 'react';
10
11
  import { ReactNode } from 'react';
11
12
  import { ReactPortal } from 'react';
@@ -133,6 +134,11 @@ export declare interface ConnectionsOnlyToggleProps {
133
134
 
134
135
  export declare type ContentFormat = "markdown" | "html" | "jsx";
135
136
 
137
+ export declare const ContentFullscreenButton: ForwardRefExoticComponent< {
138
+ fullscreen: boolean;
139
+ onClick: MouseEventHandler<HTMLButtonElement>;
140
+ } & RefAttributes<HTMLButtonElement>>;
141
+
136
142
  export declare const contentObjTheme: (color: any) => {
137
143
  background: any;
138
144
  highlight: string;
@@ -341,6 +347,7 @@ export declare interface FlowDiagramCallbacks {
341
347
  onNodeLabelChange?: (nodeId: string, newLabel: string) => void;
342
348
  onNodeSubtitleChange?: (nodeId: string, subtitle: string) => void;
343
349
  onNodeContentChange?: (nodeId: string, content: NodeContent) => void;
350
+ onNodeDimensionChange?: (nodeId: string, dimension: "width" | "height", value: number | undefined) => void;
344
351
  /** Fires when a node's collapse toggle is clicked */
345
352
  onNodeCollapse?: (nodeId: string, collapsed: boolean) => void;
346
353
  onNodeParentChange?: (nodeId: string, parentId: string) => void;
@@ -668,14 +675,14 @@ export declare interface FlowEngine {
668
675
  center(animate?: boolean): void;
669
676
  /** Fit one node; afterViewChange waits for opening geometry. Padding is in screen pixels (default 50). */
670
677
  focusNode(id: string, padding?: number, animate?: boolean, afterViewChange?: boolean): void;
671
- /** Fit laid-out hierarchy descendants and outgoing reachable nodes. Does not expand collapsed nodes. Animate overrides config.animateViewport. */
672
- focusBranch(id: string, padding?: number, animate?: boolean, afterViewChange?: boolean): void;
678
+ /** Fit hierarchy descendants and outgoing nodes; centerOnNode keeps the selected node at the viewport center. Does not expand collapsed nodes. */
679
+ focusBranch(id: string, padding?: number, animate?: boolean, afterViewChange?: boolean, centerOnNode?: boolean): void;
673
680
  focusConnections(id: string, padding?: number, animate?: boolean, afterViewChange?: boolean): void;
674
681
  isolateConnections(id: string, padding?: number, animate?: boolean): void;
675
682
  /** Temporarily show only this branch and fit it, preserving graph data. */
676
683
  isolateBranch(id: string, padding?: number, animate?: boolean): void;
677
- /** End isolation and restore the viewport saved when isolation began. */
678
- restoreView(animate?: boolean, state?: ViewportState): void;
684
+ /** End isolation and restore the saved viewport; afterViewChange coordinates a non-Grid preview close with layout. */
685
+ restoreView(animate?: boolean, state?: ViewportState, afterViewChange?: boolean): void;
679
686
  /** Hide/show edge paths, labels and hit targets without changing graph data. */
680
687
  setEdgesVisible(visible: boolean): void;
681
688
  clientToModel(clientX: number, clientY: number): Point;
@@ -973,6 +980,10 @@ export declare interface NodeGridArrangement {
973
980
  }>;
974
981
  }
975
982
 
983
+ export declare function NodeGridControls({ fillOnly, }?: {
984
+ fillOnly?: boolean;
985
+ }): JSX_2.Element;
986
+
976
987
  export declare interface NodeGridOptions extends NodeCollisionOptions {
977
988
  adjustment?: {
978
989
  enabled?: boolean;
@@ -1064,6 +1075,11 @@ declare interface NodeViewProps {
1064
1075
  children: (args: NodeViewChildArgs) => React.ReactNode;
1065
1076
  }
1066
1077
 
1078
+ export declare function PanelDragHandle({ label, disabled, }: {
1079
+ label: string;
1080
+ disabled?: boolean;
1081
+ }): JSX_2.Element;
1082
+
1067
1083
  /**
1068
1084
  * Style for compound (container) nodes. Set per node via `data.viewProps`,
1069
1085
  * or for all containers via `config.parentNodeStyle` (per-node wins).
@@ -1198,7 +1214,7 @@ export declare function setNodeProp(json: SqueedJson, address: string, key: Sque
1198
1214
 
1199
1215
  /** What changed in the Squeed document (delivered alongside the new JSON) */
1200
1216
  export declare interface SqueedChange {
1201
- type: "documentReplace" | "form" | "nodeLabel" | "nodeContent" | "nodeColor" | "nodeStyle" | "nodeIcon" | "nodeOutline" | "nodeAnimation" | "nodeCollapse" | "nodeCreate" | "nodeDelete" | "edgeLabel" | "edgeStyle" | "edgeColor" | "edgeCreate" | "edgeDelete";
1217
+ type: "nodeReplace" | "documentReplace" | "form" | "nodeLabel" | "nodeContent" | "nodeColor" | "nodeStyle" | "nodeIcon" | "nodeOutline" | "nodeAnimation" | "nodeCollapse" | "nodeCreate" | "nodeDelete" | "edgeLabel" | "edgeStyle" | "edgeColor" | "edgeCreate" | "edgeDelete";
1202
1218
  /** Node address affected (new node's address for nodeCreate) */
1203
1219
  address?: string;
1204
1220
  edge?: RenderedEdgeRef;
@@ -1209,7 +1225,7 @@ export declare interface SqueedChange {
1209
1225
 
1210
1226
  /** Describes the edit behind an `onJsonChange` */
1211
1227
  export declare interface SqueedChangeInfo {
1212
- type: "nodeLabel" | "nodeContent" | "nodeColor" | "nodeStyle" | "nodeIcon" | "nodeOutline" | "nodeAnimation" | "nodeCollapse" | "nodeCreate" | "nodeDelete" | "edgeLabel" | "edgeStyle" | "edgeColor" | "edgeCreate" | "edgeDelete";
1228
+ type: "nodeReplace" | "nodeLabel" | "nodeContent" | "nodeColor" | "nodeStyle" | "nodeIcon" | "nodeOutline" | "nodeAnimation" | "nodeCollapse" | "nodeCreate" | "nodeDelete" | "edgeLabel" | "edgeStyle" | "edgeColor" | "edgeCreate" | "edgeDelete";
1213
1229
  address?: string;
1214
1230
  edge?: FlowEdgeProperties & {
1215
1231
  source: string;
@@ -1248,7 +1264,7 @@ export declare type SqueedEdgeKey = "$edgeIcon" | "$edgeType" | "$sourceLabel" |
1248
1264
  export declare type SqueedJson = Record<string, any> | any[];
1249
1265
 
1250
1266
  /** Schema keys that live on a node */
1251
- 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";
1267
+ export declare type SqueedNodeKey = "$view" | "$label" | "$subtitle" | "$form" | "$bgColor" | "$textColor" | "$borderColor" | "$borderStyle" | "$borderWidth" | "$borderRadius" | "$width" | "$height" | "$fontSize" | "$icon" | "$content" | "$contentFormat" | "$media" | "$collapsed" | "$parent" | "$outline" | "$isNodeAnimated" | "$nodeAnimationVariant" | "$connections" | "$ports";
1252
1268
 
1253
1269
  export declare interface StateFormBinding {
1254
1270
  address: string;
@@ -1315,13 +1331,14 @@ export declare const TEXT_PALETTE: string[];
1315
1331
 
1316
1332
  export declare const ToolbarCloseButton: ForwardRefExoticComponent<Omit<Omit<IconButtonProps & RefAttributes<HTMLButtonElement>, "children">, "ref"> & RefAttributes<HTMLButtonElement>>;
1317
1333
 
1318
- export declare function ToolbarCommitInput({ value, placeholder, ariaLabel, width, type, min, onCommit, }: {
1334
+ export declare function ToolbarCommitInput({ value, placeholder, ariaLabel, width, type, min, disabled, onCommit, }: {
1319
1335
  value: string;
1320
1336
  placeholder: string;
1321
1337
  ariaLabel: string;
1322
1338
  width?: string;
1323
1339
  type?: "text" | "number";
1324
1340
  min?: number;
1341
+ disabled?: boolean;
1325
1342
  onCommit: (v: string) => void;
1326
1343
  }): JSX_2.Element;
1327
1344
 
@@ -1344,7 +1361,7 @@ export declare function ToolbarScrollContainer({ children, background, border, e
1344
1361
  framed?: boolean;
1345
1362
  }): JSX_2.Element;
1346
1363
 
1347
- export declare function ToolbarSelect({ children, value, onValueChange, disabled, style, title, icon, popupContent, footer, labelCase, "aria-label": label, ...triggerProps }: {
1364
+ export declare function ToolbarSelect({ children, value, onValueChange, disabled, style, title, icon, popupContent, footer, pinned, draggable, open: requestedOpen, onOpenChange, labelCase, "aria-label": label, ...triggerProps }: {
1348
1365
  children: ReactNode;
1349
1366
  value: string;
1350
1367
  onValueChange: (value: string) => void;
@@ -1354,6 +1371,10 @@ export declare function ToolbarSelect({ children, value, onValueChange, disabled
1354
1371
  icon?: ReactNode;
1355
1372
  popupContent?: ReactNode;
1356
1373
  footer?: ReactNode;
1374
+ pinned?: boolean;
1375
+ draggable?: boolean;
1376
+ open?: boolean;
1377
+ onOpenChange?: (open: boolean) => void;
1357
1378
  labelCase?: "title" | "preserve";
1358
1379
  "aria-label": string;
1359
1380
  } & Pick<React.ComponentProps<"button">, "id" | "aria-required" | "aria-invalid" | "aria-describedby">): JSX_2.Element;
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ import { IconButtonProps } from '@chakra-ui/react';
6
6
  import { InputHTMLAttributes } from 'react';
7
7
  import { JSX as JSX_2 } from 'react/jsx-runtime';
8
8
  import { MemoExoticComponent } from 'react';
9
+ import { MouseEventHandler } from 'react';
9
10
  import { MutableRefObject } from 'react';
10
11
  import { ReactNode } from 'react';
11
12
  import { ReactPortal } from 'react';
@@ -133,6 +134,11 @@ export declare interface ConnectionsOnlyToggleProps {
133
134
 
134
135
  export declare type ContentFormat = "markdown" | "html" | "jsx";
135
136
 
137
+ export declare const ContentFullscreenButton: ForwardRefExoticComponent< {
138
+ fullscreen: boolean;
139
+ onClick: MouseEventHandler<HTMLButtonElement>;
140
+ } & RefAttributes<HTMLButtonElement>>;
141
+
136
142
  export declare const contentObjTheme: (color: any) => {
137
143
  background: any;
138
144
  highlight: string;
@@ -341,6 +347,7 @@ export declare interface FlowDiagramCallbacks {
341
347
  onNodeLabelChange?: (nodeId: string, newLabel: string) => void;
342
348
  onNodeSubtitleChange?: (nodeId: string, subtitle: string) => void;
343
349
  onNodeContentChange?: (nodeId: string, content: NodeContent) => void;
350
+ onNodeDimensionChange?: (nodeId: string, dimension: "width" | "height", value: number | undefined) => void;
344
351
  /** Fires when a node's collapse toggle is clicked */
345
352
  onNodeCollapse?: (nodeId: string, collapsed: boolean) => void;
346
353
  onNodeParentChange?: (nodeId: string, parentId: string) => void;
@@ -668,14 +675,14 @@ export declare interface FlowEngine {
668
675
  center(animate?: boolean): void;
669
676
  /** Fit one node; afterViewChange waits for opening geometry. Padding is in screen pixels (default 50). */
670
677
  focusNode(id: string, padding?: number, animate?: boolean, afterViewChange?: boolean): void;
671
- /** Fit laid-out hierarchy descendants and outgoing reachable nodes. Does not expand collapsed nodes. Animate overrides config.animateViewport. */
672
- focusBranch(id: string, padding?: number, animate?: boolean, afterViewChange?: boolean): void;
678
+ /** Fit hierarchy descendants and outgoing nodes; centerOnNode keeps the selected node at the viewport center. Does not expand collapsed nodes. */
679
+ focusBranch(id: string, padding?: number, animate?: boolean, afterViewChange?: boolean, centerOnNode?: boolean): void;
673
680
  focusConnections(id: string, padding?: number, animate?: boolean, afterViewChange?: boolean): void;
674
681
  isolateConnections(id: string, padding?: number, animate?: boolean): void;
675
682
  /** Temporarily show only this branch and fit it, preserving graph data. */
676
683
  isolateBranch(id: string, padding?: number, animate?: boolean): void;
677
- /** End isolation and restore the viewport saved when isolation began. */
678
- restoreView(animate?: boolean, state?: ViewportState): void;
684
+ /** End isolation and restore the saved viewport; afterViewChange coordinates a non-Grid preview close with layout. */
685
+ restoreView(animate?: boolean, state?: ViewportState, afterViewChange?: boolean): void;
679
686
  /** Hide/show edge paths, labels and hit targets without changing graph data. */
680
687
  setEdgesVisible(visible: boolean): void;
681
688
  clientToModel(clientX: number, clientY: number): Point;
@@ -973,6 +980,10 @@ export declare interface NodeGridArrangement {
973
980
  }>;
974
981
  }
975
982
 
983
+ export declare function NodeGridControls({ fillOnly, }?: {
984
+ fillOnly?: boolean;
985
+ }): JSX_2.Element;
986
+
976
987
  export declare interface NodeGridOptions extends NodeCollisionOptions {
977
988
  adjustment?: {
978
989
  enabled?: boolean;
@@ -1064,6 +1075,11 @@ declare interface NodeViewProps {
1064
1075
  children: (args: NodeViewChildArgs) => React.ReactNode;
1065
1076
  }
1066
1077
 
1078
+ export declare function PanelDragHandle({ label, disabled, }: {
1079
+ label: string;
1080
+ disabled?: boolean;
1081
+ }): JSX_2.Element;
1082
+
1067
1083
  /**
1068
1084
  * Style for compound (container) nodes. Set per node via `data.viewProps`,
1069
1085
  * or for all containers via `config.parentNodeStyle` (per-node wins).
@@ -1198,7 +1214,7 @@ export declare function setNodeProp(json: SqueedJson, address: string, key: Sque
1198
1214
 
1199
1215
  /** What changed in the Squeed document (delivered alongside the new JSON) */
1200
1216
  export declare interface SqueedChange {
1201
- type: "documentReplace" | "form" | "nodeLabel" | "nodeContent" | "nodeColor" | "nodeStyle" | "nodeIcon" | "nodeOutline" | "nodeAnimation" | "nodeCollapse" | "nodeCreate" | "nodeDelete" | "edgeLabel" | "edgeStyle" | "edgeColor" | "edgeCreate" | "edgeDelete";
1217
+ type: "nodeReplace" | "documentReplace" | "form" | "nodeLabel" | "nodeContent" | "nodeColor" | "nodeStyle" | "nodeIcon" | "nodeOutline" | "nodeAnimation" | "nodeCollapse" | "nodeCreate" | "nodeDelete" | "edgeLabel" | "edgeStyle" | "edgeColor" | "edgeCreate" | "edgeDelete";
1202
1218
  /** Node address affected (new node's address for nodeCreate) */
1203
1219
  address?: string;
1204
1220
  edge?: RenderedEdgeRef;
@@ -1209,7 +1225,7 @@ export declare interface SqueedChange {
1209
1225
 
1210
1226
  /** Describes the edit behind an `onJsonChange` */
1211
1227
  export declare interface SqueedChangeInfo {
1212
- type: "nodeLabel" | "nodeContent" | "nodeColor" | "nodeStyle" | "nodeIcon" | "nodeOutline" | "nodeAnimation" | "nodeCollapse" | "nodeCreate" | "nodeDelete" | "edgeLabel" | "edgeStyle" | "edgeColor" | "edgeCreate" | "edgeDelete";
1228
+ type: "nodeReplace" | "nodeLabel" | "nodeContent" | "nodeColor" | "nodeStyle" | "nodeIcon" | "nodeOutline" | "nodeAnimation" | "nodeCollapse" | "nodeCreate" | "nodeDelete" | "edgeLabel" | "edgeStyle" | "edgeColor" | "edgeCreate" | "edgeDelete";
1213
1229
  address?: string;
1214
1230
  edge?: FlowEdgeProperties & {
1215
1231
  source: string;
@@ -1248,7 +1264,7 @@ export declare type SqueedEdgeKey = "$edgeIcon" | "$edgeType" | "$sourceLabel" |
1248
1264
  export declare type SqueedJson = Record<string, any> | any[];
1249
1265
 
1250
1266
  /** Schema keys that live on a node */
1251
- 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";
1267
+ export declare type SqueedNodeKey = "$view" | "$label" | "$subtitle" | "$form" | "$bgColor" | "$textColor" | "$borderColor" | "$borderStyle" | "$borderWidth" | "$borderRadius" | "$width" | "$height" | "$fontSize" | "$icon" | "$content" | "$contentFormat" | "$media" | "$collapsed" | "$parent" | "$outline" | "$isNodeAnimated" | "$nodeAnimationVariant" | "$connections" | "$ports";
1252
1268
 
1253
1269
  export declare interface StateFormBinding {
1254
1270
  address: string;
@@ -1315,13 +1331,14 @@ export declare const TEXT_PALETTE: string[];
1315
1331
 
1316
1332
  export declare const ToolbarCloseButton: ForwardRefExoticComponent<Omit<Omit<IconButtonProps & RefAttributes<HTMLButtonElement>, "children">, "ref"> & RefAttributes<HTMLButtonElement>>;
1317
1333
 
1318
- export declare function ToolbarCommitInput({ value, placeholder, ariaLabel, width, type, min, onCommit, }: {
1334
+ export declare function ToolbarCommitInput({ value, placeholder, ariaLabel, width, type, min, disabled, onCommit, }: {
1319
1335
  value: string;
1320
1336
  placeholder: string;
1321
1337
  ariaLabel: string;
1322
1338
  width?: string;
1323
1339
  type?: "text" | "number";
1324
1340
  min?: number;
1341
+ disabled?: boolean;
1325
1342
  onCommit: (v: string) => void;
1326
1343
  }): JSX_2.Element;
1327
1344
 
@@ -1344,7 +1361,7 @@ export declare function ToolbarScrollContainer({ children, background, border, e
1344
1361
  framed?: boolean;
1345
1362
  }): JSX_2.Element;
1346
1363
 
1347
- export declare function ToolbarSelect({ children, value, onValueChange, disabled, style, title, icon, popupContent, footer, labelCase, "aria-label": label, ...triggerProps }: {
1364
+ export declare function ToolbarSelect({ children, value, onValueChange, disabled, style, title, icon, popupContent, footer, pinned, draggable, open: requestedOpen, onOpenChange, labelCase, "aria-label": label, ...triggerProps }: {
1348
1365
  children: ReactNode;
1349
1366
  value: string;
1350
1367
  onValueChange: (value: string) => void;
@@ -1354,6 +1371,10 @@ export declare function ToolbarSelect({ children, value, onValueChange, disabled
1354
1371
  icon?: ReactNode;
1355
1372
  popupContent?: ReactNode;
1356
1373
  footer?: ReactNode;
1374
+ pinned?: boolean;
1375
+ draggable?: boolean;
1376
+ open?: boolean;
1377
+ onOpenChange?: (open: boolean) => void;
1357
1378
  labelCase?: "title" | "preserve";
1358
1379
  "aria-label": string;
1359
1380
  } & Pick<React.ComponentProps<"button">, "id" | "aria-required" | "aria-invalid" | "aria-describedby">): JSX_2.Element;