seat-editor 3.4.7 → 3.5.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/dist/app/constant.d.ts +1 -1
- package/dist/app/graph-view/page.d.ts +1 -0
- package/dist/app/graph-view/page.js +343 -0
- package/dist/app/graph-view/page.jsx +445 -0
- package/dist/app/graph-view-new/constant.d.ts +581 -0
- package/dist/app/graph-view-new/constant.js +6973 -0
- package/dist/app/graph-view-new/page.d.ts +1 -0
- package/dist/app/graph-view-new/page.js +71 -0
- package/dist/app/graph-view-new/page.jsx +98 -0
- package/dist/app/new-board/page.js +43 -7
- package/dist/app/new-board/page.jsx +45 -12
- package/dist/components/button-tools/index.js +7 -5
- package/dist/components/button-tools/index.jsx +21 -9
- package/dist/components/form-tools/label.js +9 -20
- package/dist/components/form-tools/label.jsx +38 -28
- package/dist/components/form-tools/shape.js +5 -5
- package/dist/components/form-tools/shape.jsx +8 -8
- package/dist/components/layer-v3/index.js +44 -3
- package/dist/components/layer-v3/index.jsx +120 -3
- package/dist/components/layer-v4/index.js +3 -2
- package/dist/components/layer-v4/index.jsx +3 -2
- package/dist/components/layer-v5/constant.d.ts +60 -0
- package/dist/components/layer-v5/constant.js +93 -0
- package/dist/components/layer-v5/index.d.ts +24 -0
- package/dist/components/layer-v5/index.js +927 -0
- package/dist/components/layer-v5/index.jsx +1049 -0
- package/dist/features/board-v3/index.js +350 -72
- package/dist/features/board-v3/index.jsx +369 -75
- package/dist/features/board-v3/resize-element.js +5 -0
- package/dist/features/board-v3/utils.d.ts +8 -0
- package/dist/features/board-v3/utils.js +23 -7
- package/dist/features/package/index.d.ts +2 -0
- package/dist/features/package/index.js +1 -1
- package/dist/features/package/index.jsx +6 -1
- package/dist/features/panel/index.d.ts +8 -0
- package/dist/features/panel/index.js +160 -38
- package/dist/features/panel/index.jsx +173 -46
- package/dist/features/panel/polygon.d.ts +2 -0
- package/dist/features/panel/polygon.js +44 -0
- package/dist/features/panel/polygon.jsx +70 -0
- package/dist/features/panel/select-tool.js +3 -0
- package/dist/features/panel/select-tool.jsx +3 -0
- package/dist/features/panel/selected-group.js +24 -26
- package/dist/features/panel/selected-group.jsx +56 -51
- package/dist/features/panel/text-tool.js +17 -2
- package/dist/features/panel/text-tool.jsx +19 -2
- package/dist/features/panel/upload-tool.js +17 -3
- package/dist/features/panel/upload-tool.jsx +23 -4
- package/dist/features/side-tool/index.js +43 -6
- package/dist/features/side-tool/index.jsx +47 -10
- package/dist/features/view-only-4/connect-handle.d.ts +13 -0
- package/dist/features/view-only-4/connect-handle.js +23 -0
- package/dist/features/view-only-4/connect-handle.jsx +30 -0
- package/dist/features/view-only-4/connection-layer.d.ts +21 -0
- package/dist/features/view-only-4/connection-layer.js +219 -0
- package/dist/features/view-only-4/connection-layer.jsx +291 -0
- package/dist/features/view-only-4/index.d.ts +99 -0
- package/dist/features/view-only-4/index.js +684 -0
- package/dist/features/view-only-4/index.jsx +722 -0
- package/dist/features/view-only-4/integration-guide.d.ts +0 -0
- package/dist/features/view-only-4/integration-guide.js +0 -0
- package/dist/features/view-only-4/use-connection-graph.d.ts +41 -0
- package/dist/features/view-only-4/use-connection-graph.js +182 -0
- package/dist/features/view-only-4/utils.d.ts +74 -0
- package/dist/features/view-only-4/utils.js +106 -0
- package/dist/features/view-only-5/connect-handle.d.ts +30 -0
- package/dist/features/view-only-5/connect-handle.js +88 -0
- package/dist/features/view-only-5/connect-handle.jsx +96 -0
- package/dist/features/view-only-5/connection-layer.d.ts +34 -0
- package/dist/features/view-only-5/connection-layer.js +182 -0
- package/dist/features/view-only-5/connection-layer.jsx +265 -0
- package/dist/features/view-only-5/index.d.ts +102 -0
- package/dist/features/view-only-5/index.js +585 -0
- package/dist/features/view-only-5/index.jsx +614 -0
- package/dist/features/view-only-5/use-connection-graph.d.ts +57 -0
- package/dist/features/view-only-5/use-connection-graph.js +196 -0
- package/dist/features/view-only-5/utils.d.ts +52 -0
- package/dist/features/view-only-5/utils.js +80 -0
- package/dist/features/view-only-6/connect-handle.d.ts +13 -0
- package/dist/features/view-only-6/connect-handle.js +20 -0
- package/dist/features/view-only-6/connect-handle.jsx +21 -0
- package/dist/features/view-only-6/connection-layer.d.ts +22 -0
- package/dist/features/view-only-6/connection-layer.js +191 -0
- package/dist/features/view-only-6/connection-layer.jsx +244 -0
- package/dist/features/view-only-6/index.d.ts +99 -0
- package/dist/features/view-only-6/index.js +687 -0
- package/dist/features/view-only-6/index.jsx +724 -0
- package/dist/features/view-only-6/use-connection-graph.d.ts +26 -0
- package/dist/features/view-only-6/use-connection-graph.js +103 -0
- package/dist/features/view-only-6/utils.d.ts +66 -0
- package/dist/features/view-only-6/utils.js +96 -0
- package/dist/features/view-only-7/connect-handle.d.ts +13 -0
- package/dist/features/view-only-7/connect-handle.js +23 -0
- package/dist/features/view-only-7/connect-handle.jsx +30 -0
- package/dist/features/view-only-7/connection-layer.d.ts +22 -0
- package/dist/features/view-only-7/connection-layer.js +165 -0
- package/dist/features/view-only-7/connection-layer.jsx +217 -0
- package/dist/features/view-only-7/index.d.ts +99 -0
- package/dist/features/view-only-7/index.js +687 -0
- package/dist/features/view-only-7/index.jsx +724 -0
- package/dist/features/view-only-7/use-connection-graph.d.ts +26 -0
- package/dist/features/view-only-7/use-connection-graph.js +104 -0
- package/dist/features/view-only-7/utils.d.ts +69 -0
- package/dist/features/view-only-7/utils.js +144 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/seat-editor.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
// components/ConnectionLayer.tsx
|
|
2
|
+
import React, { useMemo, useState } from "react";
|
|
3
|
+
import { buildCurvePath, getCurveEndAngle, getRectEdge, NODE_WIDTH, NODE_HEIGHT, } from "./utils";
|
|
4
|
+
// ─── Constants ────────────────────────────────────────────────────────────────
|
|
5
|
+
const LEVEL_COLORS = [
|
|
6
|
+
"#22c55e",
|
|
7
|
+
"#f59e0b",
|
|
8
|
+
"#f97316",
|
|
9
|
+
"#ef4444",
|
|
10
|
+
"#a78bfa",
|
|
11
|
+
"#38bdf8",
|
|
12
|
+
];
|
|
13
|
+
const getLevelColor = (level) => LEVEL_COLORS[Math.min(level, LEVEL_COLORS.length - 1)];
|
|
14
|
+
// ─── BFS flood fill ───────────────────────────────────────────────────────────
|
|
15
|
+
const floodFill = (seedIds, edges) => {
|
|
16
|
+
const levelMap = new Map();
|
|
17
|
+
const queue = [];
|
|
18
|
+
seedIds.forEach((id) => {
|
|
19
|
+
levelMap.set(id, 0);
|
|
20
|
+
queue.push({ id, level: 0 });
|
|
21
|
+
});
|
|
22
|
+
while (queue.length > 0) {
|
|
23
|
+
const { id, level } = queue.shift();
|
|
24
|
+
edges.forEach((edge) => {
|
|
25
|
+
const neighbors = [];
|
|
26
|
+
if (edge.from === id)
|
|
27
|
+
neighbors.push(edge.to);
|
|
28
|
+
if (edge.to === id)
|
|
29
|
+
neighbors.push(edge.from);
|
|
30
|
+
neighbors.forEach((nId) => {
|
|
31
|
+
if (!levelMap.has(nId)) {
|
|
32
|
+
levelMap.set(nId, level + 1);
|
|
33
|
+
queue.push({ id: nId, level: level + 1 });
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return levelMap;
|
|
39
|
+
};
|
|
40
|
+
// ─── Group edges by source ────────────────────────────────────────────────────
|
|
41
|
+
const groupBySource = (edges) => {
|
|
42
|
+
const map = new Map();
|
|
43
|
+
edges.forEach((edge) => {
|
|
44
|
+
if (!map.has(edge.from))
|
|
45
|
+
map.set(edge.from, []);
|
|
46
|
+
map.get(edge.from).push(edge);
|
|
47
|
+
});
|
|
48
|
+
return map;
|
|
49
|
+
};
|
|
50
|
+
// ─── Component ────────────────────────────────────────────────────────────────
|
|
51
|
+
export const ConnectionLayer = ({ edges, selectedEdge, connecting, mousePos, getNodeById, onSelectEdge,
|
|
52
|
+
// onDeleteEdge,
|
|
53
|
+
}) => {
|
|
54
|
+
const [hoveredEdge, setHoveredEdge] = useState(null);
|
|
55
|
+
// ── Flood fill highlight ──────────────────────────────────────────
|
|
56
|
+
const nodeHighlightMap = useMemo(() => {
|
|
57
|
+
if (!selectedEdge)
|
|
58
|
+
return new Map();
|
|
59
|
+
const sel = edges.find((e) => e.id === selectedEdge);
|
|
60
|
+
if (!sel)
|
|
61
|
+
return new Map();
|
|
62
|
+
return floodFill([sel.from, sel.to], edges);
|
|
63
|
+
}, [selectedEdge, edges]);
|
|
64
|
+
// ── Group by source for shared stem ──────────────────────────────
|
|
65
|
+
const sourceGroups = useMemo(() => groupBySource(edges), [edges]);
|
|
66
|
+
// ── Pre-compute curve data per edge ──────────────────────────────
|
|
67
|
+
const curveData = useMemo(() => {
|
|
68
|
+
const map = new Map();
|
|
69
|
+
edges.forEach((edge) => {
|
|
70
|
+
const fromNode = getNodeById(edge.from);
|
|
71
|
+
const toNode = getNodeById(edge.to);
|
|
72
|
+
if (!fromNode || !toNode)
|
|
73
|
+
return;
|
|
74
|
+
const start = getRectEdge(fromNode, toNode, fromNode.width, fromNode.height);
|
|
75
|
+
const end = getRectEdge(toNode, fromNode, toNode.width, toNode.height);
|
|
76
|
+
const pathD = buildCurvePath(start, end);
|
|
77
|
+
const angle = getCurveEndAngle(start, end);
|
|
78
|
+
// Midpoint di kurva (t=0.5) untuk label/badge
|
|
79
|
+
const dx = end.x - start.x;
|
|
80
|
+
const dy = end.y - start.y;
|
|
81
|
+
const absDx = Math.abs(dx);
|
|
82
|
+
const absDy = Math.abs(dy);
|
|
83
|
+
const strength = Math.max(Math.max(absDx, absDy) * 0.5, 60);
|
|
84
|
+
let cp1;
|
|
85
|
+
let cp2;
|
|
86
|
+
if (absDx >= absDy) {
|
|
87
|
+
cp1 = { x: start.x + strength, y: start.y };
|
|
88
|
+
cp2 = { x: end.x - strength, y: end.y };
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
cp1 = { x: start.x, y: start.y + strength };
|
|
92
|
+
cp2 = { x: end.x, y: end.y - strength };
|
|
93
|
+
}
|
|
94
|
+
// Cubic bezier at t=0.5
|
|
95
|
+
const t = 0.5;
|
|
96
|
+
const mt = 1 - t;
|
|
97
|
+
const midX = mt * mt * mt * start.x +
|
|
98
|
+
3 * mt * mt * t * cp1.x +
|
|
99
|
+
3 * mt * t * t * cp2.x +
|
|
100
|
+
t * t * t * end.x;
|
|
101
|
+
const midY = mt * mt * mt * start.y +
|
|
102
|
+
3 * mt * mt * t * cp1.y +
|
|
103
|
+
3 * mt * t * t * cp2.y +
|
|
104
|
+
t * t * t * end.y;
|
|
105
|
+
map.set(edge.id, { start, end, pathD, angle, midX, midY });
|
|
106
|
+
});
|
|
107
|
+
return map;
|
|
108
|
+
}, [edges, getNodeById]);
|
|
109
|
+
// ── Shared stem exit point per source ────────────────────────────
|
|
110
|
+
const stemData = useMemo(() => {
|
|
111
|
+
const map = new Map();
|
|
112
|
+
sourceGroups.forEach((groupEdges, fromId) => {
|
|
113
|
+
if (groupEdges.length <= 1)
|
|
114
|
+
return;
|
|
115
|
+
const sourceNode = getNodeById(fromId);
|
|
116
|
+
if (!sourceNode)
|
|
117
|
+
return;
|
|
118
|
+
const exits = groupEdges
|
|
119
|
+
.map((edge) => {
|
|
120
|
+
const toNode = getNodeById(edge.to);
|
|
121
|
+
if (!toNode)
|
|
122
|
+
return null;
|
|
123
|
+
return getRectEdge(sourceNode, toNode, sourceNode.width, sourceNode.height);
|
|
124
|
+
})
|
|
125
|
+
.filter(Boolean);
|
|
126
|
+
if (exits.length === 0)
|
|
127
|
+
return;
|
|
128
|
+
map.set(fromId, {
|
|
129
|
+
x: exits.reduce((s, p) => s + p.x, 0) / exits.length,
|
|
130
|
+
y: exits.reduce((s, p) => s + p.y, 0) / exits.length,
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
return map;
|
|
134
|
+
}, [sourceGroups, getNodeById]);
|
|
135
|
+
return (<g id="connection-layer">
|
|
136
|
+
{/* ── Node border highlight (flood fill) ───────────────────────── */}
|
|
137
|
+
{Array.from(nodeHighlightMap.entries()).map(([nodeId, level]) => {
|
|
138
|
+
var _a, _b, _c;
|
|
139
|
+
const node = getNodeById(nodeId);
|
|
140
|
+
if (!node)
|
|
141
|
+
return null;
|
|
142
|
+
const w = (_a = node.width) !== null && _a !== void 0 ? _a : NODE_WIDTH;
|
|
143
|
+
const h = (_b = node.height) !== null && _b !== void 0 ? _b : NODE_HEIGHT;
|
|
144
|
+
const rotation = (_c = node.rotation) !== null && _c !== void 0 ? _c : 0;
|
|
145
|
+
const color = getLevelColor(level);
|
|
146
|
+
const padding = 4;
|
|
147
|
+
return (<g key={`highlight-${nodeId}`} transform={`translate(${node.x}, ${node.y}) rotate(${rotation})`} style={{ pointerEvents: "none" }}>
|
|
148
|
+
<rect x={-w / 2 - padding} y={-h / 2 - padding} width={w + padding * 2} height={h + padding * 2} fill="none" stroke={color} strokeWidth={8} rx={5} opacity={0.08}/>
|
|
149
|
+
<rect x={-w / 2 - padding} y={-h / 2 - padding} width={w + padding * 2} height={h + padding * 2} fill="none" stroke={color} strokeWidth={level === 0 ? 2.5 : 1.5} strokeDasharray={level === 0 ? "none" : "5 3"} rx={5} opacity={level === 0 ? 1 : 0.75}/>
|
|
150
|
+
<g transform={`translate(${w / 2 + padding - 2}, ${-h / 2 - padding})`}>
|
|
151
|
+
<circle r={7} fill={color} opacity={0.9}/>
|
|
152
|
+
<text textAnchor="middle" dominantBaseline="middle" fill="white" fontSize={7} fontFamily="monospace" fontWeight={700} style={{ userSelect: "none" }}>
|
|
153
|
+
{level}
|
|
154
|
+
</text>
|
|
155
|
+
</g>
|
|
156
|
+
</g>);
|
|
157
|
+
})}
|
|
158
|
+
|
|
159
|
+
{/* ── Stem dot di shared source exit ───────────────────────────── */}
|
|
160
|
+
{Array.from(stemData.entries()).map(([fromId, stemExit]) => {
|
|
161
|
+
var _a;
|
|
162
|
+
const isStemOfSelected = selectedEdge &&
|
|
163
|
+
((_a = edges.find((e) => e.id === selectedEdge)) === null || _a === void 0 ? void 0 : _a.from) === fromId;
|
|
164
|
+
const color = isStemOfSelected ? "#a78bfa" : "#38bdf8";
|
|
165
|
+
return (<g key={`stem-dot-${fromId}`} style={{ pointerEvents: "none" }}>
|
|
166
|
+
<circle cx={stemExit.x} cy={stemExit.y} r={5} fill="#0f172a" stroke={color} strokeWidth={1.5}/>
|
|
167
|
+
<circle cx={stemExit.x} cy={stemExit.y} r={2.5} fill={color}/>
|
|
168
|
+
</g>);
|
|
169
|
+
})}
|
|
170
|
+
|
|
171
|
+
{/* ── Render edges ─────────────────────────────────────────────── */}
|
|
172
|
+
{edges.map((edge) => {
|
|
173
|
+
const data = curveData.get(edge.id);
|
|
174
|
+
if (!data)
|
|
175
|
+
return null;
|
|
176
|
+
const { pathD, angle, midX, midY } = data;
|
|
177
|
+
const isSel = selectedEdge === edge.id;
|
|
178
|
+
const isHov = hoveredEdge === edge.id;
|
|
179
|
+
const markerId = `conn-arrow-${edge.id}`;
|
|
180
|
+
const markerSelId = `conn-arrow-sel-${edge.id}`;
|
|
181
|
+
// Warna edge jika dalam network highlight
|
|
182
|
+
const fromLevel = nodeHighlightMap.get(edge.from);
|
|
183
|
+
const toLevel = nodeHighlightMap.get(edge.to);
|
|
184
|
+
const isInNetwork = fromLevel !== undefined && toLevel !== undefined;
|
|
185
|
+
const networkColor = isInNetwork
|
|
186
|
+
? getLevelColor(Math.max(fromLevel, toLevel))
|
|
187
|
+
: "#38bdf8";
|
|
188
|
+
return (<g key={edge.id}>
|
|
189
|
+
<defs>
|
|
190
|
+
<marker id={markerId} markerWidth="8" markerHeight="8" refX="7" refY="3" orient={`${angle}deg`}>
|
|
191
|
+
<path d="M 0 0 L 8 3 L 0 6 Z" fill={isSel
|
|
192
|
+
? "#a78bfa"
|
|
193
|
+
: isInNetwork && !isSel
|
|
194
|
+
? networkColor
|
|
195
|
+
: "#38bdf8"} opacity={0.9}/>
|
|
196
|
+
</marker>
|
|
197
|
+
</defs>
|
|
198
|
+
|
|
199
|
+
{/* Hit area */}
|
|
200
|
+
<path d={pathD} stroke="transparent" strokeWidth={14} fill="none" style={{ cursor: "pointer" }} onClick={(e) => {
|
|
201
|
+
e.stopPropagation();
|
|
202
|
+
onSelectEdge(edge.id);
|
|
203
|
+
}} onMouseEnter={() => setHoveredEdge(edge.id)} onMouseLeave={() => setHoveredEdge(null)}/>
|
|
204
|
+
|
|
205
|
+
{/* Glow saat selected/hovered */}
|
|
206
|
+
{(isSel || isHov) && (<path d={pathD} stroke={isSel ? "#a78bfa" : "#38bdf8"} strokeWidth={8} fill="none" opacity={isSel ? 0.12 : 0.06} style={{ pointerEvents: "none" }}/>)}
|
|
207
|
+
|
|
208
|
+
{/* Curve utama */}
|
|
209
|
+
<path d={pathD} stroke={isSel
|
|
210
|
+
? "#a78bfa"
|
|
211
|
+
: isInNetwork && selectedEdge
|
|
212
|
+
? networkColor
|
|
213
|
+
: "#38bdf8"} strokeWidth={isSel ? 2 : isHov ? 2 : 1.5} fill="none" opacity={selectedEdge && !isSel && !isInNetwork ? 0.25 : 0.9} markerEnd={`url(#${markerId})`} style={{ pointerEvents: "none" }}/>
|
|
214
|
+
|
|
215
|
+
{/* DEL badge saat selected */}
|
|
216
|
+
{isSel && (<g style={{ pointerEvents: "none" }}>
|
|
217
|
+
<rect x={midX - 16} y={midY - 10} width={32} height={18} rx={4} fill="#1e1b2e" stroke="#a78bfa" strokeWidth={1} opacity={0.95}/>
|
|
218
|
+
<text x={midX} y={midY} textAnchor="middle" dominantBaseline="middle" fill="#a78bfa" fontSize={9} fontFamily="monospace" fontWeight={600}>
|
|
219
|
+
DEL
|
|
220
|
+
</text>
|
|
221
|
+
</g>)}
|
|
222
|
+
</g>);
|
|
223
|
+
})}
|
|
224
|
+
|
|
225
|
+
{/* ── Preview curve saat connecting ─────────────────────────────── */}
|
|
226
|
+
{connecting &&
|
|
227
|
+
(() => {
|
|
228
|
+
const fromNode = getNodeById(connecting.fromId);
|
|
229
|
+
if (!fromNode)
|
|
230
|
+
return null;
|
|
231
|
+
const start = getRectEdge(fromNode, mousePos, fromNode.width, fromNode.height);
|
|
232
|
+
const pathD = buildCurvePath(start, mousePos);
|
|
233
|
+
const angle = getCurveEndAngle(start, mousePos);
|
|
234
|
+
return (<g>
|
|
235
|
+
<defs>
|
|
236
|
+
<marker id="conn-preview-arrow" markerWidth="8" markerHeight="8" refX="7" refY="3" orient={`${angle}deg`}>
|
|
237
|
+
<path d="M 0 0 L 8 3 L 0 6 Z" fill="#a78bfa" opacity={0.85}/>
|
|
238
|
+
</marker>
|
|
239
|
+
</defs>
|
|
240
|
+
<path d={pathD} stroke="#a78bfa" strokeWidth={1.5} fill="none" strokeDasharray="6 3" markerEnd="url(#conn-preview-arrow)" opacity={0.8} style={{ pointerEvents: "none" }}/>
|
|
241
|
+
</g>);
|
|
242
|
+
})()}
|
|
243
|
+
</g>);
|
|
244
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React, { CSSProperties, SVGAttributes } from "react";
|
|
2
|
+
import { ReactZoomPanPinchRef, ReactZoomPanPinchProps, ReactZoomPanPinchContentRef } from "react-zoom-pan-pinch";
|
|
3
|
+
import { PropertiesProps } from "../../dto/table";
|
|
4
|
+
import { EventHandleType } from "../../dto/event-handler";
|
|
5
|
+
import { EdgeType } from "./utils";
|
|
6
|
+
export type TableGhost = {
|
|
7
|
+
table: PropertiesProps;
|
|
8
|
+
event: EventHandleType;
|
|
9
|
+
};
|
|
10
|
+
export type TableMatchKey = {
|
|
11
|
+
key: string | number;
|
|
12
|
+
properties?: PropertiesProps;
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
export type TableMatchEvent = {
|
|
16
|
+
event: EventHandleType;
|
|
17
|
+
properties: PropertiesProps;
|
|
18
|
+
};
|
|
19
|
+
export type ComponentProps<T = undefined> = T extends undefined ? PropertiesProps : Omit<PropertiesProps, keyof T> & T;
|
|
20
|
+
export type OnCurrentStateChange<TMeta = undefined> = ({ components, extraComponents, background, boundingBox, }: {
|
|
21
|
+
components: ComponentProps<TMeta>[];
|
|
22
|
+
extraComponents: ComponentProps[];
|
|
23
|
+
background: string;
|
|
24
|
+
boundingBox: PropertiesProps | null;
|
|
25
|
+
}) => void;
|
|
26
|
+
export type TransformProps = React.ForwardRefExoticComponent<Omit<ReactZoomPanPinchProps, "ref"> & React.RefAttributes<ReactZoomPanPinchContentRef>>;
|
|
27
|
+
export type RefLayerView = {
|
|
28
|
+
svgRef: SVGSVGElement;
|
|
29
|
+
transformRef: ReactZoomPanPinchRef;
|
|
30
|
+
containerRef: HTMLDivElement;
|
|
31
|
+
tableGhost: SVGGElement;
|
|
32
|
+
hoverUnderghost: ComponentProps;
|
|
33
|
+
};
|
|
34
|
+
export type TypeActionProps<TMeta = undefined> = {
|
|
35
|
+
targetTable: ComponentProps<TMeta>;
|
|
36
|
+
sourceTable: ComponentProps<TMeta>;
|
|
37
|
+
};
|
|
38
|
+
export interface LayerViewProps<TMeta = undefined> {
|
|
39
|
+
componentProps?: ComponentProps<TMeta>[];
|
|
40
|
+
extraComponentProps?: ComponentProps[];
|
|
41
|
+
onSelectComponent?: (component: ComponentProps<TMeta>) => void;
|
|
42
|
+
onDoubleClick?: (component: ComponentProps<TMeta>) => void;
|
|
43
|
+
mappingKey?: string;
|
|
44
|
+
tableMatchKey?: TableMatchKey[];
|
|
45
|
+
eventMatchTable?: TableMatchEvent[];
|
|
46
|
+
statusKey?: string;
|
|
47
|
+
defaultBackground?: string;
|
|
48
|
+
transformProps?: ReactZoomPanPinchProps;
|
|
49
|
+
containerProps?: React.HTMLAttributes<HTMLDivElement>;
|
|
50
|
+
svgProps?: SVGAttributes<SVGSVGElement>;
|
|
51
|
+
ghostAttributes?: SVGAttributes<SVGGElement>;
|
|
52
|
+
iconTags?: {
|
|
53
|
+
icon: React.JSX.Element;
|
|
54
|
+
key: string;
|
|
55
|
+
}[];
|
|
56
|
+
privilegedTags?: {
|
|
57
|
+
key: string;
|
|
58
|
+
items: string[];
|
|
59
|
+
}[];
|
|
60
|
+
tooltipProps?: {
|
|
61
|
+
className?: string;
|
|
62
|
+
style?: CSSProperties;
|
|
63
|
+
minWidth?: number;
|
|
64
|
+
children: React.ReactNode;
|
|
65
|
+
};
|
|
66
|
+
dragTableBlockKey?: {
|
|
67
|
+
key: string;
|
|
68
|
+
value: string | number | null;
|
|
69
|
+
}[];
|
|
70
|
+
onRightClick?: (e: MouseEvent, component: ComponentProps<TMeta>) => void;
|
|
71
|
+
allowTooltip?: boolean;
|
|
72
|
+
onDrop?: (e: React.MouseEvent<SVGSVGElement>, component: TypeActionProps<TMeta>) => void;
|
|
73
|
+
onSwitch?: (e: MouseEvent, component: TypeActionProps<TMeta>) => void;
|
|
74
|
+
refs?: React.ForwardedRef<RefLayerView>;
|
|
75
|
+
viewStyles?: {
|
|
76
|
+
paddingTop?: number;
|
|
77
|
+
paddingLeft?: number;
|
|
78
|
+
paddingRight?: number;
|
|
79
|
+
paddingBottom?: number;
|
|
80
|
+
};
|
|
81
|
+
loadingRender?: {
|
|
82
|
+
state: boolean;
|
|
83
|
+
element: React.JSX.Element;
|
|
84
|
+
};
|
|
85
|
+
defaultBoundingBox?: PropertiesProps;
|
|
86
|
+
viewOnly?: boolean;
|
|
87
|
+
actionPrivileged?: {
|
|
88
|
+
select?: boolean;
|
|
89
|
+
move?: boolean;
|
|
90
|
+
switch?: boolean;
|
|
91
|
+
drop?: boolean;
|
|
92
|
+
rightClick?: boolean;
|
|
93
|
+
double?: boolean;
|
|
94
|
+
};
|
|
95
|
+
onEdgesChange?: (edges: EdgeType[], table: PropertiesProps[]) => void;
|
|
96
|
+
keyNode: string;
|
|
97
|
+
}
|
|
98
|
+
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) => import("react/jsx-runtime").JSX.Element;
|
|
99
|
+
export default LayerView;
|