@momoi-labs/kiso-react 0.26.0 → 0.27.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.
@@ -1,6 +1,7 @@
1
1
  export type DiagramEdgeLine = "solid" | "dashed" | "dotted";
2
2
  export type DiagramEdgeTone = "neutral" | "success" | "danger";
3
3
  export type DiagramEdgeRoute = "side" | "down" | "drop";
4
+ export type DiagramEdgeSide = "top" | "right" | "bottom" | "left";
4
5
  export type DiagramCrossings = "none" | "hop" | "gap";
5
6
  export type DiagramLabels = "auto" | "horizontal" | "vertical";
6
7
  export type DiagramEdgeShape = "orthogonal" | "curve" | "straight" | "sketch";
@@ -19,6 +20,8 @@ export type EdgeSpec = EdgeLook & {
19
20
  to: string;
20
21
  label?: string;
21
22
  route?: DiagramEdgeRoute;
23
+ fromSide?: DiagramEdgeSide;
24
+ toSide?: DiagramEdgeSide;
22
25
  };
23
26
  export type Pt = [number, number];
24
27
  export type Box = {
@@ -48,7 +51,7 @@ type RouteLabel = {
48
51
  text: string;
49
52
  /** The segment the label belongs to. */
50
53
  run: number;
51
- /** Where along a horizontal run the label centres, 0 to 1. */
54
+ /** Where along its run the label centres, 0 to 1. */
52
55
  along?: number;
53
56
  /** Width a flat label may take before it stacks. */
54
57
  room?: number;
@@ -63,6 +66,7 @@ export type Route = {
63
66
  ends?: [string, string];
64
67
  label?: RouteLabel;
65
68
  dot?: Pt;
69
+ pinned?: boolean;
66
70
  };
67
71
  export type Rect = {
68
72
  key: string;
@@ -103,11 +107,13 @@ export declare const RADIUS = 8;
103
107
  export declare const TRACK = 6;
104
108
  export declare const look: (edge: EdgeSpec) => EdgeLook;
105
109
  export type DiagramFlow = "right" | "down" | "grid";
106
- export declare function route(measured: Measured[], nodes: Box[], flow: DiagramFlow, frames?: Box[]): Route[];
110
+ export declare function anchorOf(box: Box, side: DiagramEdgeSide): Pt;
111
+ export declare function route(measured: Measured[], nodes: Box[], flow: DiagramFlow, frames?: Box[], titles?: Box[]): Route[];
107
112
  export type DrawStyle = {
108
113
  shape?: DiagramEdgeShape;
109
114
  arrow?: DiagramArrow;
110
115
  boxes?: Map<string, Box>;
116
+ blocks?: Box[];
111
117
  };
112
118
  export declare function draw(routes: Route[], frames: Frame[], crossings: DiagramCrossings, labels: DiagramLabels, measure: (text: string) => {
113
119
  width: number;