@xui/node-graph 2.0.0-alpha.19 → 2.0.0-alpha.21
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xui/node-graph",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.21",
|
|
4
4
|
"description": "Modern Angular 22 UI Library based on TailwindCSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@angular/cdk": "22",
|
|
40
40
|
"@angular/core": "22",
|
|
41
|
-
"@xui/core": "2.0.0-alpha.
|
|
41
|
+
"@xui/core": "2.0.0-alpha.21",
|
|
42
42
|
"class-variance-authority": "^0.7.1",
|
|
43
43
|
"clsx": "^2.1.1"
|
|
44
44
|
},
|
|
@@ -559,8 +559,11 @@ declare class XuiGraphControls {
|
|
|
559
559
|
protected readonly store: XuiNodeGraphStore;
|
|
560
560
|
protected readonly step: number;
|
|
561
561
|
protected readonly buttonClass: string;
|
|
562
|
+
/** Extra classes, merged into the component's own rather than replacing them. */
|
|
562
563
|
readonly class: _angular_core.InputSignal<ClassValue>;
|
|
564
|
+
/** Show the fit-to-view button. */
|
|
563
565
|
readonly showFit: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
566
|
+
/** Show the current zoom as a percentage between the zoom buttons. */
|
|
564
567
|
readonly showZoomLevel: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
565
568
|
/** Lay the buttons out in a column (default) or a row. */
|
|
566
569
|
readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
@@ -599,13 +602,22 @@ declare class XuiGraphGroup implements XuiGraphGroupHandle, OnInit {
|
|
|
599
602
|
private readonly dragOrigin;
|
|
600
603
|
/** Matches the `group` input on the nodes that belong to this frame. */
|
|
601
604
|
readonly groupId: _angular_core.InputSignal<string>;
|
|
605
|
+
/** Extra classes, merged into the component's own rather than replacing them. */
|
|
602
606
|
readonly class: _angular_core.InputSignal<ClassValue>;
|
|
607
|
+
/**
|
|
608
|
+
* The group's caption. An empty label drops the header entirely, and with it the vertical offset it adds to the
|
|
609
|
+
* group's contents.
|
|
610
|
+
*/
|
|
603
611
|
readonly label: _angular_core.InputSignal<string>;
|
|
604
612
|
/** Border and title colour; a tint of it fills the frame. Any CSS colour. */
|
|
605
613
|
readonly color: _angular_core.InputSignal<string>;
|
|
606
614
|
/** Blank margin between the members' bounding box and the frame. */
|
|
607
615
|
readonly padding: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
616
|
+
/** Let the group be selected by clicking it or by a marquee. */
|
|
608
617
|
readonly selectable: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
618
|
+
/**
|
|
619
|
+
* Let the group be dragged, taking the nodes inside it along. A locked group, or a locked graph, overrides this.
|
|
620
|
+
*/
|
|
609
621
|
readonly draggable: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
610
622
|
/** Pins the frame and everything in it. */
|
|
611
623
|
readonly locked: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
@@ -665,6 +677,7 @@ declare class XuiGraphMinimap {
|
|
|
665
677
|
private readonly store;
|
|
666
678
|
private readonly element;
|
|
667
679
|
private dragging;
|
|
680
|
+
/** Extra classes, merged into the component's own rather than replacing them. */
|
|
668
681
|
readonly class: _angular_core.InputSignal<ClassValue>;
|
|
669
682
|
/** Blank margin around the content, in graph units. */
|
|
670
683
|
readonly padding: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
@@ -734,6 +747,7 @@ declare class XuiGraphPort implements XuiGraphPortHandle, OnInit {
|
|
|
734
747
|
key: string;
|
|
735
748
|
/** Unique within the owning node — the node id supplies the rest of the identity. */
|
|
736
749
|
readonly portId: _angular_core.InputSignal<string>;
|
|
750
|
+
/** Extra classes, merged into the component's own rather than replacing them. */
|
|
737
751
|
readonly class: _angular_core.InputSignal<ClassValue>;
|
|
738
752
|
/**
|
|
739
753
|
* Which way data flows. `inout` covers terminals that are neither source nor
|
|
@@ -741,6 +755,7 @@ declare class XuiGraphPort implements XuiGraphPortHandle, OnInit {
|
|
|
741
755
|
* drawn first.
|
|
742
756
|
*/
|
|
743
757
|
readonly direction: _angular_core.InputSignal<XuiGraphPortDirection>;
|
|
758
|
+
/** The port's caption. Also its accessible name, falling back to the port id when empty. */
|
|
744
759
|
readonly label: _angular_core.InputSignal<string>;
|
|
745
760
|
/**
|
|
746
761
|
* The compatibility key. Two ports may only be wired together when their data
|
|
@@ -751,12 +766,14 @@ declare class XuiGraphPort implements XuiGraphPortHandle, OnInit {
|
|
|
751
766
|
readonly dataType: _angular_core.InputSignal<string | undefined>;
|
|
752
767
|
/** Overrides the colour inherited from {@link dataType}. */
|
|
753
768
|
readonly color: _angular_core.InputSignal<string | undefined>;
|
|
769
|
+
/** Block connections to and from this port. It stays visible and keeps its existing edges. */
|
|
754
770
|
readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
755
771
|
/**
|
|
756
772
|
* Which node edge the connector sits on. Leave unset to take it from
|
|
757
773
|
* {@link direction} — inputs on the left, outputs on the right.
|
|
758
774
|
*/
|
|
759
775
|
readonly side: _angular_core.InputSignal<XuiGraphPortSide | undefined>;
|
|
776
|
+
/** Override the port's glyph. Falls back to the shape declared for its type, then to the graph's default. */
|
|
760
777
|
readonly shape: _angular_core.InputSignal<XuiGraphPortShape | undefined>;
|
|
761
778
|
/**
|
|
762
779
|
* How many wires may terminate here. Defaults to 1 for an input — the usual
|
|
@@ -849,9 +866,11 @@ declare class XuiGraphNode implements XuiGraphNodeHandle, OnInit {
|
|
|
849
866
|
readonly element: HTMLElement;
|
|
850
867
|
/** Identifies the node to edges and to the selection. Must be stable and unique. */
|
|
851
868
|
readonly nodeId: _angular_core.InputSignal<string>;
|
|
869
|
+
/** Extra classes, merged into the component's own rather than replacing them. */
|
|
852
870
|
readonly class: _angular_core.InputSignal<ClassValue>;
|
|
853
871
|
/** Top-left corner in graph space. Two-way bound so the host owns the value. */
|
|
854
872
|
readonly position: _angular_core.ModelSignal<XuiGraphPoint>;
|
|
873
|
+
/** The node's caption, shown in its header. */
|
|
855
874
|
readonly label: _angular_core.InputSignal<string>;
|
|
856
875
|
/** Fixed width in graph units. Leave unset to size to content. */
|
|
857
876
|
readonly width: _angular_core.InputSignalWithTransform<number | undefined, NumberInput>;
|
|
@@ -873,8 +892,14 @@ declare class XuiGraphNode implements XuiGraphNodeHandle, OnInit {
|
|
|
873
892
|
* subtree can be folded away without breaking its wiring.
|
|
874
893
|
*/
|
|
875
894
|
readonly collapsed: _angular_core.ModelSignal<boolean>;
|
|
895
|
+
/** Add a header toggle that folds the node's body away, leaving its ports and edges intact. */
|
|
876
896
|
readonly collapsible: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
897
|
+
/**
|
|
898
|
+
* Let the node be selected. Also what gives it `role="option"` and `aria-selected`; an unselectable node has
|
|
899
|
+
* neither.
|
|
900
|
+
*/
|
|
877
901
|
readonly selectable: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
902
|
+
/** Let the node be dragged. A locked node, or a locked graph, overrides this. */
|
|
878
903
|
readonly draggable: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
879
904
|
/** Pins the node in place while leaving it selectable. */
|
|
880
905
|
readonly locked: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
@@ -920,6 +945,7 @@ declare class XuiGraphNode implements XuiGraphNodeHandle, OnInit {
|
|
|
920
945
|
* ```
|
|
921
946
|
*/
|
|
922
947
|
declare class XuiGraphNodeHeader {
|
|
948
|
+
/** Extra classes, merged into the component's own rather than replacing them. */
|
|
923
949
|
readonly class: _angular_core.InputSignal<ClassValue>;
|
|
924
950
|
protected readonly computedClass: _angular_core.Signal<string>;
|
|
925
951
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<XuiGraphNodeHeader, never>;
|
|
@@ -927,6 +953,7 @@ declare class XuiGraphNodeHeader {
|
|
|
927
953
|
}
|
|
928
954
|
/** Trailing controls in a node header — a menu button, a toggle, a status dot. */
|
|
929
955
|
declare class XuiGraphNodeActions {
|
|
956
|
+
/** Extra classes, merged into the component's own rather than replacing them. */
|
|
930
957
|
readonly class: _angular_core.InputSignal<ClassValue>;
|
|
931
958
|
protected readonly computedClass: _angular_core.Signal<string>;
|
|
932
959
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<XuiGraphNodeActions, never>;
|
|
@@ -937,6 +964,7 @@ declare class XuiGraphNodeActions {
|
|
|
937
964
|
* render, a waveform. Sits above the port rows, as it does in a VFX graph.
|
|
938
965
|
*/
|
|
939
966
|
declare class XuiGraphNodePreview {
|
|
967
|
+
/** Extra classes, merged into the component's own rather than replacing them. */
|
|
940
968
|
readonly class: _angular_core.InputSignal<ClassValue>;
|
|
941
969
|
protected readonly computedClass: _angular_core.Signal<string>;
|
|
942
970
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<XuiGraphNodePreview, never>;
|
|
@@ -967,6 +995,7 @@ declare class XuiGraphNodePreview {
|
|
|
967
995
|
* ```
|
|
968
996
|
*/
|
|
969
997
|
declare class XuiGraphOverlay {
|
|
998
|
+
/** Extra classes, merged into the component's own rather than replacing them. */
|
|
970
999
|
readonly class: _angular_core.InputSignal<ClassValue>;
|
|
971
1000
|
protected readonly computedClass: _angular_core.Signal<string>;
|
|
972
1001
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<XuiGraphOverlay, never>;
|
|
@@ -1032,25 +1061,48 @@ declare class XuiNodeGraph {
|
|
|
1032
1061
|
private readonly marqueeState;
|
|
1033
1062
|
/** The store for this canvas. Use it to drive the view from a host component. */
|
|
1034
1063
|
readonly store: XuiNodeGraphStore;
|
|
1064
|
+
/** Extra classes, merged into the component's own rather than replacing them. */
|
|
1035
1065
|
readonly class: _angular_core.InputSignal<ClassValue>;
|
|
1036
1066
|
/** The wires to draw. Never mutated — see `connect`. */
|
|
1037
1067
|
readonly edges: _angular_core.InputSignal<readonly XuiGraphEdge[]>;
|
|
1038
1068
|
/** Pan and zoom. Two-way bindable, so a host can save and restore the view. */
|
|
1039
1069
|
readonly viewport: _angular_core.ModelSignal<XuiGraphViewport>;
|
|
1070
|
+
/**
|
|
1071
|
+
* How edges are drawn between ports: curved (`bezier`), right-angled (`orthogonal`), rounded right angles
|
|
1072
|
+
* (`smoothstep`), or direct (`straight`).
|
|
1073
|
+
*/
|
|
1040
1074
|
readonly routing: _angular_core.InputSignal<XuiGraphRouting>;
|
|
1075
|
+
/** The canvas pattern behind the graph, which scales with the zoom. */
|
|
1041
1076
|
readonly background: _angular_core.InputSignal<XuiGraphBackground>;
|
|
1077
|
+
/** Default end marker on an edge. An edge may override it. */
|
|
1042
1078
|
readonly marker: _angular_core.InputSignal<XuiGraphMarker>;
|
|
1079
|
+
/** Spacing of the background pattern, and the step nodes snap to when `snapToGrid` is on. */
|
|
1043
1080
|
readonly gridSize: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
1081
|
+
/**
|
|
1082
|
+
* Round node positions to `gridSize` as they are dragged. Holding Shift while nudging with the arrow keys does the
|
|
1083
|
+
* same.
|
|
1084
|
+
*/
|
|
1044
1085
|
readonly snapToGrid: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
1086
|
+
/** How far the canvas can zoom out, as a scale factor. */
|
|
1045
1087
|
readonly minZoom: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
1088
|
+
/** How far the canvas can zoom in, as a scale factor. */
|
|
1046
1089
|
readonly maxZoom: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
1090
|
+
/** Default stroke width for edges, in graph units. An edge may override it. */
|
|
1047
1091
|
readonly edgeWidth: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
1092
|
+
/** Default port glyph size, in graph units. */
|
|
1048
1093
|
readonly portSize: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
1094
|
+
/** Default port glyph. A port type, or the port itself, may override it. */
|
|
1049
1095
|
readonly portShape: _angular_core.InputSignal<XuiGraphPortShape>;
|
|
1096
|
+
/** Default port colour. A port type, or the port itself, may override it. */
|
|
1050
1097
|
readonly portColor: _angular_core.InputSignal<string>;
|
|
1051
1098
|
/** Data-type registry: colour, glyph and label per `dataType`. */
|
|
1052
1099
|
readonly portTypes: _angular_core.InputSignal<Record<string, XuiGraphPortType>>;
|
|
1100
|
+
/** Let an edge run from a node back to itself. */
|
|
1053
1101
|
readonly allowSelfConnection: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
1102
|
+
/**
|
|
1103
|
+
* Refuse a connection between ports whose declared types do not match. Off by default, which leaves validation to
|
|
1104
|
+
* the host.
|
|
1105
|
+
*/
|
|
1054
1106
|
readonly enforcePortTypes: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
1055
1107
|
/** Last say on whether a connection may be made. Runs after the built-in rules. */
|
|
1056
1108
|
readonly isValidConnection: _angular_core.InputSignal<XuiGraphConnectionValidator | undefined>;
|
|
@@ -1063,14 +1115,20 @@ declare class XuiNodeGraph {
|
|
|
1063
1115
|
* bare wheel for panning and zooms only with the modifier, as design tools do.
|
|
1064
1116
|
*/
|
|
1065
1117
|
readonly zoomActivation: _angular_core.InputSignal<"wheel" | "ctrl-wheel">;
|
|
1118
|
+
/**
|
|
1119
|
+
* Zoom on wheel. Turn it off inside a scrolling page, where the wheel should scroll past the graph rather than into
|
|
1120
|
+
* it.
|
|
1121
|
+
*/
|
|
1066
1122
|
readonly zoomOnScroll: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
1067
1123
|
/** A connection that passed every rule. The host decides whether to add it. */
|
|
1068
1124
|
readonly connect: _angular_core.OutputEmitterRef<XuiGraphConnection>;
|
|
1069
1125
|
/** A wire dropped on empty canvas — the hook for "drag out to create a node". */
|
|
1070
1126
|
readonly connectionDrop: _angular_core.OutputEmitterRef<XuiGraphConnectionDrop>;
|
|
1127
|
+
/** Emits the edge that was clicked. */
|
|
1071
1128
|
readonly edgeClick: _angular_core.OutputEmitterRef<XuiGraphEdge>;
|
|
1072
1129
|
/** Fired once per drag, when the pointer is released. */
|
|
1073
1130
|
readonly nodeMove: _angular_core.OutputEmitterRef<XuiGraphNodeMove>;
|
|
1131
|
+
/** Emits the selected node and edge ids whenever the selection changes. */
|
|
1074
1132
|
readonly selectionChange: _angular_core.OutputEmitterRef<{
|
|
1075
1133
|
nodes: string[];
|
|
1076
1134
|
edges: string[];
|
|
@@ -1080,6 +1138,9 @@ declare class XuiNodeGraph {
|
|
|
1080
1138
|
nodes: string[];
|
|
1081
1139
|
edges: string[];
|
|
1082
1140
|
}>;
|
|
1141
|
+
/**
|
|
1142
|
+
* Emits a right-click on empty canvas, with the position in graph coordinates — the hook for a "new node here" menu.
|
|
1143
|
+
*/
|
|
1083
1144
|
readonly canvasContextMenu: _angular_core.OutputEmitterRef<{
|
|
1084
1145
|
event: MouseEvent;
|
|
1085
1146
|
position: XuiGraphPoint;
|