process-graph 1.0.5 → 1.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/README.md +85 -17
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +92 -0
- package/dist/cli.d.ts +512 -0
- package/dist/cli.js +3 -0
- package/dist/control-aDk9560d.js +294 -0
- package/dist/detail-panel-B1ZmMuJT.js +341 -0
- package/dist/dist-BpCBmnMl.js +582 -0
- package/dist/dist-HLlW8vgT.js +1388 -0
- package/dist/dist-IjrgWhHQ.js +3 -0
- package/dist/errors-BZe5WzCn.js +19 -0
- package/dist/exit-codes-0ultCqdS.js +23 -0
- package/dist/graphql-C1j5wQFz.d.ts +631 -0
- package/dist/index-CCfe0csl.d.ts +353 -0
- package/dist/index-CmZOswkx.d.ts +512 -0
- package/dist/index-CoA6vXqe.d.ts +404 -0
- package/dist/index-CptUHq6F.d.ts +58 -0
- package/dist/index-CrM5qWUA.d.ts +110 -0
- package/dist/index-DhbvDgK4.d.ts +1582 -0
- package/dist/index-DricKcyl.d.ts +421 -0
- package/dist/index.d.ts +111 -4
- package/dist/index.js +929 -5
- package/dist/layout-CCM-KBdp.js +307 -0
- package/dist/layout.d.ts +8 -0
- package/dist/layout.js +2 -0
- package/dist/node-AchI1T-K.js +40 -0
- package/dist/open-CyRXJ4bt.js +29 -0
- package/dist/parse-CuipC_2K.js +41 -0
- package/dist/queries-CCexJAE2.js +2202 -0
- package/dist/react-flow/style.css +658 -0
- package/dist/react-flow.d.ts +173 -0
- package/dist/react-flow.js +450 -0
- package/dist/react.d.ts +2 -0
- package/dist/react.js +107 -0
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/router-D4gtTlXm.js +188 -0
- package/dist/schema-CVnS6HiX.js +234 -0
- package/dist/selection-BW_xXWOy.js +314 -0
- package/dist/source/github/node.d.ts +16 -0
- package/dist/source/github/node.js +2 -0
- package/dist/source/github.d.ts +49 -0
- package/dist/source/github.js +201 -0
- package/dist/source-DRDpEA8Q.js +1316 -0
- package/dist/status-Bm1CGu9C.js +11 -0
- package/dist/store/node.d.ts +24 -0
- package/dist/store/node.js +2 -0
- package/dist/store/wasm/worker.d.ts +16 -0
- package/dist/store/wasm/worker.js +98 -0
- package/dist/store/wasm.d.ts +9 -0
- package/dist/store/wasm.js +11 -0
- package/dist/store-BcR70CaO.js +1287 -0
- package/dist/store.d.ts +1328 -0
- package/dist/store.js +238 -0
- package/dist/ui/style.css +351 -0
- package/dist/ui.d.ts +235 -0
- package/dist/ui.js +2 -0
- package/dist/validate-DF3mQZww.js +125 -0
- package/package.json +148 -13
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
import { C as CriticalPath, F as Status, _ as StatusRule, d as StatusExplanation, k as Facts, u as ChainLink } from "./index-CCfe0csl.js";
|
|
2
|
+
import { G as IdSpace, O as Projection, a as Overlay, g as Model, x as Element } from "./index-CmZOswkx.js";
|
|
3
|
+
import { Q as GraphStoreClient, z as StoredModel } from "./index-DhbvDgK4.js";
|
|
4
|
+
import { A as Flowchart, E as Swimlane, g as SequenceDiagram, x as StateMachine } from "./index-CoA6vXqe.js";
|
|
5
|
+
import { KeyboardEvent, ReactElement, ReactNode, RefCallback } from "react";
|
|
6
|
+
//#region ../../ui/graph/react/dist/run.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Everything the reasoning hooks read: the model, its run overlay and the injected source of facts that conditions and provided artefacts are answered from. Keep the three stable between renders (from state, a store or `useMemo`), since the hooks recompute whenever one of them changes identity.
|
|
9
|
+
*/
|
|
10
|
+
interface Run<I extends IdSpace> {
|
|
11
|
+
readonly model: Model<I>;
|
|
12
|
+
readonly overlay: Readonly<Overlay<I>>;
|
|
13
|
+
readonly facts: Facts;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The facts port of a run that has no facts source: every key is not found, so a condition that reads one is indeterminate and no input artefact counts as provided.
|
|
17
|
+
* @returns `{ found: false }` for every key.
|
|
18
|
+
*/
|
|
19
|
+
declare const noFacts: Facts;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region ../../ui/graph/react/dist/model.d.ts
|
|
22
|
+
/**
|
|
23
|
+
* Where a model being followed from a store stands. `missing` is a model the store does not have, yet or any more: it is still followed, so the first write that creates it, such as a sync, loads it.
|
|
24
|
+
*/
|
|
25
|
+
type ModelState = {
|
|
26
|
+
readonly status: "loading";
|
|
27
|
+
} | {
|
|
28
|
+
readonly status: "missing";
|
|
29
|
+
} | {
|
|
30
|
+
readonly status: "loaded";
|
|
31
|
+
readonly stored: StoredModel;
|
|
32
|
+
} | {
|
|
33
|
+
readonly status: "failed";
|
|
34
|
+
readonly error: unknown;
|
|
35
|
+
};
|
|
36
|
+
/** The part of the `GraphStore` client `useModel` calls: loading a model and following its changes. */
|
|
37
|
+
interface ModelClient {
|
|
38
|
+
readonly v1: {
|
|
39
|
+
readonly models: Pick<GraphStoreClient["v1"]["models"], "load">;
|
|
40
|
+
readonly changes: GraphStoreClient["v1"]["changes"];
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Loads a model from a store and follows it: every change the store reports loads the model again, so the result always reflects the store's latest revision. It subscribes before the first load, so no change between the two is missed. A model the store does not have is `missing` and still followed, so a model that is created later, or deleted and saved again, is loaded when it is.
|
|
45
|
+
* @param client - A `GraphStore` client, over any transport. Keep it stable between renders.
|
|
46
|
+
* @param modelId - The model to follow.
|
|
47
|
+
* @returns `loading` until the first load; then `loaded` with the model, its overlay and revision, `missing` while the store has no such model (its load answers `NOT_FOUND`), or `failed` with any other error a load or the subscription ended with.
|
|
48
|
+
*/
|
|
49
|
+
declare const useModel: (client: ModelClient, modelId: string) => ModelState;
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region ../../ui/graph/react/dist/analysis.d.ts
|
|
52
|
+
/**
|
|
53
|
+
* The status of every element in a run, derived by `deriveStatuses`.
|
|
54
|
+
* @param run - The model, overlay and facts.
|
|
55
|
+
* @returns Each element's status, in model order.
|
|
56
|
+
* @throws CycleError when the model has an illegal cycle, so an error boundary shows it.
|
|
57
|
+
*/
|
|
58
|
+
declare const useStatuses: <I extends IdSpace>(run: Run<I>) => ReadonlyMap<I["element"], Status>;
|
|
59
|
+
/**
|
|
60
|
+
* The work that can start now, by `readySet`.
|
|
61
|
+
* @param run - The model, overlay and facts.
|
|
62
|
+
* @returns The ready elements, in model order.
|
|
63
|
+
*/
|
|
64
|
+
declare const useReadySet: <I extends IdSpace>(run: Run<I>) => readonly I["element"][];
|
|
65
|
+
/**
|
|
66
|
+
* Why an element has its status, by `explainStatus`.
|
|
67
|
+
* @param run - The model, overlay and facts.
|
|
68
|
+
* @param id - The element asked about, or `undefined` when nothing is.
|
|
69
|
+
* @returns The explanation, or `undefined` when `id` is.
|
|
70
|
+
* @throws UnknownNodeError when `id` is not an element of the model.
|
|
71
|
+
*/
|
|
72
|
+
declare const useWhyStatus: <I extends IdSpace>(run: Run<I>, id: I["element"] | undefined) => StatusExplanation<I> | undefined;
|
|
73
|
+
/** The unfinished work behind an element. */
|
|
74
|
+
interface BlockedChain<I extends IdSpace> {
|
|
75
|
+
/** The element, then every unfinished need reached from it, each with the needs it still waits on; see `explainStatus`. */
|
|
76
|
+
readonly chain: readonly ChainLink<I>[];
|
|
77
|
+
/** The open work at the end of the chain, which waits on nothing further: what to finish first. The same elements `blockedBy` returns. */
|
|
78
|
+
readonly blockers: readonly I["element"][];
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The unfinished work holding an element back: the whole chain and the blockers at its end.
|
|
82
|
+
* @param run - The model, overlay and facts.
|
|
83
|
+
* @param id - The element asked about, or `undefined` when nothing is.
|
|
84
|
+
* @returns The chain and its blockers; both empty when `id` is `undefined`.
|
|
85
|
+
* @throws UnknownNodeError when `id` is not an element of the model.
|
|
86
|
+
*/
|
|
87
|
+
declare const useBlockedChain: <I extends IdSpace>(run: Run<I>, id: I["element"] | undefined) => BlockedChain<I>;
|
|
88
|
+
/**
|
|
89
|
+
* What every blocked element is blocked by, by `blockedBy`, for a view that shows each element's blockers beside it.
|
|
90
|
+
* @param run - The model, overlay and facts.
|
|
91
|
+
* @returns The open work at the end of each blocked element's chain, keyed by the blocked element, in model order. Elements that are not blocked are absent.
|
|
92
|
+
*/
|
|
93
|
+
declare const useBlockers: <I extends IdSpace>(run: Run<I>) => ReadonlyMap<I["element"], readonly I["element"][]>;
|
|
94
|
+
/**
|
|
95
|
+
* The live work that transitively depends on an element, by `impact`.
|
|
96
|
+
* @param run - The model, overlay and facts.
|
|
97
|
+
* @param id - The element asked about, or `undefined` when nothing is.
|
|
98
|
+
* @returns The impacted elements; empty when `id` is `undefined`.
|
|
99
|
+
* @throws UnknownNodeError when `id` is not an element of the model.
|
|
100
|
+
*/
|
|
101
|
+
declare const useImpact: <I extends IdSpace>(run: Run<I>, id: I["element"] | undefined) => readonly I["element"][];
|
|
102
|
+
/**
|
|
103
|
+
* Every element weighs one step, so the critical path is the longest chain of work still ahead.
|
|
104
|
+
* @returns One.
|
|
105
|
+
*/
|
|
106
|
+
declare const stepWeight: () => number;
|
|
107
|
+
/**
|
|
108
|
+
* The heaviest chain through the work still ahead, by `criticalPath`.
|
|
109
|
+
* @param run - The model, overlay and facts.
|
|
110
|
+
* @param weight - The cost of an element, finite and not negative. Keep it stable between renders. Defaults to `stepWeight`.
|
|
111
|
+
* @returns The path in dependency order and its total weight; empty when nothing is live.
|
|
112
|
+
* @throws RangeError when `weight` returns a negative or non-finite number.
|
|
113
|
+
*/
|
|
114
|
+
declare const useCriticalPath: <I extends IdSpace>(run: Run<I>, weight?: (id: I["element"]) => number) => CriticalPath<I["element"]>;
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region ../../ui/graph/react/dist/projection.d.ts
|
|
117
|
+
/** The view each projection notation produces. */
|
|
118
|
+
interface ViewsByNotation<I extends IdSpace> {
|
|
119
|
+
readonly flowchart: Flowchart<I>;
|
|
120
|
+
readonly swimlane: Swimlane<I>;
|
|
121
|
+
readonly stateMachine: StateMachine<I>;
|
|
122
|
+
readonly sequence: SequenceDiagram<I>;
|
|
123
|
+
}
|
|
124
|
+
/** A projection request together with the view it produced, discriminated by notation. */
|
|
125
|
+
type ProjectedView<I extends IdSpace> = { readonly [N in keyof ViewsByNotation<I>]: {
|
|
126
|
+
readonly notation: N;
|
|
127
|
+
readonly view: ViewsByNotation<I>[N];
|
|
128
|
+
}; }[keyof ViewsByNotation<I>];
|
|
129
|
+
/**
|
|
130
|
+
* Projects a model into the notation a projection names, with the input it records (a subject, a scenario).
|
|
131
|
+
* @param model - The model to project.
|
|
132
|
+
* @param projection - One of the model's declared projections, or one built the same way.
|
|
133
|
+
* @returns The notation and its view.
|
|
134
|
+
*/
|
|
135
|
+
declare const project: <I extends IdSpace>(model: Model<I>, projection: Projection<I>) => ProjectedView<I>;
|
|
136
|
+
/**
|
|
137
|
+
* A model's view in one notation, projected again only when the model or the projection changes.
|
|
138
|
+
* @param model - The model to project.
|
|
139
|
+
* @param projection - The projection to draw. Keep it stable between renders, for instance one of `model.projections`.
|
|
140
|
+
* @returns The notation and its view.
|
|
141
|
+
* @throws Error when a state machine's subject is not a declared entity.
|
|
142
|
+
*/
|
|
143
|
+
declare const useProjection: <I extends IdSpace>(model: Model<I>, projection: Projection<I>) => ProjectedView<I>;
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region ../../ui/graph/react/dist/filter.d.ts
|
|
146
|
+
/**
|
|
147
|
+
* Which elements to show. Each set constrains one property, and an empty set does not constrain it, so the empty filter shows everything. An element is shown when it passes every set that is not empty.
|
|
148
|
+
*/
|
|
149
|
+
interface ElementFilter {
|
|
150
|
+
/** Statuses to show. */
|
|
151
|
+
readonly statuses: ReadonlySet<Status>;
|
|
152
|
+
/** Actors to show the work of, by participant id. An element with no actor, such as a start or end, never matches a non-empty set. */
|
|
153
|
+
readonly actors: ReadonlySet<string>;
|
|
154
|
+
/** Sources to show the work of, by `sourceScope`. An element bound to no source never matches a non-empty set. */
|
|
155
|
+
readonly sources: ReadonlySet<string>;
|
|
156
|
+
}
|
|
157
|
+
/** The filter that shows every element. */
|
|
158
|
+
declare const emptyFilter: ElementFilter;
|
|
159
|
+
/**
|
|
160
|
+
* The collection a source-qualified identifier belongs to: the identifier up to its item separator, so `github:org/repo#12` is in `github:org/repo`. An identifier with no item separator is its own collection.
|
|
161
|
+
* @param source - A source-qualified identifier.
|
|
162
|
+
* @returns The identifier's collection.
|
|
163
|
+
*/
|
|
164
|
+
declare const sourceScope: (source: string) => string;
|
|
165
|
+
/**
|
|
166
|
+
* The actors an element's work belongs to: the actor of an activity or decision, and both ends of a message.
|
|
167
|
+
* @param element - The element.
|
|
168
|
+
* @returns Its actors' participant ids.
|
|
169
|
+
*/
|
|
170
|
+
declare const actorsOf: <I extends IdSpace>(element: Element<I["element"], I>) => readonly I["actor"][];
|
|
171
|
+
/**
|
|
172
|
+
* Whether an element passes a filter.
|
|
173
|
+
* @param element - The element.
|
|
174
|
+
* @param status - The element's status in the run.
|
|
175
|
+
* @param filter - The filter.
|
|
176
|
+
* @returns True when the element is shown.
|
|
177
|
+
*/
|
|
178
|
+
declare const matchesFilter: <I extends IdSpace>(element: Element<I["element"], I>, status: Status, filter: ElementFilter) => boolean;
|
|
179
|
+
/**
|
|
180
|
+
* The elements a filter shows.
|
|
181
|
+
* @param model - The model.
|
|
182
|
+
* @param statuses - Each element's status, from `useStatuses`.
|
|
183
|
+
* @param filter - The filter.
|
|
184
|
+
* @returns The shown elements' ids, in model order.
|
|
185
|
+
*/
|
|
186
|
+
declare const filterElements: <I extends IdSpace>(model: Model<I>, statuses: ReadonlyMap<I["element"], Status>, filter: ElementFilter) => readonly I["element"][];
|
|
187
|
+
/** A value a filter can select, and the text it is shown with. */
|
|
188
|
+
interface FilterOption<V extends string = string> {
|
|
189
|
+
readonly value: V;
|
|
190
|
+
readonly label: string;
|
|
191
|
+
}
|
|
192
|
+
/** What a model's elements can be filtered by, beyond status. */
|
|
193
|
+
interface FilterOptions {
|
|
194
|
+
/** The roles and systems that are some element's actor, in declaration order. */
|
|
195
|
+
readonly actors: readonly FilterOption[];
|
|
196
|
+
/** The source collections of the model's bound activities, in order of first appearance. */
|
|
197
|
+
readonly sources: readonly FilterOption[];
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* The actors and sources a model's elements can be filtered by.
|
|
201
|
+
* @param model - The model.
|
|
202
|
+
* @returns The options, each labelled for display.
|
|
203
|
+
*/
|
|
204
|
+
declare const filterOptions: <I extends IdSpace>(model: Model<I>) => FilterOptions;
|
|
205
|
+
/** A filter and the operations that change it. */
|
|
206
|
+
interface ElementFilterState {
|
|
207
|
+
readonly filter: ElementFilter;
|
|
208
|
+
/** Adds the status to the filter, or removes it when it is there. */
|
|
209
|
+
readonly toggleStatus: (status: Status) => void;
|
|
210
|
+
/** Adds the actor to the filter, or removes it when it is there. */
|
|
211
|
+
readonly toggleActor: (actor: string) => void;
|
|
212
|
+
/** Adds the source collection to the filter, or removes it when it is there. */
|
|
213
|
+
readonly toggleSource: (source: string) => void;
|
|
214
|
+
/** Clears every constraint. */
|
|
215
|
+
readonly clear: () => void;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Filter state for a view: which statuses, actors and sources to show.
|
|
219
|
+
* @param initial - The filter to start with. Defaults to `emptyFilter`.
|
|
220
|
+
* @returns The filter and its operations, each stable between renders.
|
|
221
|
+
*/
|
|
222
|
+
declare const useElementFilter: (initial?: ElementFilter) => ElementFilterState;
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region ../../ui/graph/react/dist/selection.d.ts
|
|
225
|
+
/** Props for the element that holds the selectable items: a listbox that moves the selection with the keyboard. */
|
|
226
|
+
interface SelectionContainerProps {
|
|
227
|
+
readonly role: "listbox";
|
|
228
|
+
readonly onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;
|
|
229
|
+
}
|
|
230
|
+
/** Props for one selectable item: an option with a roving tab stop, selected by a click. */
|
|
231
|
+
interface SelectionItemProps {
|
|
232
|
+
readonly role: "option";
|
|
233
|
+
readonly ref: RefCallback<HTMLElement>;
|
|
234
|
+
readonly tabIndex: 0 | -1;
|
|
235
|
+
readonly "aria-selected": boolean;
|
|
236
|
+
readonly onClick: () => void;
|
|
237
|
+
}
|
|
238
|
+
/** The selected element of a view, how to change it, and the props that make a set of items keyboard navigable. */
|
|
239
|
+
interface GraphSelection<Id extends string> {
|
|
240
|
+
/** The selected element, or `undefined` when none is or the selected one is no longer in `order`. */
|
|
241
|
+
readonly selected: Id | undefined;
|
|
242
|
+
readonly select: (id: Id | undefined) => void;
|
|
243
|
+
readonly containerProps: SelectionContainerProps;
|
|
244
|
+
/** The props for the item of one element, to spread on it. */
|
|
245
|
+
readonly itemProps: (id: Id) => SelectionItemProps;
|
|
246
|
+
}
|
|
247
|
+
/** How a selection starts and what it tells its owner. */
|
|
248
|
+
interface GraphSelectionOptions<Id extends string> {
|
|
249
|
+
/** The element selected at first, when the hook keeps the selection itself. */
|
|
250
|
+
readonly initial?: Id | undefined;
|
|
251
|
+
/**
|
|
252
|
+
* The selected element, when the owner keeps the selection: give this key, even as `undefined`, and the hook reads the selection from it and keeps none of its own, reporting each change a click or key asks for through `onChange`. Several views of one model then share one selection. Leave the key out for the hook to keep the selection, starting from `initial`.
|
|
253
|
+
*/
|
|
254
|
+
readonly selected?: Id | undefined;
|
|
255
|
+
/** Called with each new selection a click or key makes, so a parent can follow it. */
|
|
256
|
+
readonly onChange?: ((id: Id | undefined) => void) | undefined;
|
|
257
|
+
/** Focuses the item of an element after a keyboard move. Defaults to focusing the element `itemProps` was spread on; a renderer that draws its own focusable items, such as a canvas, passes its own. */
|
|
258
|
+
readonly focus?: ((id: Id) => void) | undefined;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Selection state with keyboard navigation over the elements of a view, following the listbox pattern of the WAI-ARIA Authoring Practices: the arrow keys move the selection to the next or previous element in `order`, wrapping at either end; Home and End move to the first and last; Escape clears it. Only one item is a tab stop: the selected one, or the first when none is. A keyboard move also focuses the item it selects.
|
|
262
|
+
* @param order - The navigable elements, in the order the keys move through them: the elements on show, after filtering.
|
|
263
|
+
* @param options - The initial selection or the owner's selection, a listener for changes and how to focus an item.
|
|
264
|
+
* @returns The selection, a setter, and the container and item props.
|
|
265
|
+
*/
|
|
266
|
+
declare const useGraphSelection: <Id extends string>(order: readonly Id[], options?: GraphSelectionOptions<Id>) => GraphSelection<Id>;
|
|
267
|
+
//#endregion
|
|
268
|
+
//#region ../../ui/graph/react/dist/labels.d.ts
|
|
269
|
+
/** The text each status is shown with, so every component names a status the same way. */
|
|
270
|
+
declare const statusLabels: Readonly<Record<Status, string>>;
|
|
271
|
+
/** One sentence per status rule, saying why an element has the status that rule decided. */
|
|
272
|
+
declare const ruleDescriptions: Readonly<Record<StatusRule, string>>;
|
|
273
|
+
/**
|
|
274
|
+
* The text an element is shown with: its own label, or for a pseudo-state the name of its role.
|
|
275
|
+
* @param element - The element to name.
|
|
276
|
+
* @returns The element's display label.
|
|
277
|
+
*/
|
|
278
|
+
declare const elementLabel: <I extends IdSpace>(element: Element<I["element"], I>) => string;
|
|
279
|
+
//#endregion
|
|
280
|
+
//#region ../../ui/graph/react/dist/status-badge.d.ts
|
|
281
|
+
interface StatusBadgeProps {
|
|
282
|
+
readonly status: Status;
|
|
283
|
+
readonly className?: string | undefined;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* A status as text, carrying the status in `data-status` so a stylesheet can colour it.
|
|
287
|
+
* @param props - The status and an optional class.
|
|
288
|
+
* @returns A `span` naming the status.
|
|
289
|
+
*/
|
|
290
|
+
declare const StatusBadge: (props: StatusBadgeProps) => ReactElement;
|
|
291
|
+
//#endregion
|
|
292
|
+
//#region ../../ui/graph/react/dist/element-card.d.ts
|
|
293
|
+
/** The parts of an element card a class can be given to. */
|
|
294
|
+
type ElementCardPart = "root" | "label" | "status" | "critical" | "blockers";
|
|
295
|
+
/** Another element named by a card, by id and display label. */
|
|
296
|
+
interface NamedElement {
|
|
297
|
+
readonly id: string;
|
|
298
|
+
readonly label: string;
|
|
299
|
+
}
|
|
300
|
+
interface ElementCardProps<I extends IdSpace> {
|
|
301
|
+
readonly element: Element<I["element"], I>;
|
|
302
|
+
readonly status: Status;
|
|
303
|
+
/** Whether the element is on the critical path. */
|
|
304
|
+
readonly critical?: boolean | undefined;
|
|
305
|
+
/** The open work the element waits on, shown when it is not empty. */
|
|
306
|
+
readonly blockedBy?: readonly NamedElement[] | undefined;
|
|
307
|
+
/** The props from `useGraphSelection().itemProps`, when the card is a navigable item. */
|
|
308
|
+
readonly item?: SelectionItemProps | undefined;
|
|
309
|
+
readonly classNames?: Partial<Record<ElementCardPart, string>> | undefined;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* One element: its label, its status, whether it is on the critical path, and what it is blocked by. The root carries `data-element-id`, `data-kind`, `data-status` and, on the critical path, `data-critical`.
|
|
313
|
+
* @param props - The element, its status and what to show beside it.
|
|
314
|
+
* @returns The card.
|
|
315
|
+
*/
|
|
316
|
+
declare const ElementCard: <I extends IdSpace>(props: ElementCardProps<I>) => ReactElement;
|
|
317
|
+
//#endregion
|
|
318
|
+
//#region ../../ui/graph/react/dist/transition-item.d.ts
|
|
319
|
+
/** The parts of a transition item a class can be given to. */
|
|
320
|
+
type TransitionItemPart = "root" | "from" | "to" | "label";
|
|
321
|
+
interface TransitionItemProps {
|
|
322
|
+
/** The transition, or for an edge standing for several, the first. */
|
|
323
|
+
readonly id: string;
|
|
324
|
+
/** The source element's display label. */
|
|
325
|
+
readonly from: string;
|
|
326
|
+
/** The target element's display label. */
|
|
327
|
+
readonly to: string;
|
|
328
|
+
/** The guard or message label, when there is one. */
|
|
329
|
+
readonly label?: string | undefined;
|
|
330
|
+
/** Whether the transition passes work between actors. */
|
|
331
|
+
readonly handoff?: boolean | undefined;
|
|
332
|
+
/** Whether both ends are on the critical path. */
|
|
333
|
+
readonly critical?: boolean | undefined;
|
|
334
|
+
readonly classNames?: Partial<Record<TransitionItemPart, string>> | undefined;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* One transition as a list item: where it comes from, where it goes and its label. The item carries `data-transition-id` and, as applicable, `data-handoff` and `data-critical`; a hand-off says so in its text.
|
|
338
|
+
* @param props - The transition's ends and label.
|
|
339
|
+
* @returns An `li`, to place in a list.
|
|
340
|
+
*/
|
|
341
|
+
declare const TransitionItem: (props: TransitionItemProps) => ReactElement;
|
|
342
|
+
//#endregion
|
|
343
|
+
//#region ../../ui/graph/react/dist/lane.d.ts
|
|
344
|
+
/** The parts of a lane a class can be given to. */
|
|
345
|
+
type LanePart = "root" | "heading" | "body";
|
|
346
|
+
interface LaneProps {
|
|
347
|
+
/** The participant the lane belongs to. */
|
|
348
|
+
readonly participant: string;
|
|
349
|
+
readonly label: string;
|
|
350
|
+
readonly children?: ReactNode;
|
|
351
|
+
readonly classNames?: Partial<Record<LanePart, string>> | undefined;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* A swimlane: a group named by its heading, holding the work of one participant. The group carries `data-lane` with the participant's id.
|
|
355
|
+
* @param props - The participant, its label and the lane's content.
|
|
356
|
+
* @returns The lane.
|
|
357
|
+
*/
|
|
358
|
+
declare const Lane: (props: LaneProps) => ReactElement;
|
|
359
|
+
//#endregion
|
|
360
|
+
//#region ../../ui/graph/react/dist/legend.d.ts
|
|
361
|
+
/** The parts of a legend a class can be given to. */
|
|
362
|
+
type LegendPart = "root" | "item" | "swatch" | "label";
|
|
363
|
+
interface LegendProps {
|
|
364
|
+
/** The statuses to explain. Defaults to every status. */
|
|
365
|
+
readonly statuses?: readonly Status[] | undefined;
|
|
366
|
+
/** Whether to explain the critical path marking too. */
|
|
367
|
+
readonly critical?: boolean | undefined;
|
|
368
|
+
readonly classNames?: Partial<Record<LegendPart, string>> | undefined;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* A key to the statuses a view colours: a labelled list with a swatch per status. Each item and its swatch carry `data-status`, or `data-critical` for the critical path entry, so a stylesheet colours the swatch by attribute.
|
|
372
|
+
* @param props - The statuses to list and the classes to give its parts.
|
|
373
|
+
* @returns The legend.
|
|
374
|
+
*/
|
|
375
|
+
declare const Legend: (props: LegendProps) => ReactElement;
|
|
376
|
+
//#endregion
|
|
377
|
+
//#region ../../ui/graph/react/dist/filter-panel.d.ts
|
|
378
|
+
/** The parts of a filter panel a class can be given to. */
|
|
379
|
+
type FilterPanelPart = "root" | "group" | "legend" | "option" | "checkbox" | "clear";
|
|
380
|
+
interface FilterPanelProps {
|
|
381
|
+
readonly filter: ElementFilter;
|
|
382
|
+
/** The actors and sources to offer, from `filterOptions`. A group with no options is not shown. */
|
|
383
|
+
readonly options: FilterOptions;
|
|
384
|
+
/** The statuses to offer. Defaults to every status. */
|
|
385
|
+
readonly statuses?: readonly Status[] | undefined;
|
|
386
|
+
readonly onToggleStatus: (status: Status) => void;
|
|
387
|
+
readonly onToggleActor: (actor: string) => void;
|
|
388
|
+
readonly onToggleSource: (source: string) => void;
|
|
389
|
+
readonly onClear: () => void;
|
|
390
|
+
readonly classNames?: Partial<Record<FilterPanelPart, string>> | undefined;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Checkboxes for filtering a view by status, actor and source, and a button that clears them. Each group is a `fieldset` carrying `data-filter` with `status`, `actor` or `source`.
|
|
394
|
+
* @param props - The current filter, what to offer, and the handlers that change it.
|
|
395
|
+
* @returns A search form.
|
|
396
|
+
*/
|
|
397
|
+
declare const FilterPanel: (props: FilterPanelProps) => ReactElement;
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region ../../ui/graph/react/dist/detail-panel.d.ts
|
|
400
|
+
/** The parts of a detail panel a class can be given to. */
|
|
401
|
+
type DetailPanelPart = "root" | "heading" | "status" | "reason" | "section" | "sectionHeading" | "list";
|
|
402
|
+
interface DetailPanelProps<I extends IdSpace> {
|
|
403
|
+
readonly element: Element<I["element"], I>;
|
|
404
|
+
/** Why the element has its status, from `useWhyStatus`. */
|
|
405
|
+
readonly explanation: StatusExplanation<I>;
|
|
406
|
+
/** The open work at the end of its blocked chain, from `useBlockedChain`. */
|
|
407
|
+
readonly blockers: readonly I["element"][];
|
|
408
|
+
/** The live work that depends on it, from `useImpact`. */
|
|
409
|
+
readonly impact: readonly I["element"][];
|
|
410
|
+
/** The display label of another element. */
|
|
411
|
+
readonly labelOf: (id: I["element"]) => string;
|
|
412
|
+
readonly classNames?: Partial<Record<DetailPanelPart, string>> | undefined;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* The details of one element: its status, the rule that decided it, what it is blocked by and what depends on it. The root is a complementary region named by the element's label; each list is a section carrying `data-section` with `blocked-by` or `impact`, shown only when it is not empty.
|
|
416
|
+
* @param props - The element, its explanation, blockers and impact.
|
|
417
|
+
* @returns The panel.
|
|
418
|
+
*/
|
|
419
|
+
declare const DetailPanel: <I extends IdSpace>(props: DetailPanelProps<I>) => ReactElement;
|
|
420
|
+
//#endregion
|
|
421
|
+
export { useWhyStatus as $, ElementFilter as A, useElementFilter as B, ruleDescriptions as C, SelectionContainerProps as D, GraphSelectionOptions as E, emptyFilter as F, BlockedChain as G, ViewsByNotation as H, filterElements as I, useBlockers as J, stepWeight as K, filterOptions as L, FilterOption as M, FilterOptions as N, SelectionItemProps as O, actorsOf as P, useStatuses as Q, matchesFilter as R, elementLabel as S, GraphSelection as T, project as U, ProjectedView as V, useProjection as W, useImpact as X, useCriticalPath as Y, useReadySet as Z, ElementCardPart as _, FilterPanelPart as a, StatusBadge as b, LegendPart as c, LanePart as d, ModelClient as et, LaneProps as f, ElementCard as g, TransitionItemProps as h, FilterPanel as i, noFacts as it, ElementFilterState as j, useGraphSelection as k, LegendProps as l, TransitionItemPart as m, DetailPanelPart as n, useModel as nt, FilterPanelProps as o, TransitionItem as p, useBlockedChain as q, DetailPanelProps as r, Run as rt, Legend as s, DetailPanel as t, ModelState as tt, Lane as u, ElementCardProps as v, statusLabels as w, StatusBadgeProps as x, NamedElement as y, sourceScope as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,111 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { A as UnsupportedConditionError, C as CriticalPath, D as UnknownReference, E as NodeId, F as Status, I as statuses, M as elementStatusKey, N as evaluateBranches, O as buildDag, P as Branch, S as loopTransitions, T as Dag, _ as StatusRule, a as criticalPath, b as controlDag, c as unmetOutputs, d as StatusExplanation, f as explainStatus, g as StatusBasis, h as ProducerBasis, i as blockedBy, j as artefactKey, k as Facts, l as whatIfDone, m as IncomingBasis, n as UnmetOutput, o as impact, p as ArtefactBasis, r as WhatIf, s as readySet, t as StatusChange, u as ChainLink, v as deriveStatuses, w as criticalPath$1, x as illegalCycles, y as statusRules } from "./index-CCfe0csl.js";
|
|
2
|
+
import { A as Views, B as messageModes, C as Extensions, D as Point, E as Participant, F as OverlayStatus, G as IdSpace, H as overlayStatuses, I as ParticipantKind, K as OpenIds, L as PseudoRole, M as FragmentOperator, N as MessageMode, O as Projection, P as Notation, R as elementKinds, S as EventDef, T as FragmentOperand, U as participantKinds, V as notations, W as pseudoRoles, _ as ModelParts, a as Overlay, b as ArtefactDef, c as overlaySchema, d as Issue, f as IssueCode, g as Model, h as outputsOf, i as modelSchema, j as ElementKind, k as Transition, l as parseOverlay, m as inputsOf, n as ModelParseError, o as OverlayIssue, p as validate, r as parseModel, s as OverlayParseError, t as ModelIssue, u as validateOverlay, v as defineModel, w as Fragment, x as Element, y as ActionDef, z as fragmentOperators } from "./index-CmZOswkx.js";
|
|
3
|
+
import { A as Flowchart, C as StateMachineTransition, D as toSwimlane, E as Swimlane, F as UnrepresentedElement, I as UnrepresentedKind, M as Handoff, N as handoffs, O as FlowEdge, P as Loss, S as StateMachineState, T as Lane, _ as SequenceItem, a as Addressing, b as toSequence, c as Ends, d as TransitionChange, f as TransitionFieldChange, g as SequenceDiagram, h as confirmChanges, i as diffSwimlane, j as toFlowchart, k as FlowNode, l as EventChange, m as applyModelDiff, n as diffStateMachine, o as Change, p as UnconfirmedChangeError, r as diffFlowchart, s as ElementChange, t as diffSequence, u as ModelDiff, v as SequenceMessage, w as toStateMachine, x as StateMachine, y as SequenceOperand } from "./index-CoA6vXqe.js";
|
|
4
|
+
//#region ../../core/graph/dag/dist/errors.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Thrown when an operation that is only defined on an acyclic graph is given one that contains a cycle.
|
|
7
|
+
*/
|
|
8
|
+
declare class CycleError<Id extends NodeId> extends Error {
|
|
9
|
+
/**
|
|
10
|
+
* One closed path per strongly connected component that contains a cycle, exactly as `findCycles` reports them.
|
|
11
|
+
*/
|
|
12
|
+
readonly cycles: readonly (readonly Id[])[];
|
|
13
|
+
/**
|
|
14
|
+
* @param cycles - The cycles found, as returned by `findCycles`. Must not be empty.
|
|
15
|
+
*/
|
|
16
|
+
constructor(cycles: readonly (readonly Id[])[]);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Thrown when an operation is asked about an id that is not a node of the graph it was given.
|
|
20
|
+
*/
|
|
21
|
+
declare class UnknownNodeError<Id extends NodeId> extends Error {
|
|
22
|
+
/**
|
|
23
|
+
* The id that is not a node of the graph.
|
|
24
|
+
*/
|
|
25
|
+
readonly id: Id;
|
|
26
|
+
/**
|
|
27
|
+
* @param id - The id that is not a node of the graph.
|
|
28
|
+
*/
|
|
29
|
+
constructor(id: Id);
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region ../../core/graph/dag/dist/layers.d.ts
|
|
33
|
+
/**
|
|
34
|
+
* The result of layering a graph by dependency depth.
|
|
35
|
+
*/
|
|
36
|
+
interface TopologicalLayers<Id extends NodeId> {
|
|
37
|
+
/** Each layered node's level: the length of the longest `needs` chain below it, so a node with no needs is 0 and every other node is one more than its highest-level need. */
|
|
38
|
+
readonly levels: ReadonlyMap<Id, number>;
|
|
39
|
+
/** Nodes grouped by level, index 0 first. Within a layer, nodes are in node order. Every node of a layer needs only nodes of earlier layers, and nothing in one layer needs anything in the same layer. */
|
|
40
|
+
readonly layers: readonly (readonly Id[])[];
|
|
41
|
+
/** The nodes that have no level because they lie on a cycle or transitively need a node that does, in node order. Empty exactly when the graph is acyclic. */
|
|
42
|
+
readonly unlayered: readonly Id[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Layers the graph by the longest `needs` chain below each node, so everything in one layer can run once the earlier layers are done.
|
|
46
|
+
*
|
|
47
|
+
* Defined on the acyclic part of the graph: a node on a cycle, or one that needs such a node directly or transitively, has no finite chain length and is reported in `unlayered` rather than being given a level. Every other node is layered exactly as in an acyclic graph. Unknown references are not edges and contribute nothing to a level. Iterative (Kahn's algorithm), so depth cannot overflow the call stack.
|
|
48
|
+
*/
|
|
49
|
+
declare function topologicalLayers<Id extends NodeId>(dag: Dag<Id>): TopologicalLayers<Id>;
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region ../../core/graph/dag/dist/reachability.d.ts
|
|
52
|
+
/**
|
|
53
|
+
* Every node `id` depends on, directly or through other nodes: the transitive closure of `needs` from `id`, in node order.
|
|
54
|
+
*
|
|
55
|
+
* `id` itself is included exactly when it lies on a cycle, since it then depends on itself. Unknown references are not edges. Iterative, so depth cannot overflow the call stack.
|
|
56
|
+
* @throws UnknownNodeError when `id` is not a node of the graph.
|
|
57
|
+
*/
|
|
58
|
+
declare function ancestorsOf<Id extends NodeId>(dag: Dag<Id>, id: Id): readonly Id[];
|
|
59
|
+
/**
|
|
60
|
+
* Every node that depends on `id`, directly or through other nodes: the transitive closure of the inverse of `needs` from `id`, in node order.
|
|
61
|
+
*
|
|
62
|
+
* `id` itself is included exactly when it lies on a cycle. Iterative, so depth cannot overflow the call stack.
|
|
63
|
+
* @throws UnknownNodeError when `id` is not a node of the graph.
|
|
64
|
+
*/
|
|
65
|
+
declare function descendantsOf<Id extends NodeId>(dag: Dag<Id>, id: Id): readonly Id[];
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region ../../core/graph/dag/dist/cycles.d.ts
|
|
68
|
+
/**
|
|
69
|
+
* Every strongly connected component of the graph: the maximal sets of nodes in which each node reaches every other along `needs` edges. Every node is in exactly one component, and a node on no cycle is a component of its own. Found by Tarjan's algorithm with an explicit stack, so depth is bounded by memory, not by the call stack, and each node and edge is visited once.
|
|
70
|
+
*
|
|
71
|
+
* A component lists its nodes in the order Tarjan's algorithm completes them, its root last. Components come out in reverse topological order of the condensed graph along `needs`: a component appears before every component that needs it. Since mutual reachability is symmetric, the components are the same whichever direction the edges are read in.
|
|
72
|
+
* @param dag - The graph to partition.
|
|
73
|
+
* @returns Every component, each a non-empty list of nodes.
|
|
74
|
+
*/
|
|
75
|
+
declare function stronglyConnectedComponents<Id extends NodeId>(dag: Dag<Id>): readonly (readonly Id[])[];
|
|
76
|
+
/**
|
|
77
|
+
* Reports every cycle in the graph: exactly one closed path per strongly connected component that contains a cycle (more than one node, or a node that needs itself).
|
|
78
|
+
*
|
|
79
|
+
* A path lists nodes such that each needs the next and the last needs the first, which is repeated at the end: `[a, b, c, a]` means a needs b, b needs c and c needs a. A self-loop is `[a, a]`. The path is a shortest cycle through the component's first node in node order, ties going to the earliest needs. Paths are ordered by the position of their first node. A component can contain more cycles than the one reported; removing the reported cycle's edges and calling again finds the rest.
|
|
80
|
+
*
|
|
81
|
+
* Returns an empty array exactly when the graph is acyclic. Iterative, so a deep graph cannot overflow the call stack.
|
|
82
|
+
*/
|
|
83
|
+
declare function findCycles<Id extends NodeId>(dag: Dag<Id>): readonly (readonly Id[])[];
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region ../../core/graph/dag/dist/dominators.d.ts
|
|
86
|
+
/**
|
|
87
|
+
* The immediate dominator of every node reachable from `root` along `needs` edges. A node `d` dominates `n` when every path from `root` to `n` passes through `d`; the immediate dominator is the dominator closest to `n` other than `n` itself. Read with `needs` edges pointing from a step to the steps before it and `root` a virtual end every last step needs, this gives post-dominators: where every way forward from a step meets again.
|
|
88
|
+
*
|
|
89
|
+
* Found by the Lengauer-Tarjan algorithm with path compression, so the work is the number of reachable nodes and edges times a slowly growing factor, and every walk uses an explicit stack, so depth is bounded by memory, not the call stack. Cycles are allowed.
|
|
90
|
+
* @param dag - The graph to read.
|
|
91
|
+
* @param root - Where every path starts.
|
|
92
|
+
* @returns Each node reachable from `root` other than `root`, mapped to its immediate dominator, in the order a depth-first walk from `root` first reaches the nodes. A node `root` does not reach has no entry.
|
|
93
|
+
* @throws UnknownNodeError when `root` is not a node of `dag`.
|
|
94
|
+
*/
|
|
95
|
+
declare function immediateDominators<Id extends NodeId>(dag: Dag<Id>, root: Id): ReadonlyMap<Id, Id>;
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region ../../core/graph/dag/dist/reduction.d.ts
|
|
98
|
+
/**
|
|
99
|
+
* The transitive reduction: the same nodes with every redundant edge removed, so a node keeps a direct need only when no other need of it already depends on that node, transitively.
|
|
100
|
+
*
|
|
101
|
+
* Defined for acyclic graphs, where it is unique and has exactly the same ancestors and descendants as the input. Each node's remaining needs keep the order they had. Unknown references are carried over unchanged; they are not edges and take no part in reduction.
|
|
102
|
+
*
|
|
103
|
+
* Builds each node's full set of ancestors, so memory grows with the size of the transitive closure.
|
|
104
|
+
* @throws CycleError when the graph contains a cycle: with one the reduction is not unique, so nothing is guessed.
|
|
105
|
+
*/
|
|
106
|
+
declare function transitiveReduction<Id extends NodeId>(dag: Dag<Id>): Dag<Id>;
|
|
107
|
+
declare namespace index_d_exports {
|
|
108
|
+
export { CriticalPath, CycleError, Dag, NodeId, TopologicalLayers, UnknownNodeError, UnknownReference, ancestorsOf, buildDag, criticalPath$1 as criticalPath, descendantsOf, findCycles, immediateDominators, stronglyConnectedComponents, topologicalLayers, transitiveReduction };
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
export { type ActionDef, type Addressing, type ArtefactBasis, type ArtefactDef, type Branch, type ChainLink, type Change, type Element, type ElementChange, type ElementKind, type Ends, type EventChange, type EventDef, type Extensions, type Facts, type FlowEdge, type FlowNode, type Flowchart, type Fragment, type FragmentOperand, type FragmentOperator, type Handoff, type IdSpace, type IncomingBasis, type Issue, type IssueCode, type Lane, type Loss, type MessageMode, type Model, type ModelDiff, type ModelIssue, ModelParseError, type ModelParts, type Notation, type OpenIds, type Overlay, type OverlayIssue, OverlayParseError, type OverlayStatus, type Participant, type ParticipantKind, type Point, type ProducerBasis, type Projection, type PseudoRole, type SequenceDiagram, type SequenceItem, type SequenceMessage, type SequenceOperand, type StateMachine, type StateMachineState, type StateMachineTransition, type Status, type StatusBasis, type StatusChange, type StatusExplanation, type StatusRule, type Swimlane, type Transition, type TransitionChange, type TransitionFieldChange, UnconfirmedChangeError, type UnmetOutput, type UnrepresentedElement, type UnrepresentedKind, UnsupportedConditionError, type Views, type WhatIf, applyModelDiff, artefactKey, blockedBy, confirmChanges, controlDag, criticalPath, index_d_exports as dag, defineModel, deriveStatuses, diffFlowchart, diffSequence, diffStateMachine, diffSwimlane, elementKinds, elementStatusKey, evaluateBranches, explainStatus, fragmentOperators, handoffs, illegalCycles, impact, inputsOf, loopTransitions, messageModes, modelSchema, notations, outputsOf, overlaySchema, overlayStatuses, parseModel, parseOverlay, participantKinds, pseudoRoles, readySet, statusRules, statuses, toFlowchart, toSequence, toStateMachine, toSwimlane, unmetOutputs, validate, validateOverlay, whatIfDone };
|