@xxrandr/conecta-diagram 0.0.0-stage → 0.1.4
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/LICENSE +21 -0
- package/README.md +319 -2
- package/dist/chunk-3QGSCPWL.cjs +663 -0
- package/dist/chunk-43VYPB4U.js +2136 -0
- package/dist/chunk-6ADTOXBT.cjs +626 -0
- package/dist/chunk-B2RLLFGC.js +0 -0
- package/dist/chunk-GXOBW2BK.js +290 -0
- package/dist/chunk-HZER5BPR.js +1122 -0
- package/dist/chunk-IT5H6WO2.js +626 -0
- package/dist/chunk-LKOWNTPR.cjs +1 -0
- package/dist/chunk-Q62JPMJH.js +663 -0
- package/dist/chunk-QI4NNFRQ.cjs +290 -0
- package/dist/chunk-VD32JNDO.cjs +2136 -0
- package/dist/chunk-ZMSQTBVW.cjs +1122 -0
- package/dist/core/index.cjs +56 -0
- package/dist/core/index.d.cts +65 -0
- package/dist/core/index.d.ts +65 -0
- package/dist/core/index.js +56 -0
- package/dist/d3/index.cjs +8 -0
- package/dist/d3/index.d.cts +46 -0
- package/dist/d3/index.d.ts +46 -0
- package/dist/d3/index.js +8 -0
- package/dist/index.cjs +71 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +71 -0
- package/dist/photon.css +339 -0
- package/dist/runner-display-BkBJpBY-.d.ts +151 -0
- package/dist/runner-display-DHHtavSX.d.cts +151 -0
- package/dist/store-CtOInpPu.d.cts +242 -0
- package/dist/store-CtOInpPu.d.ts +242 -0
- package/dist/svg/index.cjs +15 -0
- package/dist/svg/index.d.cts +172 -0
- package/dist/svg/index.d.ts +172 -0
- package/dist/svg/index.js +15 -0
- package/docs/devtools-refactor.md +93 -0
- package/docs/java-runtime-integration.md +268 -0
- package/docs/photon-template.html +547 -0
- package/docs/presentation-architecture.md +30 -0
- package/docs/runner-display.md +109 -0
- package/package.json +130 -4
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/** Safe, display-only descriptions, NOT executable Command protobuf messages. */
|
|
2
|
+
interface CodePreview {
|
|
3
|
+
language: string;
|
|
4
|
+
source: string;
|
|
5
|
+
}
|
|
6
|
+
type ActionBody = {
|
|
7
|
+
kind: "api";
|
|
8
|
+
method: string;
|
|
9
|
+
url: string;
|
|
10
|
+
connectionId?: string;
|
|
11
|
+
bodyPreview?: string;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "database";
|
|
14
|
+
databaseType: string;
|
|
15
|
+
datasource: string;
|
|
16
|
+
operation: string;
|
|
17
|
+
statement: string;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "file";
|
|
20
|
+
operation: string;
|
|
21
|
+
path: string;
|
|
22
|
+
destination?: string;
|
|
23
|
+
transferId?: string;
|
|
24
|
+
resumable?: boolean;
|
|
25
|
+
} | {
|
|
26
|
+
kind: "process";
|
|
27
|
+
profile: string;
|
|
28
|
+
arguments?: string[];
|
|
29
|
+
code?: CodePreview;
|
|
30
|
+
} | {
|
|
31
|
+
kind: "ssh";
|
|
32
|
+
connectionId: string;
|
|
33
|
+
command: string;
|
|
34
|
+
} | {
|
|
35
|
+
kind: "sftp";
|
|
36
|
+
connectionId: string;
|
|
37
|
+
operation: string;
|
|
38
|
+
remotePath: string;
|
|
39
|
+
localPath?: string;
|
|
40
|
+
destination?: string;
|
|
41
|
+
} | {
|
|
42
|
+
kind: "mail";
|
|
43
|
+
connectionId: string;
|
|
44
|
+
operation: string;
|
|
45
|
+
subject?: string;
|
|
46
|
+
to?: string[];
|
|
47
|
+
} | {
|
|
48
|
+
kind: "messaging";
|
|
49
|
+
connectionId: string;
|
|
50
|
+
operation: string;
|
|
51
|
+
topic: string;
|
|
52
|
+
} | {
|
|
53
|
+
kind: "event";
|
|
54
|
+
operation: string;
|
|
55
|
+
topic: string;
|
|
56
|
+
path?: string;
|
|
57
|
+
} | {
|
|
58
|
+
kind: "cancel";
|
|
59
|
+
targetCommandId: string;
|
|
60
|
+
reason?: string;
|
|
61
|
+
} | {
|
|
62
|
+
kind: "generic";
|
|
63
|
+
name: string;
|
|
64
|
+
preview?: string;
|
|
65
|
+
};
|
|
66
|
+
interface TaskAction {
|
|
67
|
+
/** Open string, as in the runner protocol. Availability comes from capabilities. */
|
|
68
|
+
type: string;
|
|
69
|
+
version?: number;
|
|
70
|
+
streaming?: boolean;
|
|
71
|
+
expectsResult?: boolean;
|
|
72
|
+
body: ActionBody;
|
|
73
|
+
}
|
|
74
|
+
interface NodeSignals {
|
|
75
|
+
inputs: string[];
|
|
76
|
+
outputs: string[];
|
|
77
|
+
}
|
|
78
|
+
interface DecisionDisplay {
|
|
79
|
+
description?: string;
|
|
80
|
+
expression?: CodePreview;
|
|
81
|
+
}
|
|
82
|
+
type CapabilityState = "available" | "unsupported" | "unverified";
|
|
83
|
+
declare const isCodePreview: (value: unknown) => value is CodePreview;
|
|
84
|
+
declare function isTaskAction(value: unknown): value is TaskAction;
|
|
85
|
+
declare function capabilityState(type: string, advertised?: readonly string[]): CapabilityState;
|
|
86
|
+
/** URL previews never expose embedded basic auth, query values or fragments. */
|
|
87
|
+
declare function displayUrl(value: string): string;
|
|
88
|
+
declare function actionPresentation(action: TaskAction): {
|
|
89
|
+
title: string;
|
|
90
|
+
lines: string[];
|
|
91
|
+
code?: CodePreview;
|
|
92
|
+
};
|
|
93
|
+
declare function formatCondition(condition: Condition): string;
|
|
94
|
+
|
|
95
|
+
/** The document is data only: code previews are text, never executable callbacks. */
|
|
96
|
+
type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
97
|
+
[key: string]: JsonValue;
|
|
98
|
+
};
|
|
99
|
+
type Context = Record<string, JsonValue>;
|
|
100
|
+
interface Point {
|
|
101
|
+
x: number;
|
|
102
|
+
y: number;
|
|
103
|
+
}
|
|
104
|
+
type Condition = {
|
|
105
|
+
op: "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "in";
|
|
106
|
+
path: string[];
|
|
107
|
+
value: JsonValue;
|
|
108
|
+
} | {
|
|
109
|
+
op: "exists";
|
|
110
|
+
path: string[];
|
|
111
|
+
} | {
|
|
112
|
+
op: "all" | "any";
|
|
113
|
+
conditions: Condition[];
|
|
114
|
+
} | {
|
|
115
|
+
op: "not";
|
|
116
|
+
condition: Condition;
|
|
117
|
+
};
|
|
118
|
+
interface NodeBase {
|
|
119
|
+
id: string;
|
|
120
|
+
label: string;
|
|
121
|
+
position: Point;
|
|
122
|
+
data?: Context;
|
|
123
|
+
signals?: NodeSignals;
|
|
124
|
+
/** Presentation only. Hiding a node never alters execution semantics. */
|
|
125
|
+
visibleWhen?: Condition;
|
|
126
|
+
}
|
|
127
|
+
type FlowNode = NodeBase & ({
|
|
128
|
+
type: "start" | "end";
|
|
129
|
+
} | {
|
|
130
|
+
type: "task";
|
|
131
|
+
mode?: "sync" | "async";
|
|
132
|
+
handler?: string;
|
|
133
|
+
action?: TaskAction;
|
|
134
|
+
} | {
|
|
135
|
+
type: "wait";
|
|
136
|
+
signal: string;
|
|
137
|
+
} | {
|
|
138
|
+
type: "decision";
|
|
139
|
+
decision?: DecisionDisplay;
|
|
140
|
+
action?: TaskAction;
|
|
141
|
+
} | {
|
|
142
|
+
type: "fork";
|
|
143
|
+
join: string;
|
|
144
|
+
} | {
|
|
145
|
+
type: "join";
|
|
146
|
+
fork: string;
|
|
147
|
+
});
|
|
148
|
+
interface FlowEdge {
|
|
149
|
+
id: string;
|
|
150
|
+
source: string;
|
|
151
|
+
target: string;
|
|
152
|
+
label?: string;
|
|
153
|
+
/** Only decision outputs may have conditions/defaults/priorities. */
|
|
154
|
+
condition?: Condition;
|
|
155
|
+
default?: boolean;
|
|
156
|
+
priority?: number;
|
|
157
|
+
data?: Context;
|
|
158
|
+
visibleWhen?: Condition;
|
|
159
|
+
}
|
|
160
|
+
interface FlowDocument {
|
|
161
|
+
schemaVersion: 1;
|
|
162
|
+
id: string;
|
|
163
|
+
nodes: FlowNode[];
|
|
164
|
+
edges: FlowEdge[];
|
|
165
|
+
data?: Context;
|
|
166
|
+
/** Diagram-owned values. They are not workflow nodes or implicit references. */
|
|
167
|
+
globals?: GlobalVariable[];
|
|
168
|
+
/** Stable creation order across the node and edge namespaces. */
|
|
169
|
+
creationOrder?: FlowItemReference[];
|
|
170
|
+
}
|
|
171
|
+
interface GlobalVariable {
|
|
172
|
+
id: string;
|
|
173
|
+
name: string;
|
|
174
|
+
type: "array" | "boolean" | "integer" | "json";
|
|
175
|
+
value: JsonValue;
|
|
176
|
+
}
|
|
177
|
+
interface FlowItemReference {
|
|
178
|
+
type: "node" | "edge";
|
|
179
|
+
id: string;
|
|
180
|
+
}
|
|
181
|
+
interface Diagnostic {
|
|
182
|
+
severity: "error" | "warning";
|
|
183
|
+
code: string;
|
|
184
|
+
message: string;
|
|
185
|
+
path: string;
|
|
186
|
+
}
|
|
187
|
+
declare class FlowError extends Error {
|
|
188
|
+
readonly code: string;
|
|
189
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
190
|
+
constructor(code: string, message: string, diagnostics?: readonly Diagnostic[]);
|
|
191
|
+
}
|
|
192
|
+
declare function createFlow(id: string): FlowDocument;
|
|
193
|
+
|
|
194
|
+
interface ChangeEvent {
|
|
195
|
+
document: FlowDocument;
|
|
196
|
+
reason: string;
|
|
197
|
+
revision: number;
|
|
198
|
+
}
|
|
199
|
+
type Unsubscribe = () => void;
|
|
200
|
+
interface StoreOptions {
|
|
201
|
+
historyLimit?: number;
|
|
202
|
+
/** Subscriber errors never roll back an already committed transaction. */
|
|
203
|
+
onListenerError?: (error: unknown) => void;
|
|
204
|
+
}
|
|
205
|
+
/** Atomic draft editing, immutable snapshots, bounded undo/redo. No DOM dependency. */
|
|
206
|
+
declare class FlowStore {
|
|
207
|
+
private readonly options;
|
|
208
|
+
private document;
|
|
209
|
+
private past;
|
|
210
|
+
private future;
|
|
211
|
+
private listeners;
|
|
212
|
+
private revision;
|
|
213
|
+
private editing;
|
|
214
|
+
private notifying;
|
|
215
|
+
private readonly limit;
|
|
216
|
+
constructor(document: FlowDocument, options?: StoreOptions);
|
|
217
|
+
/** Frozen at runtime; mutate through transaction() instead. */
|
|
218
|
+
getSnapshot(): FlowDocument;
|
|
219
|
+
getRevision(): number;
|
|
220
|
+
get canUndo(): boolean;
|
|
221
|
+
get canRedo(): boolean;
|
|
222
|
+
subscribe(listener: (event: ChangeEvent) => void): Unsubscribe;
|
|
223
|
+
transaction(reason: string, edit: (draft: FlowDocument) => void): void;
|
|
224
|
+
replace(document: FlowDocument): void;
|
|
225
|
+
addNode(node: FlowNode): void;
|
|
226
|
+
addGlobal(variable: GlobalVariable): void;
|
|
227
|
+
updateGlobal(id: string, update: (variable: GlobalVariable) => GlobalVariable): void;
|
|
228
|
+
removeGlobal(id: string): void;
|
|
229
|
+
updateNode(id: string, update: (node: FlowNode) => FlowNode): void;
|
|
230
|
+
moveNode(id: string, position: Point): void;
|
|
231
|
+
removeNode(id: string): void;
|
|
232
|
+
addEdge(edge: FlowEdge): void;
|
|
233
|
+
updateEdge(id: string, update: (edge: FlowEdge) => FlowEdge): void;
|
|
234
|
+
removeEdge(id: string): void;
|
|
235
|
+
undo(): void;
|
|
236
|
+
redo(): void;
|
|
237
|
+
private guard;
|
|
238
|
+
private emit;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export { FlowError as g, FlowStore as j, actionPresentation as k, capabilityState as l, createFlow as m, displayUrl as n, formatCondition as o, isCodePreview as p, isTaskAction as q };
|
|
242
|
+
export type { ActionBody as A, CapabilityState as C, DecisionDisplay as D, FlowDocument as F, GlobalVariable as G, JsonValue as J, NodeSignals as N, Point as P, StoreOptions as S, TaskAction as T, Unsubscribe as U, ChangeEvent as a, CodePreview as b, Condition as c, Context as d, Diagnostic as e, FlowEdge as f, FlowItemReference as h, FlowNode as i };
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/** Safe, display-only descriptions, NOT executable Command protobuf messages. */
|
|
2
|
+
interface CodePreview {
|
|
3
|
+
language: string;
|
|
4
|
+
source: string;
|
|
5
|
+
}
|
|
6
|
+
type ActionBody = {
|
|
7
|
+
kind: "api";
|
|
8
|
+
method: string;
|
|
9
|
+
url: string;
|
|
10
|
+
connectionId?: string;
|
|
11
|
+
bodyPreview?: string;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "database";
|
|
14
|
+
databaseType: string;
|
|
15
|
+
datasource: string;
|
|
16
|
+
operation: string;
|
|
17
|
+
statement: string;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "file";
|
|
20
|
+
operation: string;
|
|
21
|
+
path: string;
|
|
22
|
+
destination?: string;
|
|
23
|
+
transferId?: string;
|
|
24
|
+
resumable?: boolean;
|
|
25
|
+
} | {
|
|
26
|
+
kind: "process";
|
|
27
|
+
profile: string;
|
|
28
|
+
arguments?: string[];
|
|
29
|
+
code?: CodePreview;
|
|
30
|
+
} | {
|
|
31
|
+
kind: "ssh";
|
|
32
|
+
connectionId: string;
|
|
33
|
+
command: string;
|
|
34
|
+
} | {
|
|
35
|
+
kind: "sftp";
|
|
36
|
+
connectionId: string;
|
|
37
|
+
operation: string;
|
|
38
|
+
remotePath: string;
|
|
39
|
+
localPath?: string;
|
|
40
|
+
destination?: string;
|
|
41
|
+
} | {
|
|
42
|
+
kind: "mail";
|
|
43
|
+
connectionId: string;
|
|
44
|
+
operation: string;
|
|
45
|
+
subject?: string;
|
|
46
|
+
to?: string[];
|
|
47
|
+
} | {
|
|
48
|
+
kind: "messaging";
|
|
49
|
+
connectionId: string;
|
|
50
|
+
operation: string;
|
|
51
|
+
topic: string;
|
|
52
|
+
} | {
|
|
53
|
+
kind: "event";
|
|
54
|
+
operation: string;
|
|
55
|
+
topic: string;
|
|
56
|
+
path?: string;
|
|
57
|
+
} | {
|
|
58
|
+
kind: "cancel";
|
|
59
|
+
targetCommandId: string;
|
|
60
|
+
reason?: string;
|
|
61
|
+
} | {
|
|
62
|
+
kind: "generic";
|
|
63
|
+
name: string;
|
|
64
|
+
preview?: string;
|
|
65
|
+
};
|
|
66
|
+
interface TaskAction {
|
|
67
|
+
/** Open string, as in the runner protocol. Availability comes from capabilities. */
|
|
68
|
+
type: string;
|
|
69
|
+
version?: number;
|
|
70
|
+
streaming?: boolean;
|
|
71
|
+
expectsResult?: boolean;
|
|
72
|
+
body: ActionBody;
|
|
73
|
+
}
|
|
74
|
+
interface NodeSignals {
|
|
75
|
+
inputs: string[];
|
|
76
|
+
outputs: string[];
|
|
77
|
+
}
|
|
78
|
+
interface DecisionDisplay {
|
|
79
|
+
description?: string;
|
|
80
|
+
expression?: CodePreview;
|
|
81
|
+
}
|
|
82
|
+
type CapabilityState = "available" | "unsupported" | "unverified";
|
|
83
|
+
declare const isCodePreview: (value: unknown) => value is CodePreview;
|
|
84
|
+
declare function isTaskAction(value: unknown): value is TaskAction;
|
|
85
|
+
declare function capabilityState(type: string, advertised?: readonly string[]): CapabilityState;
|
|
86
|
+
/** URL previews never expose embedded basic auth, query values or fragments. */
|
|
87
|
+
declare function displayUrl(value: string): string;
|
|
88
|
+
declare function actionPresentation(action: TaskAction): {
|
|
89
|
+
title: string;
|
|
90
|
+
lines: string[];
|
|
91
|
+
code?: CodePreview;
|
|
92
|
+
};
|
|
93
|
+
declare function formatCondition(condition: Condition): string;
|
|
94
|
+
|
|
95
|
+
/** The document is data only: code previews are text, never executable callbacks. */
|
|
96
|
+
type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
97
|
+
[key: string]: JsonValue;
|
|
98
|
+
};
|
|
99
|
+
type Context = Record<string, JsonValue>;
|
|
100
|
+
interface Point {
|
|
101
|
+
x: number;
|
|
102
|
+
y: number;
|
|
103
|
+
}
|
|
104
|
+
type Condition = {
|
|
105
|
+
op: "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "in";
|
|
106
|
+
path: string[];
|
|
107
|
+
value: JsonValue;
|
|
108
|
+
} | {
|
|
109
|
+
op: "exists";
|
|
110
|
+
path: string[];
|
|
111
|
+
} | {
|
|
112
|
+
op: "all" | "any";
|
|
113
|
+
conditions: Condition[];
|
|
114
|
+
} | {
|
|
115
|
+
op: "not";
|
|
116
|
+
condition: Condition;
|
|
117
|
+
};
|
|
118
|
+
interface NodeBase {
|
|
119
|
+
id: string;
|
|
120
|
+
label: string;
|
|
121
|
+
position: Point;
|
|
122
|
+
data?: Context;
|
|
123
|
+
signals?: NodeSignals;
|
|
124
|
+
/** Presentation only. Hiding a node never alters execution semantics. */
|
|
125
|
+
visibleWhen?: Condition;
|
|
126
|
+
}
|
|
127
|
+
type FlowNode = NodeBase & ({
|
|
128
|
+
type: "start" | "end";
|
|
129
|
+
} | {
|
|
130
|
+
type: "task";
|
|
131
|
+
mode?: "sync" | "async";
|
|
132
|
+
handler?: string;
|
|
133
|
+
action?: TaskAction;
|
|
134
|
+
} | {
|
|
135
|
+
type: "wait";
|
|
136
|
+
signal: string;
|
|
137
|
+
} | {
|
|
138
|
+
type: "decision";
|
|
139
|
+
decision?: DecisionDisplay;
|
|
140
|
+
action?: TaskAction;
|
|
141
|
+
} | {
|
|
142
|
+
type: "fork";
|
|
143
|
+
join: string;
|
|
144
|
+
} | {
|
|
145
|
+
type: "join";
|
|
146
|
+
fork: string;
|
|
147
|
+
});
|
|
148
|
+
interface FlowEdge {
|
|
149
|
+
id: string;
|
|
150
|
+
source: string;
|
|
151
|
+
target: string;
|
|
152
|
+
label?: string;
|
|
153
|
+
/** Only decision outputs may have conditions/defaults/priorities. */
|
|
154
|
+
condition?: Condition;
|
|
155
|
+
default?: boolean;
|
|
156
|
+
priority?: number;
|
|
157
|
+
data?: Context;
|
|
158
|
+
visibleWhen?: Condition;
|
|
159
|
+
}
|
|
160
|
+
interface FlowDocument {
|
|
161
|
+
schemaVersion: 1;
|
|
162
|
+
id: string;
|
|
163
|
+
nodes: FlowNode[];
|
|
164
|
+
edges: FlowEdge[];
|
|
165
|
+
data?: Context;
|
|
166
|
+
/** Diagram-owned values. They are not workflow nodes or implicit references. */
|
|
167
|
+
globals?: GlobalVariable[];
|
|
168
|
+
/** Stable creation order across the node and edge namespaces. */
|
|
169
|
+
creationOrder?: FlowItemReference[];
|
|
170
|
+
}
|
|
171
|
+
interface GlobalVariable {
|
|
172
|
+
id: string;
|
|
173
|
+
name: string;
|
|
174
|
+
type: "array" | "boolean" | "integer" | "json";
|
|
175
|
+
value: JsonValue;
|
|
176
|
+
}
|
|
177
|
+
interface FlowItemReference {
|
|
178
|
+
type: "node" | "edge";
|
|
179
|
+
id: string;
|
|
180
|
+
}
|
|
181
|
+
interface Diagnostic {
|
|
182
|
+
severity: "error" | "warning";
|
|
183
|
+
code: string;
|
|
184
|
+
message: string;
|
|
185
|
+
path: string;
|
|
186
|
+
}
|
|
187
|
+
declare class FlowError extends Error {
|
|
188
|
+
readonly code: string;
|
|
189
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
190
|
+
constructor(code: string, message: string, diagnostics?: readonly Diagnostic[]);
|
|
191
|
+
}
|
|
192
|
+
declare function createFlow(id: string): FlowDocument;
|
|
193
|
+
|
|
194
|
+
interface ChangeEvent {
|
|
195
|
+
document: FlowDocument;
|
|
196
|
+
reason: string;
|
|
197
|
+
revision: number;
|
|
198
|
+
}
|
|
199
|
+
type Unsubscribe = () => void;
|
|
200
|
+
interface StoreOptions {
|
|
201
|
+
historyLimit?: number;
|
|
202
|
+
/** Subscriber errors never roll back an already committed transaction. */
|
|
203
|
+
onListenerError?: (error: unknown) => void;
|
|
204
|
+
}
|
|
205
|
+
/** Atomic draft editing, immutable snapshots, bounded undo/redo. No DOM dependency. */
|
|
206
|
+
declare class FlowStore {
|
|
207
|
+
private readonly options;
|
|
208
|
+
private document;
|
|
209
|
+
private past;
|
|
210
|
+
private future;
|
|
211
|
+
private listeners;
|
|
212
|
+
private revision;
|
|
213
|
+
private editing;
|
|
214
|
+
private notifying;
|
|
215
|
+
private readonly limit;
|
|
216
|
+
constructor(document: FlowDocument, options?: StoreOptions);
|
|
217
|
+
/** Frozen at runtime; mutate through transaction() instead. */
|
|
218
|
+
getSnapshot(): FlowDocument;
|
|
219
|
+
getRevision(): number;
|
|
220
|
+
get canUndo(): boolean;
|
|
221
|
+
get canRedo(): boolean;
|
|
222
|
+
subscribe(listener: (event: ChangeEvent) => void): Unsubscribe;
|
|
223
|
+
transaction(reason: string, edit: (draft: FlowDocument) => void): void;
|
|
224
|
+
replace(document: FlowDocument): void;
|
|
225
|
+
addNode(node: FlowNode): void;
|
|
226
|
+
addGlobal(variable: GlobalVariable): void;
|
|
227
|
+
updateGlobal(id: string, update: (variable: GlobalVariable) => GlobalVariable): void;
|
|
228
|
+
removeGlobal(id: string): void;
|
|
229
|
+
updateNode(id: string, update: (node: FlowNode) => FlowNode): void;
|
|
230
|
+
moveNode(id: string, position: Point): void;
|
|
231
|
+
removeNode(id: string): void;
|
|
232
|
+
addEdge(edge: FlowEdge): void;
|
|
233
|
+
updateEdge(id: string, update: (edge: FlowEdge) => FlowEdge): void;
|
|
234
|
+
removeEdge(id: string): void;
|
|
235
|
+
undo(): void;
|
|
236
|
+
redo(): void;
|
|
237
|
+
private guard;
|
|
238
|
+
private emit;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export { FlowError as g, FlowStore as j, actionPresentation as k, capabilityState as l, createFlow as m, displayUrl as n, formatCondition as o, isCodePreview as p, isTaskAction as q };
|
|
242
|
+
export type { ActionBody as A, CapabilityState as C, DecisionDisplay as D, FlowDocument as F, GlobalVariable as G, JsonValue as J, NodeSignals as N, Point as P, StoreOptions as S, TaskAction as T, Unsubscribe as U, ChangeEvent as a, CodePreview as b, Condition as c, Context as d, Diagnostic as e, FlowEdge as f, FlowItemReference as h, FlowNode as i };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkVD32JNDOcjs = require('../chunk-VD32JNDO.cjs');
|
|
7
|
+
require('../chunk-QI4NNFRQ.cjs');
|
|
8
|
+
require('../chunk-ZMSQTBVW.cjs');
|
|
9
|
+
require('../chunk-3QGSCPWL.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.SvgFlowEditor = _chunkVD32JNDOcjs.SvgFlowEditor; exports.createFlowIcon = _chunkVD32JNDOcjs.createFlowIcon; exports.iconPaths = _chunkVD32JNDOcjs.iconPaths; exports.operationIcon = _chunkVD32JNDOcjs.operationIcon;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { FlowNode, FlowStore, Context, Point } from '../core/index.cjs';
|
|
2
|
+
import { SimulationSnapshot, ExecutionOverlay } from '../core/index.cjs';
|
|
3
|
+
import { ForcePlacementOptions } from '../d3/index.cjs';
|
|
4
|
+
|
|
5
|
+
type Selection = {
|
|
6
|
+
type: "node" | "edge" | "global";
|
|
7
|
+
id: string;
|
|
8
|
+
} | null;
|
|
9
|
+
interface Viewport {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
scale: number;
|
|
13
|
+
}
|
|
14
|
+
interface SvgEditorOptions {
|
|
15
|
+
readOnly?: boolean;
|
|
16
|
+
width?: number;
|
|
17
|
+
height?: number;
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
onSelect?: (selection: Selection) => void;
|
|
20
|
+
onNodeActivate?: (node: FlowNode) => void;
|
|
21
|
+
/** Return a unique id when interactive connection creation is enabled. */
|
|
22
|
+
createEdgeId?: () => string;
|
|
23
|
+
onError?: (error: unknown) => void;
|
|
24
|
+
/** Native by default. False is available for static/test renderers. */
|
|
25
|
+
force?: boolean | ForcePlacementOptions;
|
|
26
|
+
capabilities?: readonly string[];
|
|
27
|
+
motion?: "auto" | "full" | "reduced";
|
|
28
|
+
animationDuration?: number;
|
|
29
|
+
/** Hover/focus previews are instance-owned and never execute code. Default true. */
|
|
30
|
+
tooltips?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** Imperative SVG adapter. Importing this module does not access browser globals. */
|
|
33
|
+
declare class SvgFlowEditor {
|
|
34
|
+
private readonly svg;
|
|
35
|
+
readonly store: FlowStore;
|
|
36
|
+
private readonly options;
|
|
37
|
+
private readonly root;
|
|
38
|
+
private readonly background;
|
|
39
|
+
private readonly viewportGroup;
|
|
40
|
+
private readonly edgesGroup;
|
|
41
|
+
private readonly nodesGroup;
|
|
42
|
+
private readonly markerId;
|
|
43
|
+
private readonly cleanup;
|
|
44
|
+
private readonly unsubscribe;
|
|
45
|
+
private context;
|
|
46
|
+
private execution;
|
|
47
|
+
private capabilities;
|
|
48
|
+
private viewOverrides;
|
|
49
|
+
private selected;
|
|
50
|
+
private connection;
|
|
51
|
+
private reconnection;
|
|
52
|
+
private viewport;
|
|
53
|
+
private drag;
|
|
54
|
+
private destroyed;
|
|
55
|
+
private suppressClick;
|
|
56
|
+
private width;
|
|
57
|
+
private height;
|
|
58
|
+
private placement;
|
|
59
|
+
private positions;
|
|
60
|
+
private positionTimer;
|
|
61
|
+
private viewportTimer;
|
|
62
|
+
private reducedMotion;
|
|
63
|
+
private readonly animationDuration;
|
|
64
|
+
private readonly tooltip;
|
|
65
|
+
private hovered;
|
|
66
|
+
private suppressedTooltipId;
|
|
67
|
+
constructor(svg: SVGSVGElement, store: FlowStore, options?: SvgEditorOptions);
|
|
68
|
+
getSelection(): Selection;
|
|
69
|
+
getViewport(): Viewport;
|
|
70
|
+
select(selection: Selection): void;
|
|
71
|
+
setContext(context: Context): void;
|
|
72
|
+
/** Display state supplied by a simulator or mapped from a real external runtime. */
|
|
73
|
+
setExecution(snapshot: SimulationSnapshot | ExecutionOverlay | null): void;
|
|
74
|
+
setCapabilities(types: readonly string[]): void;
|
|
75
|
+
beginConnection(source: string): void;
|
|
76
|
+
/** Rewire an existing edge without losing its id, condition or signal metadata. */
|
|
77
|
+
beginReconnection(edgeId: string, endpoint?: "source" | "target"): void;
|
|
78
|
+
cancelConnection(): void;
|
|
79
|
+
setViewport(viewport: Viewport): void;
|
|
80
|
+
private applyViewport;
|
|
81
|
+
animateViewport(viewport: Viewport, duration?: number): void;
|
|
82
|
+
zoomBy(factor: number, anchor?: Point): void;
|
|
83
|
+
fitToView(padding?: number, animate?: boolean): void;
|
|
84
|
+
/** Rendered coordinates are detached from the authored plan. */
|
|
85
|
+
getNodePositions(): ReadonlyMap<string, Point>;
|
|
86
|
+
relax(): void;
|
|
87
|
+
stopForce(): void;
|
|
88
|
+
settlePlacement(iterations?: number): ReadonlyMap<string, Point>;
|
|
89
|
+
resetPlacement(): void;
|
|
90
|
+
/** Move/pin a node for this view only, including in read-only monitoring views. */
|
|
91
|
+
moveNodeView(id: string, position: Point): void;
|
|
92
|
+
resize(width: number, height: number): void;
|
|
93
|
+
exportSvg(): string;
|
|
94
|
+
destroy(): void;
|
|
95
|
+
private render;
|
|
96
|
+
private hover;
|
|
97
|
+
private refreshTooltip;
|
|
98
|
+
private clearHover;
|
|
99
|
+
private ensurePlacement;
|
|
100
|
+
private observePlacement;
|
|
101
|
+
private animatePositions;
|
|
102
|
+
private drawPositions;
|
|
103
|
+
private patchGroup;
|
|
104
|
+
private edgeGeometry;
|
|
105
|
+
private renderEdge;
|
|
106
|
+
private cardIcon;
|
|
107
|
+
private renderCard;
|
|
108
|
+
private boundary;
|
|
109
|
+
private renderNode;
|
|
110
|
+
private click;
|
|
111
|
+
private keydown;
|
|
112
|
+
private pointerdown;
|
|
113
|
+
private pointermove;
|
|
114
|
+
private pointerup;
|
|
115
|
+
private cancelDrag;
|
|
116
|
+
private point;
|
|
117
|
+
private target;
|
|
118
|
+
private element;
|
|
119
|
+
private listen;
|
|
120
|
+
private attempt;
|
|
121
|
+
private alive;
|
|
122
|
+
private editable;
|
|
123
|
+
private checkSize;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** Small, framework-independent line icons. No external fonts, images or HTML. */
|
|
127
|
+
declare const iconPaths: {
|
|
128
|
+
readonly workflow: readonly ["M4 4h6v6H4zM14 14h6v6h-6zM7 10v7h7M10 7h7v7"];
|
|
129
|
+
readonly code: readonly ["m8 7-5 5 5 5m8-10 5 5-5 5m-3-13-2 16"];
|
|
130
|
+
readonly api: readonly ["M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0ZM3 12h18M12 3c4 4 4 14 0 18-4-4-4-14 0-18Z"];
|
|
131
|
+
readonly database: readonly ["M20 6c0 2-16 2-16 0s16-2 16 0ZM4 6v12c0 3 16 3 16 0V6M4 12c0 3 16 3 16 0"];
|
|
132
|
+
readonly file: readonly ["M13 3H6a1 1 0 0 0-1 1v16h14V9l-6-6Zm0 0v6h6M9 13h6m-6 4h4"];
|
|
133
|
+
readonly transfer: readonly ["M4 4h9l4 4v3M13 4v4h4M4 4v16h6m3-4 3-3 3 3m-3-3v8m-3-12H8m2 4H8"];
|
|
134
|
+
readonly terminal: readonly ["M3 5h18v14H3zM7 9l3 3-3 3m6 0h4"];
|
|
135
|
+
readonly sftp: readonly ["M4 7h15m-4-4 4 4-4 4M20 17H5m4-4-4 4 4 4"];
|
|
136
|
+
readonly mail: readonly ["M3 5h18v14H3zM3 6l9 7 9-7"];
|
|
137
|
+
readonly messaging: readonly ["M3 4h14v11H9l-4 4v-4H3zM17 8h4v12h-4l-3 3v-4"];
|
|
138
|
+
readonly event: readonly ["m13 2-8 12h6l-1 8 9-13h-7l1-7Z"];
|
|
139
|
+
readonly decision: readonly ["m12 3 9 9-9 9-9-9 9-9ZM9 9h3v6m0-3h4"];
|
|
140
|
+
readonly wait: readonly ["M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0ZM12 7v5l3 2"];
|
|
141
|
+
readonly cancel: readonly ["M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0ZM8 8l8 8m0-8-8 8"];
|
|
142
|
+
readonly extension: readonly ["M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM17 14v6m-3-3h6"];
|
|
143
|
+
readonly play: readonly ["m9 5 10 7-10 7V5Z"];
|
|
144
|
+
readonly stop: readonly ["M7 7h10v10H7z"];
|
|
145
|
+
readonly pause: readonly ["M8 5v14m8-14v14"];
|
|
146
|
+
readonly next: readonly ["m5 5 10 7-10 7V5Zm14 0v14"];
|
|
147
|
+
readonly reset: readonly ["M4 10a8 8 0 1 1 1 7M4 4v6h6"];
|
|
148
|
+
readonly check: readonly ["m5 12 4 4L19 6"];
|
|
149
|
+
readonly error: readonly ["M12 3 2 21h20L12 3Zm0 6v5m0 3v.2"];
|
|
150
|
+
readonly in: readonly ["M3 12h14m-5-5 5 5-5 5m6-14h3v18h-3"];
|
|
151
|
+
readonly out: readonly ["M3 12h14m-5-5 5 5-5 5M6 3H3v18h3"];
|
|
152
|
+
readonly fork: readonly ["M12 20v-8M6 4v5l6 3 6-3V4M4 4h4m8 0h4"];
|
|
153
|
+
readonly join: readonly ["M6 4v5l6 5 6-5V4m-6 10v6m-3-3 3 3 3-3"];
|
|
154
|
+
readonly fit: readonly ["M3 9V3h6m6 0h6v6M3 15v6h6m6 0h6v-6M8 8h8v8H8z"];
|
|
155
|
+
readonly plus: readonly ["M12 5v14M5 12h14"];
|
|
156
|
+
readonly minus: readonly ["M5 12h14"];
|
|
157
|
+
readonly chevron: readonly ["m9 5 7 7-7 7"];
|
|
158
|
+
readonly search: readonly ["M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-2 6 6 6"];
|
|
159
|
+
readonly download: readonly ["M12 3v12m-5-5 5 5 5-5M4 16v5h16v-5"];
|
|
160
|
+
readonly copy: readonly ["M8 8h12v13H8zM15 8V3H3v13h5"];
|
|
161
|
+
readonly locate: readonly ["M12 2v4m0 12v4M2 12h4m12 0h4M19 12a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"];
|
|
162
|
+
readonly undo: readonly ["m7 4-4 5 4 5M3 9h10a7 7 0 0 1 7 7v4"];
|
|
163
|
+
readonly redo: readonly ["m17 4 4 5-4 5m4-5H11a7 7 0 0 0-7 7v4"];
|
|
164
|
+
readonly more: readonly ["M5 11v2m7-2v2m7-2v2"];
|
|
165
|
+
readonly info: readonly ["M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0ZM12 11v6m0-10v.1"];
|
|
166
|
+
};
|
|
167
|
+
type FlowIconName = keyof typeof iconPaths;
|
|
168
|
+
declare function createFlowIcon(document: Document, name: FlowIconName, size?: number): SVGSVGElement;
|
|
169
|
+
declare function operationIcon(kind: string): FlowIconName;
|
|
170
|
+
|
|
171
|
+
export { SvgFlowEditor, createFlowIcon, iconPaths, operationIcon };
|
|
172
|
+
export type { FlowIconName, Selection, SvgEditorOptions, Viewport };
|