@fragiola/flow-angular 0.0.0-stage → 0.1.0
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/CHANGELOG.md +17 -0
- package/LICENSE +21 -0
- package/README.md +20 -2
- package/dist/fesm2022/fragiola-flow-angular-connection.mjs +1 -0
- package/dist/fesm2022/fragiola-flow-angular-drag.mjs +1 -0
- package/dist/fesm2022/fragiola-flow-angular-keyboard.mjs +1 -0
- package/dist/fesm2022/fragiola-flow-angular-minimap.mjs +408 -0
- package/dist/fesm2022/fragiola-flow-angular-minimap.mjs.map +1 -0
- package/dist/fesm2022/fragiola-flow-angular-reconnection.mjs +1 -0
- package/dist/fesm2022/fragiola-flow-angular-resize.mjs +437 -0
- package/dist/fesm2022/fragiola-flow-angular-resize.mjs.map +1 -0
- package/dist/fesm2022/fragiola-flow-angular-selection.mjs +1 -0
- package/dist/fesm2022/fragiola-flow-angular-subflows.mjs +1 -0
- package/dist/fesm2022/fragiola-flow-angular.mjs +4688 -0
- package/dist/fesm2022/fragiola-flow-angular.mjs.map +1 -0
- package/dist/types/fragiola-flow-angular-connection.d.ts +1 -0
- package/dist/types/fragiola-flow-angular-drag.d.ts +1 -0
- package/dist/types/fragiola-flow-angular-keyboard.d.ts +1 -0
- package/dist/types/fragiola-flow-angular-minimap.d.ts +118 -0
- package/dist/types/fragiola-flow-angular-reconnection.d.ts +1 -0
- package/dist/types/fragiola-flow-angular-resize.d.ts +145 -0
- package/dist/types/fragiola-flow-angular-selection.d.ts +1 -0
- package/dist/types/fragiola-flow-angular-subflows.d.ts +1 -0
- package/dist/types/fragiola-flow-angular.d.ts +1839 -0
- package/package.json +109 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@fragiola/flow/connection";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@fragiola/flow/drag";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@fragiola/flow/keyboard";
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Signal } from "@angular/core";
|
|
3
|
+
import { MinimapView } from "@fragiola/flow";
|
|
4
|
+
export * from "@fragiola/flow/minimap";
|
|
5
|
+
interface MiniMapState {
|
|
6
|
+
/** what it draws: the nodes, the view and the mask, in flow coordinates */
|
|
7
|
+
readonly view: MinimapView;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A small map of the flow (`data-flow-part="minimap"`, `minimap()`), on the app's
|
|
11
|
+
* `<svg flowMiniMap>` inside `[flowRoot]`, outside `[flowViewport]`: `width` × `height` pixels
|
|
12
|
+
* showing every node and what the root shows. With `minimap()`'s options, a drag on it pans and
|
|
13
|
+
* its wheel zooms the flow. It draws what the app writes inside it in flow coordinates
|
|
14
|
+
* (`[flowMiniMapNode]`s over `#map="flowMiniMap"`'s `map.state().view.nodes`, a
|
|
15
|
+
* `[flowMiniMapMask]`), or, when the app writes no element, a node per node and the mask. Place
|
|
16
|
+
* it with your style.
|
|
17
|
+
*/
|
|
18
|
+
export declare class FlowMiniMapDirective {
|
|
19
|
+
/** its width, in pixels; default 200 */
|
|
20
|
+
readonly width: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
21
|
+
/** its height, in pixels; default 150 */
|
|
22
|
+
readonly height: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* a drag on it moves the view the other way (as grabbing the flow), and a press does not
|
|
25
|
+
* centre the view; default `minimap()`'s `inversePan`
|
|
26
|
+
*/
|
|
27
|
+
readonly inversePan: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
|
|
28
|
+
/** how fast its wheel zooms: 10 is the flow's own wheel, 20 twice as fast; default `minimap()`'s `zoomStep` */
|
|
29
|
+
readonly zoomStep: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
|
|
30
|
+
/**
|
|
31
|
+
* a tap on it (the engine's `minimap-click`: `point`, the flow point under the pointer on the
|
|
32
|
+
* minimap, `client` and the DOM `event`): center the view there, add a node there. The root
|
|
33
|
+
* captures the pointer, so a DOM `(click)` never follows a press on it
|
|
34
|
+
*/
|
|
35
|
+
readonly minimapClick: import("@angular/core").OutputEmitterRef<{
|
|
36
|
+
readonly type: "minimap-click";
|
|
37
|
+
readonly element: Element;
|
|
38
|
+
} & import("@fragiola/flow").FlowPointerInfo>;
|
|
39
|
+
private readonly context;
|
|
40
|
+
/** what it draws (`#map="flowMiniMap"`, then `map.state().view.nodes`) */
|
|
41
|
+
readonly state: Signal<MiniMapState>;
|
|
42
|
+
constructor();
|
|
43
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FlowMiniMapDirective, never>;
|
|
44
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FlowMiniMapDirective, "[flowMiniMap]", ["flowMiniMap"], {
|
|
45
|
+
"width": {
|
|
46
|
+
"alias": "width";
|
|
47
|
+
"required": false;
|
|
48
|
+
"isSignal": true;
|
|
49
|
+
};
|
|
50
|
+
"height": {
|
|
51
|
+
"alias": "height";
|
|
52
|
+
"required": false;
|
|
53
|
+
"isSignal": true;
|
|
54
|
+
};
|
|
55
|
+
"inversePan": {
|
|
56
|
+
"alias": "inversePan";
|
|
57
|
+
"required": false;
|
|
58
|
+
"isSignal": true;
|
|
59
|
+
};
|
|
60
|
+
"zoomStep": {
|
|
61
|
+
"alias": "zoomStep";
|
|
62
|
+
"required": false;
|
|
63
|
+
"isSignal": true;
|
|
64
|
+
};
|
|
65
|
+
}, {
|
|
66
|
+
"minimapClick": "minimapClick";
|
|
67
|
+
}, never, never, true, never>;
|
|
68
|
+
}
|
|
69
|
+
/** The state of `[flowMiniMapMask]`: the root's view, in flow coordinates. */
|
|
70
|
+
interface MiniMapMaskState {
|
|
71
|
+
readonly view: {
|
|
72
|
+
x: number;
|
|
73
|
+
y: number;
|
|
74
|
+
width: number;
|
|
75
|
+
height: number;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The minimap's mask (`data-flow-part="minimap-mask"`), on the app's SVG path inside
|
|
80
|
+
* `[flowMiniMap]`: `<svg:path flowMiniMapMask />`, covering the map but what the root shows
|
|
81
|
+
* (`fill-rule="evenodd"`). Give it its fill.
|
|
82
|
+
*/
|
|
83
|
+
export declare class FlowMiniMapMaskDirective {
|
|
84
|
+
private readonly view;
|
|
85
|
+
/** the mask's state */
|
|
86
|
+
readonly state: Signal<MiniMapMaskState>;
|
|
87
|
+
constructor();
|
|
88
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FlowMiniMapMaskDirective, never>;
|
|
89
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FlowMiniMapMaskDirective, "[flowMiniMapMask]", ["flowMiniMapMask"], {}, {}, never, never, true, never>;
|
|
90
|
+
}
|
|
91
|
+
interface MiniMapNodeState {
|
|
92
|
+
readonly nodeId: string;
|
|
93
|
+
/** `data-selected` (`selection()`) */
|
|
94
|
+
readonly selected: boolean;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* A node in the minimap (`data-flow-part="minimap-node"`, `data-flow-id`), on the app's SVG rect
|
|
98
|
+
* inside `[flowMiniMap]`: `<svg:rect flowMiniMapNode [nodeId]="id" />`, the node's box in flow
|
|
99
|
+
* coordinates. Out of the document while the node is not shown.
|
|
100
|
+
*/
|
|
101
|
+
export declare class FlowMiniMapNodeDirective {
|
|
102
|
+
/** the node it stands for */
|
|
103
|
+
readonly nodeId: import("@angular/core").InputSignal<string>;
|
|
104
|
+
/** the node's state in the map */
|
|
105
|
+
readonly state: Signal<MiniMapNodeState | undefined>;
|
|
106
|
+
constructor();
|
|
107
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FlowMiniMapNodeDirective, never>;
|
|
108
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FlowMiniMapNodeDirective, "[flowMiniMapNode]", ["flowMiniMapNode"], {
|
|
109
|
+
"nodeId": {
|
|
110
|
+
"alias": "nodeId";
|
|
111
|
+
"required": true;
|
|
112
|
+
"isSignal": true;
|
|
113
|
+
};
|
|
114
|
+
}, {}, never, never, true, never>;
|
|
115
|
+
}
|
|
116
|
+
/** The minimap's directives, for a standalone component's `imports`. */
|
|
117
|
+
export declare const FLOW_MINIMAP: readonly [typeof FlowMiniMapDirective, typeof FlowMiniMapNodeDirective, typeof FlowMiniMapMaskDirective];
|
|
118
|
+
export type { MiniMapMaskState, MiniMapNodeState, MiniMapState };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@fragiola/flow/reconnection";
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Signal } from "@angular/core";
|
|
3
|
+
import { ResizeDirection } from "@fragiola/flow/resize";
|
|
4
|
+
import { ResizeHandleDirection, ResizeHandleVariant } from "@fragiola/flow";
|
|
5
|
+
export * from "@fragiola/flow/resize";
|
|
6
|
+
interface NodeResizerState {
|
|
7
|
+
readonly nodeId: string;
|
|
8
|
+
/** its node is being resized: `data-resizing` */
|
|
9
|
+
readonly resizing: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A node's resizer (`data-flow-part="resizer"`, `resize()`), on the app's element inside
|
|
13
|
+
* `[flowNode]`: `<div flowNodeResizer [minWidth]="40">`, a box over the node holding its
|
|
14
|
+
* `[flowResizeHandle]`s (when the app writes none, one at each corner and side); its limits are
|
|
15
|
+
* this node's own (`setPartOptions`). Render it only when the node should be resizable (while it
|
|
16
|
+
* is selected, say).
|
|
17
|
+
*/
|
|
18
|
+
export declare class FlowNodeResizerDirective {
|
|
19
|
+
/** its node; default the enclosing `[flowNode]`'s */
|
|
20
|
+
readonly nodeId: import("@angular/core").InputSignal<string | undefined>;
|
|
21
|
+
/** this node's limits, over `resize()`'s (in flow units) */
|
|
22
|
+
readonly minWidth: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
|
|
23
|
+
readonly minHeight: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
|
|
24
|
+
readonly maxWidth: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
|
|
25
|
+
readonly maxHeight: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
|
|
26
|
+
/** this node keeps its aspect ratio, over `resize()`'s */
|
|
27
|
+
readonly keepAspectRatio: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
|
|
28
|
+
/**
|
|
29
|
+
* the sides its handles move: `"horizontal"` only the width (and x), `"vertical"` only the
|
|
30
|
+
* height (and y); default both. A corner then moves its one dimension
|
|
31
|
+
*/
|
|
32
|
+
readonly direction: import("@angular/core").InputSignal<ResizeDirection | undefined>;
|
|
33
|
+
private readonly context;
|
|
34
|
+
private readonly id;
|
|
35
|
+
private readonly attributes;
|
|
36
|
+
/** the resizer's state */
|
|
37
|
+
readonly state: Signal<NodeResizerState | undefined>;
|
|
38
|
+
constructor();
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FlowNodeResizerDirective, never>;
|
|
40
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FlowNodeResizerDirective, "[flowNodeResizer]", ["flowNodeResizer"], {
|
|
41
|
+
"nodeId": {
|
|
42
|
+
"alias": "nodeId";
|
|
43
|
+
"required": false;
|
|
44
|
+
"isSignal": true;
|
|
45
|
+
};
|
|
46
|
+
"minWidth": {
|
|
47
|
+
"alias": "minWidth";
|
|
48
|
+
"required": false;
|
|
49
|
+
"isSignal": true;
|
|
50
|
+
};
|
|
51
|
+
"minHeight": {
|
|
52
|
+
"alias": "minHeight";
|
|
53
|
+
"required": false;
|
|
54
|
+
"isSignal": true;
|
|
55
|
+
};
|
|
56
|
+
"maxWidth": {
|
|
57
|
+
"alias": "maxWidth";
|
|
58
|
+
"required": false;
|
|
59
|
+
"isSignal": true;
|
|
60
|
+
};
|
|
61
|
+
"maxHeight": {
|
|
62
|
+
"alias": "maxHeight";
|
|
63
|
+
"required": false;
|
|
64
|
+
"isSignal": true;
|
|
65
|
+
};
|
|
66
|
+
"keepAspectRatio": {
|
|
67
|
+
"alias": "keepAspectRatio";
|
|
68
|
+
"required": false;
|
|
69
|
+
"isSignal": true;
|
|
70
|
+
};
|
|
71
|
+
"direction": {
|
|
72
|
+
"alias": "direction";
|
|
73
|
+
"required": false;
|
|
74
|
+
"isSignal": true;
|
|
75
|
+
};
|
|
76
|
+
}, {}, never, never, true, never>;
|
|
77
|
+
}
|
|
78
|
+
/** A corner or a side of a node a resize handle moves. */
|
|
79
|
+
type ResizePosition = "top-left" | "top" | "top-right" | "right" | "bottom-right" | "bottom" | "bottom-left" | "left";
|
|
80
|
+
/** Every position, corners then sides. */
|
|
81
|
+
export declare const RESIZE_POSITIONS: readonly ResizePosition[];
|
|
82
|
+
interface ResizeHandleState {
|
|
83
|
+
readonly nodeId: string;
|
|
84
|
+
readonly position: ResizePosition;
|
|
85
|
+
/** its own direction, over its resizer's (`data-direction`); none: the resizer's */
|
|
86
|
+
readonly direction: ResizeHandleDirection | undefined;
|
|
87
|
+
/** how it is drawn (`data-variant`): a corner is always a `handle` */
|
|
88
|
+
readonly variant: ResizeHandleVariant;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A grab area of a `[flowNodeResizer]` (`data-flow-part="resize-handle"`, `data-position`), on
|
|
92
|
+
* the app's element: `<div flowResizeHandle position="bottom-right">`. A press on it resizes its
|
|
93
|
+
* node from that corner or side (`resize()`); with `keyboard()` too it takes focus and the arrows
|
|
94
|
+
* move that corner or side. Placed on its corner (centred) or along its side; give it its size (a
|
|
95
|
+
* side's thickness) and look. Its `direction` overrides its resizer's; `variant="line"` marks a
|
|
96
|
+
* side's handle as a line for your styles.
|
|
97
|
+
*/
|
|
98
|
+
export declare class FlowResizeHandleDirective {
|
|
99
|
+
/** the corner or side it moves */
|
|
100
|
+
readonly position: import("@angular/core").InputSignal<ResizePosition>;
|
|
101
|
+
/** its node; default the enclosing `[flowNode]`'s */
|
|
102
|
+
readonly nodeId: import("@angular/core").InputSignal<string | undefined>;
|
|
103
|
+
/**
|
|
104
|
+
* the sides it moves, over its resizer's `direction` (`data-direction`): `"horizontal"` only
|
|
105
|
+
* the width (and x), `"vertical"` only the height (and y); default the resizer's
|
|
106
|
+
*/
|
|
107
|
+
readonly direction: import("@angular/core").InputSignal<ResizeHandleDirection | undefined>;
|
|
108
|
+
/**
|
|
109
|
+
* how it is drawn (`data-variant`, for your styles): `"handle"` (default) or `"line"`, a
|
|
110
|
+
* side's whole length; a corner's `"line"` is ignored
|
|
111
|
+
*/
|
|
112
|
+
readonly variant: import("@angular/core").InputSignal<ResizeHandleVariant | undefined>;
|
|
113
|
+
private readonly id;
|
|
114
|
+
private readonly at;
|
|
115
|
+
private readonly look;
|
|
116
|
+
/** the handle's state */
|
|
117
|
+
readonly state: Signal<ResizeHandleState | undefined>;
|
|
118
|
+
constructor();
|
|
119
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FlowResizeHandleDirective, never>;
|
|
120
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FlowResizeHandleDirective, "[flowResizeHandle]", ["flowResizeHandle"], {
|
|
121
|
+
"position": {
|
|
122
|
+
"alias": "position";
|
|
123
|
+
"required": true;
|
|
124
|
+
"isSignal": true;
|
|
125
|
+
};
|
|
126
|
+
"nodeId": {
|
|
127
|
+
"alias": "nodeId";
|
|
128
|
+
"required": false;
|
|
129
|
+
"isSignal": true;
|
|
130
|
+
};
|
|
131
|
+
"direction": {
|
|
132
|
+
"alias": "direction";
|
|
133
|
+
"required": false;
|
|
134
|
+
"isSignal": true;
|
|
135
|
+
};
|
|
136
|
+
"variant": {
|
|
137
|
+
"alias": "variant";
|
|
138
|
+
"required": false;
|
|
139
|
+
"isSignal": true;
|
|
140
|
+
};
|
|
141
|
+
}, {}, never, never, true, never>;
|
|
142
|
+
}
|
|
143
|
+
/** The resizer's directives, for a standalone component's `imports`. */
|
|
144
|
+
export declare const FLOW_RESIZE: readonly [typeof FlowNodeResizerDirective, typeof FlowResizeHandleDirective];
|
|
145
|
+
export type { NodeResizerState, ResizeHandleState, ResizePosition };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@fragiola/flow/selection";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@fragiola/flow/subflows";
|