feat: функционал скрытия подписей + fix: build output в корневой dist/
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
- Свитч «Подписи» в тулбаре теперь скрывает/показывает подписи на линиях и портах через visibility toggle - vite outDir перенесён в ../dist для совместимости с react.Dockerfile Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@ -189,7 +189,7 @@ export function SchemaCanvas() {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
// Sync display settings
|
||||
// Sync display settings: grid
|
||||
useEffect(() => {
|
||||
const graph = useSchemaStore.getState().graph;
|
||||
if (!graph) return;
|
||||
@ -201,6 +201,45 @@ export function SchemaCanvas() {
|
||||
}
|
||||
}, [displaySettings.showGrid]);
|
||||
|
||||
// Sync display settings: labels
|
||||
useEffect(() => {
|
||||
const graph = useSchemaStore.getState().graph;
|
||||
if (!graph) return;
|
||||
|
||||
const show = displaySettings.showLabels;
|
||||
|
||||
// Toggle edge labels
|
||||
for (const edge of graph.getEdges()) {
|
||||
const labels = edge.getLabels();
|
||||
if (labels.length > 0) {
|
||||
edge.setLabels(
|
||||
labels.map((label) => ({
|
||||
...label,
|
||||
attrs: {
|
||||
...label.attrs,
|
||||
label: {
|
||||
...(label.attrs?.label as Record<string, unknown>),
|
||||
visibility: show ? 'visible' : 'hidden',
|
||||
},
|
||||
rect: {
|
||||
...(label.attrs?.rect as Record<string, unknown>),
|
||||
visibility: show ? 'visible' : 'hidden',
|
||||
},
|
||||
},
|
||||
})),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Toggle port labels
|
||||
for (const node of graph.getNodes()) {
|
||||
const ports = node.getPorts();
|
||||
for (const port of ports) {
|
||||
node.setPortProp(port.id!, 'attrs/text/visibility', show ? 'visible' : 'hidden');
|
||||
}
|
||||
}
|
||||
}, [displaySettings.showLabels]);
|
||||
|
||||
return (
|
||||
<div style={{ position: 'relative', width: '100%', height: '100%' }}>
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user