@cloudflare/kumo 2.7.0 → 2.8.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.
Files changed (62) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/ai/component-registry.json +1164 -149
  3. package/ai/component-registry.md +1325 -114
  4. package/ai/schemas.ts +136 -7
  5. package/dist/.build-complete +1 -1
  6. package/dist/ai/schemas.d.ts +259 -22
  7. package/dist/ai/schemas.d.ts.map +1 -1
  8. package/dist/ai/schemas.js +1515 -1298
  9. package/dist/ai/schemas.js.map +1 -1
  10. package/dist/chunks/Maps-imwfwgb7do9lr3i5.js +2448 -0
  11. package/dist/chunks/Maps-imwfwgb7do9lr3i5.js.map +1 -0
  12. package/dist/chunks/input-area-sg518xu4pyg4m0km.js +144 -0
  13. package/dist/chunks/input-area-sg518xu4pyg4m0km.js.map +1 -0
  14. package/dist/chunks/{sidebar-ctd980heycmxsux1.js → sidebar-7whsl7qwrw5b6ip8.js} +306 -306
  15. package/dist/chunks/sidebar-7whsl7qwrw5b6ip8.js.map +1 -0
  16. package/dist/components/chart.js +1 -1
  17. package/dist/components/flow.js +2306 -2350
  18. package/dist/components/flow.js.map +1 -1
  19. package/dist/components/input.js +1 -1
  20. package/dist/components/sidebar.js +1 -1
  21. package/dist/index.js +3 -3
  22. package/dist/src/components/chart/TimeseriesChart.d.ts +8 -0
  23. package/dist/src/components/chart/TimeseriesChart.d.ts.map +1 -1
  24. package/dist/src/components/chart/index.d.ts +1 -1
  25. package/dist/src/components/chart/index.d.ts.map +1 -1
  26. package/dist/src/components/chart/timeseries-markers.d.ts +107 -0
  27. package/dist/src/components/chart/timeseries-markers.d.ts.map +1 -0
  28. package/dist/src/components/chart/timeseries-thresholds.d.ts +61 -0
  29. package/dist/src/components/chart/timeseries-thresholds.d.ts.map +1 -0
  30. package/dist/src/components/chart/timeseries-tooltip.d.ts +28 -0
  31. package/dist/src/components/chart/timeseries-tooltip.d.ts.map +1 -0
  32. package/dist/src/components/flow/connectors.d.ts +18 -0
  33. package/dist/src/components/flow/connectors.d.ts.map +1 -1
  34. package/dist/src/components/flow/diagram.d.ts +48 -41
  35. package/dist/src/components/flow/diagram.d.ts.map +1 -1
  36. package/dist/src/components/flow/flow-layout.d.ts +77 -0
  37. package/dist/src/components/flow/flow-layout.d.ts.map +1 -0
  38. package/dist/src/components/flow/node.d.ts.map +1 -1
  39. package/dist/src/components/flow/parallel.d.ts +3 -7
  40. package/dist/src/components/flow/parallel.d.ts.map +1 -1
  41. package/dist/src/components/flow/use-children.d.ts +0 -60
  42. package/dist/src/components/flow/use-children.d.ts.map +1 -1
  43. package/dist/src/components/input/input-area.d.ts +18 -0
  44. package/dist/src/components/input/input-area.d.ts.map +1 -1
  45. package/dist/src/components/sidebar/sidebar.d.ts +2 -0
  46. package/dist/src/components/sidebar/sidebar.d.ts.map +1 -1
  47. package/dist/src/primitives/index.d.ts +1 -1
  48. package/dist/src/primitives/index.d.ts.map +1 -1
  49. package/dist/src/primitives/otp-field.d.ts +1 -1
  50. package/dist/src/primitives/otp-field.d.ts.map +1 -1
  51. package/dist/styles/kumo-standalone.css +1 -1
  52. package/package.json +1 -1
  53. package/scripts/component-registry/discovery.ts +87 -0
  54. package/scripts/component-registry/index.test.ts +89 -1
  55. package/scripts/component-registry/index.ts +27 -2
  56. package/scripts/component-registry/sub-components.ts +34 -21
  57. package/scripts/generate-primitives.ts +1 -1
  58. package/dist/chunks/Maps-fkiyllhs5w0qzw1y.js +0 -2155
  59. package/dist/chunks/Maps-fkiyllhs5w0qzw1y.js.map +0 -1
  60. package/dist/chunks/input-area-ixtj4e8eny58nbf9.js +0 -78
  61. package/dist/chunks/input-area-ixtj4e8eny58nbf9.js.map +0 -1
  62. package/dist/chunks/sidebar-ctd980heycmxsux1.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { I as t, i as I } from "../chunks/input-ckl5misj0jd9cu5r.js";
