@next-bricks/diagram 0.39.0 → 0.40.1
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/dist/bricks.json +5 -5
- package/dist/chunks/1868.cb80ce04.js +2 -0
- package/dist/chunks/1868.cb80ce04.js.map +1 -0
- package/dist/chunks/{2443.3cd60e77.js → 2443.c1da1160.js} +3 -3
- package/dist/chunks/2443.c1da1160.js.map +1 -0
- package/dist/chunks/{eo-display-canvas.d0016b00.js → eo-display-canvas.6e791d99.js} +2 -2
- package/dist/chunks/eo-display-canvas.6e791d99.js.map +1 -0
- package/dist/chunks/{eo-draw-canvas.9611c05c.js → eo-draw-canvas.bfa88300.js} +2 -2
- package/dist/chunks/{eo-draw-canvas.9611c05c.js.map → eo-draw-canvas.bfa88300.js.map} +1 -1
- package/dist/chunks/{main.e5db7bc6.js → main.06a6f2f0.js} +2 -2
- package/dist/chunks/{main.e5db7bc6.js.map → main.06a6f2f0.js.map} +1 -1
- package/dist/examples.json +5 -5
- package/dist/index.3c8c3923.js +2 -0
- package/dist/{index.87f72e5d.js.map → index.3c8c3923.js.map} +1 -1
- package/dist/manifest.json +115 -115
- package/dist/types.json +3386 -3386
- package/dist-types/draw-canvas/decorators/DecoratorContainer.d.ts +1 -1
- package/dist-types/draw-canvas/decorators/index.d.ts +1 -1
- package/dist-types/draw-canvas/interfaces.d.ts +2 -0
- package/dist-types/draw-canvas/processors/asserts.d.ts +2 -1
- package/dist-types/draw-canvas/processors/computeContainerRect.d.ts +12 -0
- package/dist-types/draw-canvas/processors/computeContainerRect.spec.d.ts +1 -0
- package/docs/eo-display-canvas.md +14 -0
- package/docs/eo-draw-canvas.md +28 -0
- package/package.json +2 -2
- package/dist/chunks/2443.3cd60e77.js.map +0 -1
- package/dist/chunks/7059.65a1aa1e.js +0 -2
- package/dist/chunks/7059.65a1aa1e.js.map +0 -1
- package/dist/chunks/eo-display-canvas.d0016b00.js.map +0 -1
- package/dist/index.87f72e5d.js +0 -2
- /package/dist/chunks/{2443.3cd60e77.js.LICENSE.txt → 2443.c1da1160.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { BasicDecoratorProps } from "../interfaces";
|
|
2
|
-
export declare function DecoratorContainer({ cell, transform, readOnly, activeTarget, cells, onCellResizing, onCellResized, onSwitchActiveTarget, onDecoratorTextEditing, onDecoratorTextChange, }: BasicDecoratorProps): JSX.Element;
|
|
2
|
+
export declare function DecoratorContainer({ cell, transform, readOnly, layout, view, activeTarget, cells, onCellResizing, onCellResized, onSwitchActiveTarget, onDecoratorTextEditing, onDecoratorTextChange, }: BasicDecoratorProps): JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { BasicDecoratorProps } from "../interfaces";
|
|
2
|
-
export declare function DecoratorComponent({ cell, transform, readOnly, activeTarget, cells, onCellResizing, onCellResized, onSwitchActiveTarget, onDecoratorTextEditing, onDecoratorTextChange, }: BasicDecoratorProps): JSX.Element | null;
|
|
2
|
+
export declare function DecoratorComponent({ cell, view, transform, readOnly, layout, activeTarget, cells, onCellResizing, onCellResized, onSwitchActiveTarget, onDecoratorTextEditing, onDecoratorTextChange, }: BasicDecoratorProps): JSX.Element | null;
|
|
@@ -105,6 +105,8 @@ export interface BasicDecoratorProps {
|
|
|
105
105
|
cell: DecoratorCell;
|
|
106
106
|
transform: TransformLiteral;
|
|
107
107
|
readOnly?: boolean;
|
|
108
|
+
layout?: LayoutType;
|
|
109
|
+
view: DecoratorView;
|
|
108
110
|
activeTarget: ActiveTarget | null | undefined;
|
|
109
111
|
cells: Cell[];
|
|
110
112
|
onCellResizing?(info: ResizeCellPayload): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Cell, DecoratorCell, EdgeCell, InitialCell, InitialNodeCell, NodeCell } from "../interfaces";
|
|
1
|
+
import type { Cell, DecoratorCell, EdgeCell, InitialCell, InitialNodeCell, LayoutType, NodeCell } from "../interfaces";
|
|
2
2
|
import { MoveCellPayload } from "../reducers/interfaces";
|
|
3
3
|
export declare function isNodeCell(cell: Cell | MoveCellPayload): cell is NodeCell;
|
|
4
4
|
export declare function isDecoratorCell(cell: Cell): cell is DecoratorCell;
|
|
@@ -9,3 +9,4 @@ export declare function isNodeOrAreaDecoratorCell(cell: Cell): cell is NodeCell
|
|
|
9
9
|
export declare function isNodeOrTextDecoratorCell(cell: Cell | MoveCellPayload): cell is NodeCell | DecoratorCell;
|
|
10
10
|
export declare function isTextDecoratorCell(cell: Cell): cell is DecoratorCell;
|
|
11
11
|
export declare function isContainerDecoratorCell(cell: Cell): cell is DecoratorCell;
|
|
12
|
+
export declare function isNoManualLayout(layout: LayoutType): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseNodeCell } from "../interfaces";
|
|
2
|
+
export declare function computeContainerRect(cells: BaseNodeCell[]): {
|
|
3
|
+
x?: undefined;
|
|
4
|
+
y?: undefined;
|
|
5
|
+
width?: undefined;
|
|
6
|
+
height?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -27,6 +27,19 @@
|
|
|
27
27
|
height: 300,
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
|
+
{
|
|
31
|
+
type: "decorator",
|
|
32
|
+
id: "container-1",
|
|
33
|
+
decorator: "container",
|
|
34
|
+
view: {
|
|
35
|
+
x: 50,
|
|
36
|
+
y: 400,
|
|
37
|
+
width: 280,
|
|
38
|
+
height: 120,
|
|
39
|
+
direction: "top",
|
|
40
|
+
text: " 上层服务"
|
|
41
|
+
},
|
|
42
|
+
},
|
|
30
43
|
{
|
|
31
44
|
type: "edge",
|
|
32
45
|
source: "X",
|
|
@@ -69,6 +82,7 @@
|
|
|
69
82
|
["X", "Y", "Z", "W"].map((id) => ({
|
|
70
83
|
type: "node",
|
|
71
84
|
id,
|
|
85
|
+
containerId: ["X","Y","Z"].includes(id)?"container-1":undefined,
|
|
72
86
|
data: {
|
|
73
87
|
name: `Node ${id}`,
|
|
74
88
|
},
|
package/docs/eo-draw-canvas.md
CHANGED
|
@@ -450,6 +450,19 @@
|
|
|
450
450
|
width: 400,
|
|
451
451
|
height: 300,
|
|
452
452
|
},
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
type: "decorator",
|
|
456
|
+
id: "container-1",
|
|
457
|
+
decorator: "container",
|
|
458
|
+
view: {
|
|
459
|
+
x: 50,
|
|
460
|
+
y: 400,
|
|
461
|
+
width: 280,
|
|
462
|
+
height: 120,
|
|
463
|
+
direction: "top",
|
|
464
|
+
text: " 上层服务"
|
|
465
|
+
},
|
|
453
466
|
},
|
|
454
467
|
{
|
|
455
468
|
type: "edge",
|
|
@@ -468,6 +481,7 @@
|
|
|
468
481
|
["X", "Y", "Z", "W"].map((id) => ({
|
|
469
482
|
type: "node",
|
|
470
483
|
id,
|
|
484
|
+
containerId: ["X","Y","Z"].includes(id)?"container-1":undefined,
|
|
471
485
|
data: {
|
|
472
486
|
name: `Node ${id}`,
|
|
473
487
|
},
|
|
@@ -836,6 +850,19 @@
|
|
|
836
850
|
height: 300,
|
|
837
851
|
},
|
|
838
852
|
},
|
|
853
|
+
{
|
|
854
|
+
type: "decorator",
|
|
855
|
+
id: "container-1",
|
|
856
|
+
decorator: "container",
|
|
857
|
+
view: {
|
|
858
|
+
x: 50,
|
|
859
|
+
y: 400,
|
|
860
|
+
width: 280,
|
|
861
|
+
height: 120,
|
|
862
|
+
direction: "top",
|
|
863
|
+
text: " 上层服务"
|
|
864
|
+
},
|
|
865
|
+
},
|
|
839
866
|
{
|
|
840
867
|
type: "edge",
|
|
841
868
|
source: "X",
|
|
@@ -853,6 +880,7 @@
|
|
|
853
880
|
["X", "Y", "Z", "W"].map((id) => ({
|
|
854
881
|
type: "node",
|
|
855
882
|
id,
|
|
883
|
+
containerId: ["W","Z"].includes(id)?"container-1":undefined,
|
|
856
884
|
data: {
|
|
857
885
|
name: `Node ${id}`,
|
|
858
886
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-bricks/diagram",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.1",
|
|
4
4
|
"homepage": "https://github.com/easyops-cn/next-bricks/tree/master/bricks/diagram",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@next-bricks/basic": "*"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "516cbfaa210ab22d3b7329b8003c29207ec179f3"
|
|
45
45
|
}
|