@squeed/flow-sdk 2.0.10 → 2.0.11
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/README.md +71 -1
- package/dist/index.cjs +67 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -5
- package/dist/index.d.ts +22 -5
- package/dist/index.js +7914 -7634
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -280,6 +280,7 @@ export declare interface FlowDiagramCallbacks {
|
|
|
280
280
|
onNodeCreateRequest?: (request: FlowNodeCreationRequest) => boolean;
|
|
281
281
|
onFormSchemaChange?: (schema: FormSchema | undefined) => void;
|
|
282
282
|
onFormChange?: (event: FormChange) => FormEdit[] | void;
|
|
283
|
+
uploadFormFile?: (request: FormUploadRequest) => Promise<string> | string;
|
|
283
284
|
resolveFormOptions?: (request: FormOptionsRequest) => Promise<FormOption[]> | FormOption[];
|
|
284
285
|
onSpacingChange?: (spacing: NodeSpacing) => void;
|
|
285
286
|
onEdgeRadiusChange?: (radius: number) => void;
|
|
@@ -697,6 +698,7 @@ bindings?: StateForms["bindings"];
|
|
|
697
698
|
editable?: boolean;
|
|
698
699
|
schema?: FormSchema;
|
|
699
700
|
renderForm?: StateForms["renderForm"];
|
|
701
|
+
onFieldCreate?: (change: FormChange, config: FormFieldConfig) => void;
|
|
700
702
|
structured?: StructuredForms;
|
|
701
703
|
references?: StateForms["references"];
|
|
702
704
|
callbacks: FlowDiagramCallbacks;
|
|
@@ -714,7 +716,11 @@ export declare type FormEdit = {
|
|
|
714
716
|
export declare interface FormFieldConfig {
|
|
715
717
|
$label?: string;
|
|
716
718
|
$section?: string;
|
|
717
|
-
$control?: "input" | "textarea" | "select" | "pills" | "checkbox";
|
|
719
|
+
$control?: "input" | "textarea" | "select" | "pills" | "checkbox" | "upload";
|
|
720
|
+
$upload?: {
|
|
721
|
+
accept?: string;
|
|
722
|
+
maxSizeBytes?: number;
|
|
723
|
+
};
|
|
718
724
|
$visibleWhen?: FormCondition;
|
|
719
725
|
$requiredWhen?: FormCondition;
|
|
720
726
|
$options?: {
|
|
@@ -743,6 +749,11 @@ export declare type FormSchema = Record<string, Extract<ContractType, {
|
|
|
743
749
|
kind: "object";
|
|
744
750
|
}>>;
|
|
745
751
|
|
|
752
|
+
export declare interface FormUploadRequest extends FormRequest {
|
|
753
|
+
file: File;
|
|
754
|
+
signal: AbortSignal;
|
|
755
|
+
}
|
|
756
|
+
|
|
746
757
|
export declare type FormValue = string | number | boolean | null;
|
|
747
758
|
|
|
748
759
|
export declare function formValueError(type: ContractType, value: unknown, required: boolean): string | undefined;
|
|
@@ -800,6 +811,8 @@ export declare interface JsonStreamOptions<Document> {
|
|
|
800
811
|
|
|
801
812
|
export declare type LayoutAlgorithm = "dagre" | "elk" | "tidytree" | "concentric" | "cose";
|
|
802
813
|
|
|
814
|
+
export declare const LIGHT_BLACK = "#8c8c8d";
|
|
815
|
+
|
|
803
816
|
export declare const NODE_TYPE_VIEWS: readonly ["", "icon-label", "object", "text"];
|
|
804
817
|
|
|
805
818
|
export declare type NodeAlignment = "leading" | "center" | "trailing";
|
|
@@ -831,10 +844,12 @@ export declare function NodeFormPopover({ nodeAddress, active, label, open, onCl
|
|
|
831
844
|
height?: number;
|
|
832
845
|
}): JSX_2.Element;
|
|
833
846
|
|
|
834
|
-
export declare function NodeIconPicker({ nodeId, edgeId, value, }: {
|
|
847
|
+
export declare function NodeIconPicker({ nodeId, edgeId, value, open: requestedOpen, onOpenChange, }: {
|
|
835
848
|
nodeId?: string;
|
|
836
849
|
edgeId?: string;
|
|
837
850
|
value?: string;
|
|
851
|
+
open?: boolean;
|
|
852
|
+
onOpenChange?: (open: boolean) => void;
|
|
838
853
|
}): JSX_2.Element;
|
|
839
854
|
|
|
840
855
|
/** Actions shown in the hover overlay above nodes */
|
|
@@ -871,7 +886,7 @@ export declare function NodeTools({ ids, onClose, }: {
|
|
|
871
886
|
|
|
872
887
|
export declare type NodeTypeView = Exclude<(typeof NODE_TYPE_VIEWS)[number], "">;
|
|
873
888
|
|
|
874
|
-
export declare const NodeView: MemoExoticComponent<({ data: nodeData, children, isInverted, isParent, }: NodeViewProps) => JSX_2.Element>;
|
|
889
|
+
export declare const NodeView: MemoExoticComponent<({ data: nodeData, children, isInverted, isParent, onOpenView, editOnMount, }: NodeViewProps) => JSX_2.Element>;
|
|
875
890
|
|
|
876
891
|
declare interface NodeViewChildArgs {
|
|
877
892
|
id: string;
|
|
@@ -889,6 +904,8 @@ declare interface NodeViewProps {
|
|
|
889
904
|
data: any;
|
|
890
905
|
isInverted?: boolean;
|
|
891
906
|
isParent?: boolean;
|
|
907
|
+
onOpenView?: () => void;
|
|
908
|
+
editOnMount?: boolean;
|
|
892
909
|
children: (args: NodeViewChildArgs) => React.ReactNode;
|
|
893
910
|
}
|
|
894
911
|
|
|
@@ -1153,7 +1170,7 @@ export declare function ToolbarScrollContainer({ children, background, border, }
|
|
|
1153
1170
|
border: string;
|
|
1154
1171
|
}): JSX_2.Element;
|
|
1155
1172
|
|
|
1156
|
-
export declare function ToolbarSelect({ children, value, onValueChange, disabled, style, title, icon, popupContent, labelCase, "aria-label": label, }: {
|
|
1173
|
+
export declare function ToolbarSelect({ children, value, onValueChange, disabled, style, title, icon, popupContent, labelCase, "aria-label": label, ...triggerProps }: {
|
|
1157
1174
|
children: ReactNode;
|
|
1158
1175
|
value: string;
|
|
1159
1176
|
onValueChange: (value: string) => void;
|
|
@@ -1164,7 +1181,7 @@ export declare function ToolbarSelect({ children, value, onValueChange, disabled
|
|
|
1164
1181
|
popupContent?: ReactNode;
|
|
1165
1182
|
labelCase?: "title" | "preserve";
|
|
1166
1183
|
"aria-label": string;
|
|
1167
|
-
}): JSX_2.Element;
|
|
1184
|
+
} & Pick<React.ComponentProps<"button">, "id" | "aria-required" | "aria-invalid" | "aria-describedby">): JSX_2.Element;
|
|
1168
1185
|
|
|
1169
1186
|
export declare function ToolbarTooltip({ label, children, }: {
|
|
1170
1187
|
label: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -280,6 +280,7 @@ export declare interface FlowDiagramCallbacks {
|
|
|
280
280
|
onNodeCreateRequest?: (request: FlowNodeCreationRequest) => boolean;
|
|
281
281
|
onFormSchemaChange?: (schema: FormSchema | undefined) => void;
|
|
282
282
|
onFormChange?: (event: FormChange) => FormEdit[] | void;
|
|
283
|
+
uploadFormFile?: (request: FormUploadRequest) => Promise<string> | string;
|
|
283
284
|
resolveFormOptions?: (request: FormOptionsRequest) => Promise<FormOption[]> | FormOption[];
|
|
284
285
|
onSpacingChange?: (spacing: NodeSpacing) => void;
|
|
285
286
|
onEdgeRadiusChange?: (radius: number) => void;
|
|
@@ -697,6 +698,7 @@ bindings?: StateForms["bindings"];
|
|
|
697
698
|
editable?: boolean;
|
|
698
699
|
schema?: FormSchema;
|
|
699
700
|
renderForm?: StateForms["renderForm"];
|
|
701
|
+
onFieldCreate?: (change: FormChange, config: FormFieldConfig) => void;
|
|
700
702
|
structured?: StructuredForms;
|
|
701
703
|
references?: StateForms["references"];
|
|
702
704
|
callbacks: FlowDiagramCallbacks;
|
|
@@ -714,7 +716,11 @@ export declare type FormEdit = {
|
|
|
714
716
|
export declare interface FormFieldConfig {
|
|
715
717
|
$label?: string;
|
|
716
718
|
$section?: string;
|
|
717
|
-
$control?: "input" | "textarea" | "select" | "pills" | "checkbox";
|
|
719
|
+
$control?: "input" | "textarea" | "select" | "pills" | "checkbox" | "upload";
|
|
720
|
+
$upload?: {
|
|
721
|
+
accept?: string;
|
|
722
|
+
maxSizeBytes?: number;
|
|
723
|
+
};
|
|
718
724
|
$visibleWhen?: FormCondition;
|
|
719
725
|
$requiredWhen?: FormCondition;
|
|
720
726
|
$options?: {
|
|
@@ -743,6 +749,11 @@ export declare type FormSchema = Record<string, Extract<ContractType, {
|
|
|
743
749
|
kind: "object";
|
|
744
750
|
}>>;
|
|
745
751
|
|
|
752
|
+
export declare interface FormUploadRequest extends FormRequest {
|
|
753
|
+
file: File;
|
|
754
|
+
signal: AbortSignal;
|
|
755
|
+
}
|
|
756
|
+
|
|
746
757
|
export declare type FormValue = string | number | boolean | null;
|
|
747
758
|
|
|
748
759
|
export declare function formValueError(type: ContractType, value: unknown, required: boolean): string | undefined;
|
|
@@ -800,6 +811,8 @@ export declare interface JsonStreamOptions<Document> {
|
|
|
800
811
|
|
|
801
812
|
export declare type LayoutAlgorithm = "dagre" | "elk" | "tidytree" | "concentric" | "cose";
|
|
802
813
|
|
|
814
|
+
export declare const LIGHT_BLACK = "#8c8c8d";
|
|
815
|
+
|
|
803
816
|
export declare const NODE_TYPE_VIEWS: readonly ["", "icon-label", "object", "text"];
|
|
804
817
|
|
|
805
818
|
export declare type NodeAlignment = "leading" | "center" | "trailing";
|
|
@@ -831,10 +844,12 @@ export declare function NodeFormPopover({ nodeAddress, active, label, open, onCl
|
|
|
831
844
|
height?: number;
|
|
832
845
|
}): JSX_2.Element;
|
|
833
846
|
|
|
834
|
-
export declare function NodeIconPicker({ nodeId, edgeId, value, }: {
|
|
847
|
+
export declare function NodeIconPicker({ nodeId, edgeId, value, open: requestedOpen, onOpenChange, }: {
|
|
835
848
|
nodeId?: string;
|
|
836
849
|
edgeId?: string;
|
|
837
850
|
value?: string;
|
|
851
|
+
open?: boolean;
|
|
852
|
+
onOpenChange?: (open: boolean) => void;
|
|
838
853
|
}): JSX_2.Element;
|
|
839
854
|
|
|
840
855
|
/** Actions shown in the hover overlay above nodes */
|
|
@@ -871,7 +886,7 @@ export declare function NodeTools({ ids, onClose, }: {
|
|
|
871
886
|
|
|
872
887
|
export declare type NodeTypeView = Exclude<(typeof NODE_TYPE_VIEWS)[number], "">;
|
|
873
888
|
|
|
874
|
-
export declare const NodeView: MemoExoticComponent<({ data: nodeData, children, isInverted, isParent, }: NodeViewProps) => JSX_2.Element>;
|
|
889
|
+
export declare const NodeView: MemoExoticComponent<({ data: nodeData, children, isInverted, isParent, onOpenView, editOnMount, }: NodeViewProps) => JSX_2.Element>;
|
|
875
890
|
|
|
876
891
|
declare interface NodeViewChildArgs {
|
|
877
892
|
id: string;
|
|
@@ -889,6 +904,8 @@ declare interface NodeViewProps {
|
|
|
889
904
|
data: any;
|
|
890
905
|
isInverted?: boolean;
|
|
891
906
|
isParent?: boolean;
|
|
907
|
+
onOpenView?: () => void;
|
|
908
|
+
editOnMount?: boolean;
|
|
892
909
|
children: (args: NodeViewChildArgs) => React.ReactNode;
|
|
893
910
|
}
|
|
894
911
|
|
|
@@ -1153,7 +1170,7 @@ export declare function ToolbarScrollContainer({ children, background, border, }
|
|
|
1153
1170
|
border: string;
|
|
1154
1171
|
}): JSX_2.Element;
|
|
1155
1172
|
|
|
1156
|
-
export declare function ToolbarSelect({ children, value, onValueChange, disabled, style, title, icon, popupContent, labelCase, "aria-label": label, }: {
|
|
1173
|
+
export declare function ToolbarSelect({ children, value, onValueChange, disabled, style, title, icon, popupContent, labelCase, "aria-label": label, ...triggerProps }: {
|
|
1157
1174
|
children: ReactNode;
|
|
1158
1175
|
value: string;
|
|
1159
1176
|
onValueChange: (value: string) => void;
|
|
@@ -1164,7 +1181,7 @@ export declare function ToolbarSelect({ children, value, onValueChange, disabled
|
|
|
1164
1181
|
popupContent?: ReactNode;
|
|
1165
1182
|
labelCase?: "title" | "preserve";
|
|
1166
1183
|
"aria-label": string;
|
|
1167
|
-
}): JSX_2.Element;
|
|
1184
|
+
} & Pick<React.ComponentProps<"button">, "id" | "aria-required" | "aria-invalid" | "aria-describedby">): JSX_2.Element;
|
|
1168
1185
|
|
|
1169
1186
|
export declare function ToolbarTooltip({ label, children, }: {
|
|
1170
1187
|
label: string;
|