3
- import { I as e, T as p } from "../chunks/input-area-ixtj4e8eny58nbf9.js";
3
+ import { I as e, T as p } from "../chunks/input-area-sg518xu4pyg4m0km.js";
4
4
  import { I as T, a as U, K as _ } from "../chunks/input-group-bflx1m6ki55e99vf.js";
5
5
  export {
6
6
  t as Input,
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { z as i, A as r, K as S, S as s, t as b, v as d, u as n, d as o, e as u, f as l, g as t, c as M, h as A, k as g, j as p, s as I, i as R, l as _, n as B, m as C, a as T, q as m, r as D, b as E, o as K, x as U, w as V, p as v, y as w } from "../chunks/sidebar-ctd980heycmxsux1.js";
2
+ import { z as i, A as r, K as S, S as s, t as b, v as d, u as n, d as o, e as u, f as l, g as t, c as M, h as A, k as g, j as p, s as I, i as R, l as _, n as B, m as C, a as T, q as m, r as D, b as E, o as K, x as U, w as V, p as v, y as w } from "../chunks/sidebar-7whsl7qwrw5b6ip8.js";
3
3
  export {
4
4
  i as KUMO_SIDEBAR_DEFAULT_VARIANTS,
5
5
  r as KUMO_SIDEBAR_STYLING,
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ import { F as Ea, a as Ma, K as Ua, f as Na } from "./chunks/field-bmglk138wa8bf
18
18
  import { b as ga, K as ha, L as Va, a as Da, l as Ba } from "./chunks/label-i1xbmg8y1n0tbtkx.js";
19
19
  import { I as K } from "./chunks/input-ckl5misj0jd9cu5r.js";
20
20
  import { i as Pa } from "./chunks/input-ckl5misj0jd9cu5r.js";
21
- import { I as Fa, T as ya } from "./chunks/input-area-ixtj4e8eny58nbf9.js";
21
+ import { I as Fa, T as ya } from "./chunks/input-area-sg518xu4pyg4m0km.js";
22
22
  import { I as za } from "./chunks/input-group-bflx1m6ki55e99vf.js";
23
23
  import { L as ja } from "./chunks/layer-card-m6h85dpadvee39h2.js";
24
24
  import { L as qa } from "./chunks/loader-g8a6j76ue5nq0lr8.js";
@@ -45,9 +45,9 @@ import { G as Ye, a as Je, c as Qe, K as Ze, b as ao, g as eo } from "./chunks/g
45
45
  import { C as ro, a as so, K as to, P as io, g as lo } from "./chunks/cloudflare-logo-fiuocxdxqrxawjfv.js";
46
46
  import { D as mo } from "./chunks/date-picker-bffp889exjixmgz3.js";
47
47
  import { Flow as fo } from "./components/flow.js";
48
- import { B as Ao, C as co, a as bo, c as So, b as _o, S as uo, T as xo } from "./chunks/Maps-fkiyllhs5w0qzw1y.js";
48
+ import { B as Ao, C as co, a as bo, c as So, b as _o, S as uo, T as xo } from "./chunks/Maps-imwfwgb7do9lr3i5.js";
49
49
  import { A as Io, b as Lo, K as Oo, a as Ro } from "./chunks/autocomplete-a4gvspveibfuod24.js";
50
- import { z as Mo, A as Uo, K as No, S as Ko, t as go, v as ho, u as Vo, d as Do, e as Bo, f as vo, g as Po, c as ko, h as Fo, k as yo, j as wo, s as zo, i as Go, l as jo, n as $o, m as qo, a as Ho, q as Wo, r as Xo, b as Yo, o as Jo, x as Qo, w as Zo, p as ar, y as er } from "./chunks/sidebar-ctd980heycmxsux1.js";
50
+ import { z as Mo, A as Uo, K as No, S as Ko, t as go, v as ho, u as Vo, d as Do, e as Bo, f as vo, g as Po, c as ko, h as Fo, k as yo, j as wo, s as zo, i as Go, l as jo, n as $o, m as qo, a as Ho, q as Wo, r as Xo, b as Yo, o as Jo, x as Qo, w as Zo, p as ar, y as er } from "./chunks/sidebar-7whsl7qwrw5b6ip8.js";
51
51
  import { a as rr, K as sr, T as tr } from "./chunks/table-of-contents-cghjqyk43nj5zmlw.js";
52
52
  import { s as lr } from "./chunks/cn-bo7ya7641lkickbt.js";
53
53
  import { L as dr, u as mr } from "./chunks/link-provider-mn2voeohon7cj9o4.js";
@@ -1,5 +1,9 @@
1
1
  import { SetOptionOpts } from 'echarts';
2
+ import { TimeseriesMarker } from './timeseries-markers';
3
+ import { TimeseriesThreshold } from './timeseries-thresholds';
2
4
  import type * as echarts from "echarts/core";
5
+ export type { TimeseriesMarker } from './timeseries-markers';
6
+ export type { TimeseriesThreshold } from './timeseries-thresholds';
3
7
  /** A single data series rendered on a `TimeseriesChart` */
4
8
  export interface TimeseriesData {
5
9
  /** Display name shown in tooltips and legends */
@@ -21,6 +25,10 @@ export interface TimeseriesChartProps {
21
25
  type?: "line" | "bar";
22
26
  /** Array of time series data to display on the chart */
23
27
  data: TimeseriesData[];
28
+ /** Vertical reference markers rendered on the time axis. */
29
+ markers?: TimeseriesMarker[];
30
+ /** Horizontal threshold lines rendered on the value axis. */
31
+ thresholds?: TimeseriesThreshold[];
24
32
  /** Label for the x-axis (time axis) */
25
33
  xAxisName?: string;
26
34
  /** Number of ticks to display on the x-axis */
@@ -1 +1 @@
1
- {"version":3,"file":"TimeseriesChart.d.ts","sourceRoot":"","sources":["../../../../src/components/chart/TimeseriesChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,cAAc,CAAC;AAE7C,OAAO,KAAK,EAA+B,aAAa,EAAE,MAAM,SAAS,CAAC;AAa1E,2DAA2D;AAC3D,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACzB,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;CACf;AAED,kCAAkC;AAClC,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACtB,wDAAwD;IACxD,IAAI,EAAE,cAAc,EAAE,CAAC;IACvB,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CA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eAAO,MAAM,eAAe,yHA2f1B,CAAC"}
@@ -1,4 +1,4 @@
1
- export { TimeseriesChart, type TimeseriesChartProps, type TimeseriesData, } from './TimeseriesChart';
1
+ export { TimeseriesChart, type TimeseriesChartProps, type TimeseriesData, type TimeseriesMarker, type TimeseriesThreshold, } from './TimeseriesChart';
2
2
  export { Chart, type ChartEvents, type ChartProps, type KumoChartOption, } from './EChart';
3
3
  export { ChartLegend } from './Legend';
4
4
  export { SankeyChart, type SankeyChartProps, type SankeyNodeData, type SankeyLinkData, type SankeyTooltipParams, } from './SankeyChart';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/chart/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,cAAc,GACpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,KAAK,EACL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,eAAe,GACrB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,aAAa,EACb,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,kBAAkB,GACxB,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/chart/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,KAAK,EACL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,eAAe,GACrB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,aAAa,EACb,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,kBAAkB,GACxB,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,107 @@
1
+ export interface TimeseriesMarker {
2
+ /** Unix timestamp in milliseconds. */
3
+ timestamp: number;
4
+ /** Short label shown on/near the marker. */
5
+ label?: string;
6
+ /** Optional longer tooltip/body text. */
7
+ description?: string;
8
+ /** Optional marker color. Defaults to a neutral/subtle chart color. */
9
+ color?: string;
10
+ /** Optional line style. Defaults to dashed. */
11
+ lineStyle?: "solid" | "dashed" | "dotted";
12
+ }
13
+ export interface TimeseriesMarkerCluster {
14
+ timestamp: number;
15
+ label?: string;
16
+ color?: string;
17
+ lineStyle?: TimeseriesMarker["lineStyle"];
18
+ markers: TimeseriesMarker[];
19
+ }
20
+ export interface TimeseriesMarkerAnnotationStyle {
21
+ color: string;
22
+ labelBackgroundColor: string;
23
+ }
24
+ export declare function buildTimeseriesMarkerAnnotations(clusters: TimeseriesMarkerCluster[], style: TimeseriesMarkerAnnotationStyle): {
25
+ markLine: {
26
+ symbol: "none";
27
+ silent: boolean;
28
+ animation: boolean;
29
+ z: number;
30
+ lineStyle: {
31
+ type: "dashed";
32
+ color: string;
33
+ width: number;
34
+ };
35
+ emphasis: {
36
+ lineStyle: {
37
+ width: number;
38
+ };
39
+ };
40
+ blur: {
41
+ lineStyle: {
42
+ opacity: number;
43
+ };
44
+ label: {
45
+ opacity: number;
46
+ };
47
+ };
48
+ label: {
49
+ backgroundColor: string;
50
+ padding: number[];
51
+ borderRadius: number;
52
+ shadowBlur: number;
53
+ shadowColor: string;
54
+ show: boolean;
55
+ formatter: (params: {
56
+ name?: string;
57
+ }) => string;
58
+ position: "insideEndTop";
59
+ color: string;
60
+ };
61
+ data: {
62
+ name: string | undefined;
63
+ xAxis: number;
64
+ lineStyle: {
65
+ type: "dashed" | "dotted" | "solid";
66
+ color: string;
67
+ width: number;
68
+ };
69
+ emphasis: {
70
+ lineStyle: {
71
+ width: number;
72
+ };
73
+ };
74
+ blur: {
75
+ lineStyle: {
76
+ opacity: number;
77
+ };
78
+ label: {
79
+ opacity: number;
80
+ };
81
+ };
82
+ label: {
83
+ backgroundColor: string;
84
+ padding: number[];
85
+ borderRadius: number;
86
+ shadowBlur: number;
87
+ shadowColor: string;
88
+ show: boolean;
89
+ color: string;
90
+ };
91
+ tooltip: {
92
+ marker: TimeseriesMarkerCluster;
93
+ };
94
+ }[];
95
+ };
96
+ } | undefined;
97
+ export declare function clusterTimeseriesMarkers(markers: TimeseriesMarker[] | undefined, interval: number): TimeseriesMarkerCluster[];
98
+ export declare function getApproximateMarkerClusterInterval(timestamps: number[], tickCount: number): number;
99
+ export declare function getTimeseriesMarkerFromEvent(params: {
100
+ componentType?: string;
101
+ data?: {
102
+ tooltip?: {
103
+ marker?: TimeseriesMarkerCluster;
104
+ };
105
+ };
106
+ }): TimeseriesMarkerCluster | undefined;
107
+ //# sourceMappingURL=timeseries-markers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeseries-markers.d.ts","sourceRoot":"","sources":["../../../../src/components/chart/timeseries-markers.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCA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is rendered. */
3
+ value: number;
4
+ /** Optional label shown on/near the threshold line. */
5
+ label?: string;
6
+ /** Threshold line and label color. */
7
+ color: string;
8
+ }
9
+ export declare function buildTimeseriesThresholdAnnotations(thresholds: TimeseriesThreshold[] | undefined): {
10
+ markLine: {
11
+ symbol: "none";
12
+ silent: boolean;
13
+ animation: boolean;
14
+ z: number;
15
+ lineStyle: {
16
+ type: "dashed";
17
+ width: number;
18
+ };
19
+ blur: {
20
+ lineStyle: {
21
+ opacity: number;
22
+ };
23
+ label: {
24
+ opacity: number;
25
+ };
26
+ };
27
+ label: {
28
+ show: boolean;
29
+ position: "insideEndTop";
30
+ formatter: (params: {
31
+ name?: string;
32
+ }) => string;
33
+ };
34
+ data: {
35
+ name: string | undefined;
36
+ yAxis: number;
37
+ lineStyle: {
38
+ color: string;
39
+ width: number;
40
+ type: "dashed";
41
+ };
42
+ blur: {
43
+ lineStyle: {
44
+ opacity: number;
45
+ };
46
+ label: {
47
+ opacity: number;
48
+ };
49
+ };
50
+ label: {
51
+ show: boolean;
52
+ color: string;
53
+ };
54
+ }[];
55
+ };
56
+ } | undefined;
57
+ export declare function getThresholdValueExtent(thresholds: TimeseriesThreshold[] | undefined): {
58
+ min: number;
59
+ max: number;
60
+ } | undefined;
61
+ //# sourceMappingURL=timeseries-thresholds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeseries-thresholds.d.ts","sourceRoot":"","sources":["../../../../src/components/chart/timeseries-thresholds.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,mCAAmC,CACjD,UAAU,EAAE,mBAAmB,EAAE,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;gCAqBnB;gBAAE,IAAI,CAAC,EAAE,MAAM,CAAA;aAAE;;;;;;;;;;;;;;;;;;;;;;;;cAqB5C;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,mBAAmB,EAAE,GAAG,SAAS,GAC5C;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAQ1C"}
@@ -0,0 +1,28 @@
1
+ import { TimeseriesMarker } from './timeseries-markers';
2
+ export interface TooltipRow {
3
+ name: string;
4
+ value: number;
5
+ color: string;
6
+ }
7
+ export interface SeriesTooltipState {
8
+ type: "series";
9
+ ts: number;
10
+ rows: TooltipRow[];
11
+ hiddenCount: number;
12
+ }
13
+ export interface MarkerTooltipState {
14
+ type: "marker";
15
+ ts: number;
16
+ color: string;
17
+ markers: TimeseriesMarker[];
18
+ rows: TooltipRow[];
19
+ hiddenCount: number;
20
+ }
21
+ export type TooltipState = SeriesTooltipState | MarkerTooltipState;
22
+ export interface TooltipContentProps {
23
+ state: TooltipState;
24
+ formatValue?: (v: number) => string;
25
+ formatTimestamp: (ts: number | string | Date) => string;
26
+ }
27
+ export declare const TooltipContent: import('react').NamedExoticComponent<TooltipContentProps>;
28
+ //# sourceMappingURL=timeseries-tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeseries-tooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/chart/timeseries-tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAEnE,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,YAAY,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,KAAK,MAAM,CAAC;CACzD;AAED,eAAO,MAAM,cAAc,2DA2BzB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import { Edges, FlowOrientation, FlowState, NodePositions } from './flow-layout';
2
3
  export interface Connector {
3
4
  x1: number;
4
5
  y1: number;
@@ -26,6 +27,23 @@ export declare function createRoundedPath({ x1, y1, x2, y2 }: {
26
27
  x2: number;
27
28
  y2: number;
28
29
  }, { cornerRadius: maxCornerRadius, midOffset, arrowheadOffset, isBottom, single, orientation, }?: PathProps): string;
30
+ type FlowConnectorsProps = {
31
+ edges: Edges;
32
+ nodePositions: NodePositions;
33
+ nodes: FlowState["nodes"];
34
+ orientation: FlowOrientation;
35
+ };
36
+ /**
37
+ * Draws every edge in the flow using only computed positions and measured
38
+ * node sizes — no DOM rect lookups needed.
39
+ *
40
+ * Horizontal edges connect source right-center to target left-center.
41
+ * Vertical edges connect source bottom-center to target top-center.
42
+ *
43
+ * Intended to be rendered once at the top-level Flow component, absolutely
44
+ * positioned to overlay the entire diagram.
45
+ */
46
+ export declare function FlowConnectors({ edges, nodePositions, nodes, orientation, }: FlowConnectorsProps): import("react/jsx-runtime").JSX.Element;
29
47
  export declare const Connectors: import('react').ForwardRefExoticComponent<{
30
48
  connectors: Connector[];
31
49
  children?: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"connectors.d.ts","sourceRoot":"","sources":["../../../../src/components/flow/connectors.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1D,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAOD,KAAK,SAAS,GAAG,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,UAAU,GAAG,YAAY,CAAC;CACxC,CAAC,CAAC;AASH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EACtE,EACE,YAAY,EAAE,eAAmB,EACjC,SAAc,EACd,eAAmB,EACnB,QAAgB,EAChB,MAAc,EACd,WAAwB,GACzB,GAAE,SAAc,UAyGlB;AAED,eAAO,MAAM,UAAU;gBAxIT,SAAS,EAAE;eACZ,SAAS;;kBAIN,MAAM;eACT,MAAM;qBACA,MAAM;cACb,OAAO;YACT,OAAO;iBACF,UAAU,GAAG,YAAY;0EAiMvC,CAAC"}
1
+ {"version":3,"file":"connectors.d.ts","sourceRoot":"","sources":["../../../../src/components/flow/connectors.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EACV,KAAK,EACL,eAAe,EACf,SAAS,EACT,aAAa,EACd,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAOD,KAAK,SAAS,GAAG,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,UAAU,GAAG,YAAY,CAAC;CACxC,CAAC,CAAC;AASH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EACtE,EACE,YAAY,EAAE,eAAmB,EACjC,SAAc,EACd,eAAmB,EACnB,QAAgB,EAChB,MAAc,EACd,WAAwB,GACzB,GAAE,SAAc,UA6GlB;AAMD,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC1B,WAAW,EAAE,eAAe,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,aAAa,EACb,KAAK,EACL,WAAW,GACZ,EAAE,mBAAmB,2CAuCrB;AAED,eAAO,MAAM,UAAU;gBA/MT,SAAS,EAAE;eACZ,SAAS;;kBAIN,MAAM;eACT,MAAM;qBACA,MAAM;cACb,OAAO;YACT,OAAO;iBACF,UAAU,GAAG,YAAY;0EAwQvC,CAAC"}
@@ -1,33 +1,27 @@
1
1
  import { ReactNode } from 'react';
2
- import { MotionValue } from 'motion/react';
3
2
  import { DescendantInfo } from './use-children';
4
- type Orientation = "horizontal" | "vertical";
5
- type Align = "start" | "center";
6
- interface DiagramContextValue {
7
- orientation: Orientation;
8
- align: Align;
9
- x: MotionValue<number>;
10
- y: MotionValue<number>;
11
- /** Ref to the canvas viewport wrapper element */
12
- wrapperRef: React.RefObject<HTMLDivElement | null>;
13
- }
14
- export declare function useDiagramContext(): DiagramContextValue;
3
+ import { FlowAlign, FlowOrientation, FlowState, TreeNode } from './flow-layout';
4
+ export type { FlowAlign, FlowOrientation, FlowState, TreeNode };
5
+ type Orientation = FlowOrientation;
15
6
  interface FlowDiagramProps {
16
- orientation?: Orientation;
17
7
  /**
18
- * Controls cross-axis alignment of nodes.
19
- * In horizontal orientation this is vertical alignment; in vertical
20
- * orientation it is horizontal alignment.
21
- * - `start`: Nodes align to the start of the cross axis (default)
22
- * - `center`: Nodes are centered on the cross axis
8
+ * Flow direction.
9
+ * - `"horizontal"`: Nodes progress left-to-right (default)
10
+ * - `"vertical"`: Nodes progress top-to-bottom
23
11
  */
24
- align?: Align;
12
+ orientation?: Orientation;
25
13
  /**
26
14
  * Whether to render the pannable canvas wrapper.
27
15
  * - `true`: Renders with pannable canvas, scrollbars, and pan gestures (default)
28
16
  * - `false`: Renders only the node list without canvas wrapper
29
17
  */
30
18
  canvas?: boolean;
19
+ /**
20
+ * Cross-axis alignment of nodes.
21
+ * - `"start"`: Nodes align to the top/left edge (default)
22
+ * - `"center"`: Nodes are centered across the inactive axis
23
+ */
24
+ align?: FlowAlign;
31
25
  /**
32
26
  * Padding around the diagram content within the canvas.
33
27
  * - `x`: Horizontal padding in pixels (default: 16)
@@ -48,37 +42,54 @@ interface FlowDiagramProps {
48
42
  className?: string;
49
43
  children?: ReactNode;
50
44
  }
51
- export declare function FlowDiagram({ orientation, align, canvas, padding: requestedPadding, onOverflowChange, className, children, }: FlowDiagramProps): import("react/jsx-runtime").JSX.Element;
52
- export type RectLike = {
53
- x: number;
54
- y: number;
55
- top: number;
56
- left: number;
57
- right: number;
58
- bottom: number;
59
- width: number;
60
- height: number;
61
- };
45
+ export declare function FlowDiagram({ orientation, canvas, align, padding: requestedPadding, onOverflowChange, className, children, }: FlowDiagramProps): import("react/jsx-runtime").JSX.Element;
62
46
  export type NodeData = {
63
- parallel?: boolean;
47
+ kind: "node";
64
48
  disabled?: boolean;
65
- start?: RectLike | null;
66
- end?: RectLike | null;
49
+ } | {
50
+ kind: "parallel";
51
+ disabled?: boolean;
52
+ children: string[];
53
+ align?: "end";
54
+ } | {
55
+ kind: "list";
56
+ disabled?: boolean;
57
+ children: string[];
58
+ };
59
+ type FlowStateContextValue = {
60
+ reportNode: (id: string, props: {
61
+ width: number;
62
+ height: number;
63
+ disabled?: boolean;
64
+ startAnchorOffset?: number;
65
+ endAnchorOffset?: number;
66
+ }) => void;
67
+ removeNode: (id: string) => void;
68
+ /**
69
+ * Report immediate descendants from a list/parallel node.
70
+ * Pass `null` as `id` for the root FlowNodeList.
71
+ */
72
+ reportDescendants: (id: string | null, descendants: DescendantInfo<NodeData>[]) => void;
73
+ orientation: Orientation;
74
+ /** Derived node positions (computed synchronously from FlowState). */
75
+ nodePositions: Record<string, {
76
+ x: number;
77
+ y: number;
78
+ }>;
79
+ /** Derived edges (computed synchronously from FlowState). */
80
+ edges: [string, string][];
67
81
  };
82
+ export declare function useFlowStateContext(): FlowStateContextValue;
68
83
  export declare const useNodeGroup: () => {
69
84
  register: (id: string, renderOrder: number, props?: NodeData | undefined) => {
70
85
  unregister: () => void;
71
86
  };
72
87
  descendants: DescendantInfo<NodeData>[];
73
88
  claimRenderOrder: (id: string) => number;
74
- measurementEpoch: number;
75
- notifySizeChange: () => void;
76
89
  };
77
90
  export declare const useNode: (props: NodeData, id?: string) => {
78
91
  index: number;
79
92
  id: string;
80
- getPrevious: () => DescendantInfo<NodeData> | undefined;
81
- getNext: () => DescendantInfo<NodeData> | undefined;
82
93
  };
83
94
  /**
84
95
  * Hook to optionally register as a node if within a parent descendants context.
@@ -88,11 +99,7 @@ export declare const useOptionalNode: (props: NodeData) => {
88
99
  index: number;
89
100
  id: string;
90
101
  } | null;
91
- export declare const getNodeRect: (node: DescendantInfo<NodeData> | undefined, { type }: {
92
- type?: "start" | "end";
93
- }) => RectLike | null;
94
102
  export declare function FlowNodeList({ children }: {
95
103
  children: ReactNode;
96
104
  }): import("react/jsx-runtime").JSX.Element;
97
- export {};
98
105
  //# sourceMappingURL=diagram.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"diagram.d.ts","sourceRoot":"","sources":["../../../../src/components/flow/diagram.tsx"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAKL,KAAK,WAAW,EAEjB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAcxB,KAAK,WAAW,GAAG,YAAY,GAAG,UAAU,CAAC;AAC7C,KAAK,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEhC,UAAU,mBAAmB;IAC3B,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,CAAC,EAAE,WAAW,C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G,IAAI,EACjB,WAAW,EAAE,cAAc,CAAC,QAAQ,CAAC,EAAE,KACpC,IAAI,CAAC;IACV,WAAW,EAAE,WAAW,CAAC;IACzB,sEAAsE;IACtE,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD,6DAA6D;IAC7D,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CAC3B,CAAC;AAIF,wBAAgB,mBAAmB,IAAI,qBAAqB,CAM3D;AAED,eAAO,MAAM,YAAY;;;;;;CAAmC,CAAC;AAE7D,eAAO,MAAM,OAAO,GAAI,OAAO,QAAQ,EAAE,KAAK,MAAM;;;CACX,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,QAAQ;;;QA0C9C,CAAC;AAkCF,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CA+CjE"}
@@ -0,0 +1,77 @@
1
+ export type TreeNode = {
2
+ kind: "list";
3
+ children: TreeNode[];
4
+ } | {
5
+ kind: "parallel";
6
+ children: TreeNode[];
7
+ align?: "end";
8
+ } | {
9
+ kind: "node";
10
+ id: string;
11
+ };
12
+ export type FlowAlign = "start" | "center";
13
+ export type FlowOrientation = "horizontal" | "vertical";
14
+ export type FlowState = {
15
+ nodes: {
16
+ [id: string]: {
17
+ width: number;
18
+ height: number;
19
+ disabled?: boolean;
20
+ /** Y offset from the node's top edge to the outgoing anchor's midpoint. */
21
+ startAnchorOffset?: number;
22
+ /** Y offset from the node's top edge to the incoming anchor's midpoint. */
23
+ endAnchorOffset?: number;
24
+ };
25
+ };
26
+ tree: TreeNode;
27
+ align: FlowAlign;
28
+ orientation: FlowOrientation;
29
+ };
30
+ export type Edges = [string, string][];
31
+ export type NodePositions = Record<string, {
32
+ x: number;
33
+ y: number;
34
+ }>;
35
+ export type DiagramRect = {
36
+ width: number;
37
+ height: number;
38
+ };
39
+ /**
40
+ * Computes edges between flow nodes from the tree stored in FlowState.
41
+ *
42
+ * Rules (from spec):
43
+ * 1. Adjacent `node` entries in a list are connected directly.
44
+ * 2. A `node` adjacent to a `parallel` group connects to all of that group's
45
+ * immediate entry/exit points.
46
+ * 3. Adjacent `parallel` groups are NOT connected to one another.
47
+ * 4. A `list` group connects externally to its first and last node only.
48
+ *
49
+ * The function is pure — it does not access the DOM and has no side effects.
50
+ */
51
+ export declare function computeEdges(flowState: FlowState): Edges;
52
+ /**
53
+ * Computes pixel positions for every node in the flow.
54
+ *
55
+ * - Horizontal flows lay lists left-to-right and parallel branches top-to-bottom.
56
+ * - Vertical flows lay lists top-to-bottom and parallel branches left-to-right.
57
+ * - `columnGap` controls primary-axis list spacing; `rowGap` controls branch spacing.
58
+ *
59
+ * Returns a map of node ID → `{ x, y }` (top-left corner, relative to the
60
+ * flow container origin).
61
+ *
62
+ * This function is pure — it does not access the DOM.
63
+ */
64
+ export declare function computePositions(flowState: FlowState, { columnGap, rowGap }?: {
65
+ columnGap?: number | undefined;
66
+ rowGap?: number | undefined;
67
+ }): NodePositions;
68
+ /**
69
+ * Returns the bounding rectangle of the entire diagram.
70
+ *
71
+ * - `width` = x of the rightmost node's left edge + that node's width
72
+ * - `height` = y of the bottommost node's top edge + that node's height
73
+ *
74
+ * This function is pure — it does not access the DOM.
75
+ */
76
+ export declare function computeDiagramRect(positions: NodePositions, flowState: FlowState): DiagramRect;
77
+ //# sourceMappingURL=flow-layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-layout.d.ts","sourceRoot":"","sources":["../../../../src/components/flow/flow-layout.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,QAAQ,GAChB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,QAAQ,EAAE,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC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BAAgB,kBAAkB,CAChC,SAAS,EAAE,aAAa,EACxB,SAAS,EAAE,SAAS,GACnB,WAAW,CAYb"}
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../src/components/flow/node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAYL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAmBf;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,QAAQ,uGA0JpB,CAAC;AAaF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,UAAU,yGA6CtB,CAAC"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../src/components/flow/node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAoBf;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,QAAQ,uGA4HpB,CAAC;AAmBF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,UAAU,yGAqCtB,CAAC"}
@@ -1,13 +1,9 @@
1
1
  import { ReactNode } from 'react';
2
2
  type FlowParallelNodeProps = {
3
3
  children: ReactNode;
4
- /**
5
- * Controls alignment of nodes within the parallel group.
6
- * - `start`: Nodes align to the left (default)
7
- * - `end`: Nodes align to the right
8
- */
9
- align?: "start" | "end";
4
+ /** When "end", each branch is right-aligned to the widest branch. */
5
+ align?: "end";
10
6
  };
11
- export declare function FlowParallelNode({ children, align, }: FlowParallelNodeProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function FlowParallelNode({ children, align }: FlowParallelNodeProps): import("react/jsx-runtime").JSX.Element;
12
8
  export {};
13
9
  //# sourceMappingURL=parallel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parallel.d.ts","sourceRoot":"","sources":["../../../../src/components/flow/parallel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AA0Df,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;CACzB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,KAAe,GAChB,EAAE,qBAAqB,2CAwXvB"}
1
+ {"version":3,"file":"parallel.d.ts","sourceRoot":"","sources":["../../../../src/components/flow/parallel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI3D,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,qEAAqE;IACrE,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,qBAAqB,2CAsC1E"}