@dforge-core/diagram 0.0.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/LICENSE +21 -0
- package/README.md +45 -0
- package/dist/EntityNode.svelte +167 -0
- package/dist/EntityNode.svelte.d.ts +8 -0
- package/dist/EntityNode.svelte.d.ts.map +1 -0
- package/dist/IconButton.svelte +83 -0
- package/dist/IconButton.svelte.d.ts +13 -0
- package/dist/IconButton.svelte.d.ts.map +1 -0
- package/dist/SimpleDiagram/DiagramDebug.svelte +499 -0
- package/dist/SimpleDiagram/DiagramDebug.svelte.d.ts +4 -0
- package/dist/SimpleDiagram/DiagramDebug.svelte.d.ts.map +1 -0
- package/dist/SimpleDiagram/ModelDiagram.svelte +569 -0
- package/dist/SimpleDiagram/ModelDiagram.svelte.d.ts +18 -0
- package/dist/SimpleDiagram/ModelDiagram.svelte.d.ts.map +1 -0
- package/dist/SimpleDiagram/NOTE.md +14 -0
- package/dist/SimpleDiagram/SimpleDiagram.svelte +755 -0
- package/dist/SimpleDiagram/SimpleDiagram.svelte.d.ts +13 -0
- package/dist/SimpleDiagram/SimpleDiagram.svelte.d.ts.map +1 -0
- package/dist/SimpleDiagram/diagram-geometry.d.ts +33 -0
- package/dist/SimpleDiagram/diagram-geometry.d.ts.map +1 -0
- package/dist/SimpleDiagram/diagram-geometry.js +137 -0
- package/dist/SimpleDiagram/simple-layout.d.ts +27 -0
- package/dist/SimpleDiagram/simple-layout.d.ts.map +1 -0
- package/dist/SimpleDiagram/simple-layout.js +364 -0
- package/dist/WorkspaceMap/ModuleCard.svelte +165 -0
- package/dist/WorkspaceMap/ModuleCard.svelte.d.ts +8 -0
- package/dist/WorkspaceMap/ModuleCard.svelte.d.ts.map +1 -0
- package/dist/WorkspaceMap/WorkspaceMap.svelte +319 -0
- package/dist/WorkspaceMap/WorkspaceMap.svelte.d.ts +12 -0
- package/dist/WorkspaceMap/WorkspaceMap.svelte.d.ts.map +1 -0
- package/dist/WorkspaceMap/workspace-graph.d.ts +18 -0
- package/dist/WorkspaceMap/workspace-graph.d.ts.map +1 -0
- package/dist/WorkspaceMap/workspace-graph.js +168 -0
- package/dist/WorkspaceMap/workspace-types.d.ts +32 -0
- package/dist/WorkspaceMap/workspace-types.d.ts.map +1 -0
- package/dist/WorkspaceMap/workspace-types.js +1 -0
- package/dist/diagram-types.d.ts +47 -0
- package/dist/diagram-types.d.ts.map +1 -0
- package/dist/diagram-types.js +2 -0
- package/dist/edge-routing.d.ts +82 -0
- package/dist/edge-routing.d.ts.map +1 -0
- package/dist/edge-routing.js +388 -0
- package/dist/i18n.d.ts +13 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +20 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/local-storage-sync.d.ts +10 -0
- package/dist/local-storage-sync.d.ts.map +1 -0
- package/dist/local-storage-sync.js +39 -0
- package/dist/model-graph.d.ts +20 -0
- package/dist/model-graph.d.ts.map +1 -0
- package/dist/model-graph.js +100 -0
- package/dist/model-types.d.ts +55 -0
- package/dist/model-types.d.ts.map +1 -0
- package/dist/model-types.js +11 -0
- package/dist/pan-zoom.svelte.d.ts +34 -0
- package/dist/pan-zoom.svelte.d.ts.map +1 -0
- package/dist/pan-zoom.svelte.js +130 -0
- package/package.json +55 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { ModelColumn } from '../model-types';
|
|
3
|
+
import type { DiagramNode, DiagramEdge, ResolvedEdge, Point } from '../diagram-types';
|
|
4
|
+
import type { EdgePath } from '../edge-routing';
|
|
5
|
+
import ModelDiagram from './ModelDiagram.svelte';
|
|
6
|
+
import SimpleDiagram from './SimpleDiagram.svelte';
|
|
7
|
+
import { simpleLayout } from './simple-layout';
|
|
8
|
+
|
|
9
|
+
const NODE_WIDTH = 260;
|
|
10
|
+
const NODE_HEIGHT_BASE = 60;
|
|
11
|
+
const ROW_HEIGHT = 22;
|
|
12
|
+
const HEADER_HEIGHT = 30;
|
|
13
|
+
|
|
14
|
+
// --- Entity IDs ---
|
|
15
|
+
const COMPANY_ID = 1;
|
|
16
|
+
const CONTACT_ID = 2;
|
|
17
|
+
|
|
18
|
+
const entityMap = new Map<number, string>([
|
|
19
|
+
[COMPANY_ID, 'Company'],
|
|
20
|
+
[CONTACT_ID, 'Contact'],
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
const EDGE_ID = `edge-${CONTACT_ID}-company_id`;
|
|
24
|
+
|
|
25
|
+
// --- Columns ---
|
|
26
|
+
const col = (cd: string, label: string, opts?: Partial<ModelColumn>): ModelColumn => ({
|
|
27
|
+
columnCd: cd, isPk: false, fieldTypeCd: 'text', baseDatatypeCd: 'string',
|
|
28
|
+
resLabel: label,
|
|
29
|
+
...opts,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const companyColumns: ModelColumn[] = [
|
|
33
|
+
col('id', 'ID', { isPk: true, fieldTypeCd: 'number', baseDatatypeCd: 'number' }),
|
|
34
|
+
col('name', 'Name'),
|
|
35
|
+
col('industry', 'Industry'),
|
|
36
|
+
col('status', 'Status', { fieldTypeCd: 'dropdown' }),
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
const contactColumns: ModelColumn[] = [
|
|
40
|
+
col('id', 'ID', { isPk: true, fieldTypeCd: 'number', baseDatatypeCd: 'number' }),
|
|
41
|
+
col('first_name', 'First Name'),
|
|
42
|
+
col('last_name', 'Last Name'),
|
|
43
|
+
col('email', 'Email', { fieldTypeCd: 'email' }),
|
|
44
|
+
col('company_id', 'Company', {
|
|
45
|
+
columnType: 'R', fieldTypeCd: 'reference', baseDatatypeCd: 'number',
|
|
46
|
+
refEntityId: COMPANY_ID, isNullable: true,
|
|
47
|
+
}),
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
// --- Fixed node positions for "Current" mode ---
|
|
51
|
+
const CONTACT_X = 0;
|
|
52
|
+
const CONTACT_Y = 150;
|
|
53
|
+
const COMPANY_X = 500;
|
|
54
|
+
const COMPANY_Y = 0;
|
|
55
|
+
|
|
56
|
+
const companyH = NODE_HEIGHT_BASE + companyColumns.length * ROW_HEIGHT;
|
|
57
|
+
const contactH = NODE_HEIGHT_BASE + contactColumns.length * ROW_HEIGHT;
|
|
58
|
+
|
|
59
|
+
const SRC_X = CONTACT_X + NODE_WIDTH;
|
|
60
|
+
const SRC_Y = CONTACT_Y + HEADER_HEIGHT + 4 * ROW_HEIGHT + ROW_HEIGHT / 2;
|
|
61
|
+
const TGT_X = COMPANY_X;
|
|
62
|
+
const TGT_Y = COMPANY_Y + companyH / 2;
|
|
63
|
+
|
|
64
|
+
const fixedNodes: DiagramNode[] = [
|
|
65
|
+
{
|
|
66
|
+
id: `entity-${COMPANY_ID}`, x: COMPANY_X, y: COMPANY_Y,
|
|
67
|
+
width: NODE_WIDTH, height: companyH,
|
|
68
|
+
data: {
|
|
69
|
+
entityCd: 'company', resLabel: 'Company', resIcon: undefined,
|
|
70
|
+
moduleCd: 'debug', moduleColor: '#0d6efd',
|
|
71
|
+
columns: companyColumns, entityMap,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: `entity-${CONTACT_ID}`, x: CONTACT_X, y: CONTACT_Y,
|
|
76
|
+
width: NODE_WIDTH, height: contactH,
|
|
77
|
+
data: {
|
|
78
|
+
entityCd: 'contact', resLabel: 'Contact', resIcon: undefined,
|
|
79
|
+
moduleCd: 'debug', moduleColor: '#0d6efd',
|
|
80
|
+
columns: contactColumns, entityMap,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
const edges: DiagramEdge[] = [
|
|
86
|
+
{
|
|
87
|
+
id: EDGE_ID,
|
|
88
|
+
source: `entity-${CONTACT_ID}`,
|
|
89
|
+
sourceHandle: 'company_id',
|
|
90
|
+
target: `entity-${COMPANY_ID}`,
|
|
91
|
+
color: '#0d6efd',
|
|
92
|
+
label: 'Company',
|
|
93
|
+
isNullable: true,
|
|
94
|
+
},
|
|
95
|
+
];
|
|
96
|
+
|
|
97
|
+
// --- Mode toggle ---
|
|
98
|
+
let mode = $state<'current' | 'simple'>('simple');
|
|
99
|
+
|
|
100
|
+
// --- Simple layout (auto-positioned) ---
|
|
101
|
+
const simpleResult = $derived(simpleLayout(
|
|
102
|
+
fixedNodes.map((n) => ({ ...n })),
|
|
103
|
+
edges,
|
|
104
|
+
));
|
|
105
|
+
|
|
106
|
+
// --- Scenarios (Current mode only) ---
|
|
107
|
+
interface Scenario {
|
|
108
|
+
name: string;
|
|
109
|
+
description: string;
|
|
110
|
+
bends: Record<string, Point[]>;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const scenarios: Scenario[] = [
|
|
114
|
+
{
|
|
115
|
+
name: '1. Auto-routed',
|
|
116
|
+
description: 'No stored bends — uses extractBendPoints auto-routing',
|
|
117
|
+
bends: {},
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: '2. Orthogonal jog',
|
|
121
|
+
description: 'Proper V-H-V jog: all segments are purely H or V',
|
|
122
|
+
bends: {
|
|
123
|
+
[EDGE_ID]: [
|
|
124
|
+
{ x: 380, y: SRC_Y },
|
|
125
|
+
{ x: 380, y: TGT_Y },
|
|
126
|
+
{ x: 430, y: TGT_Y },
|
|
127
|
+
{ x: 430, y: 134 },
|
|
128
|
+
{ x: 480, y: 134 },
|
|
129
|
+
{ x: 480, y: TGT_Y },
|
|
130
|
+
],
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: '3. Collinear (post-split)',
|
|
135
|
+
description: 'After split, no drag yet — 3 extra bends all at same Y (tgtY=74)',
|
|
136
|
+
bends: {
|
|
137
|
+
[EDGE_ID]: [
|
|
138
|
+
{ x: 380, y: SRC_Y },
|
|
139
|
+
{ x: 380, y: TGT_Y },
|
|
140
|
+
{ x: 440, y: TGT_Y },
|
|
141
|
+
{ x: 440, y: TGT_Y },
|
|
142
|
+
{ x: TGT_X, y: TGT_Y },
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: '4. Diagonal (bug)',
|
|
148
|
+
description: 'Dragged collinear bends without clamps — creates diagonal lines',
|
|
149
|
+
bends: {
|
|
150
|
+
[EDGE_ID]: [
|
|
151
|
+
{ x: 380, y: SRC_Y },
|
|
152
|
+
{ x: 380, y: TGT_Y },
|
|
153
|
+
{ x: 440, y: 134 },
|
|
154
|
+
{ x: 440, y: 134 },
|
|
155
|
+
{ x: TGT_X, y: TGT_Y },
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: '5. Clamped (fix)',
|
|
161
|
+
description: 'Same drag as #4 but with clamp bends — stays orthogonal',
|
|
162
|
+
bends: {
|
|
163
|
+
[EDGE_ID]: [
|
|
164
|
+
{ x: 380, y: SRC_Y },
|
|
165
|
+
{ x: 380, y: TGT_Y },
|
|
166
|
+
{ x: 440, y: TGT_Y },
|
|
167
|
+
{ x: 440, y: 134 },
|
|
168
|
+
{ x: 440, y: 134 },
|
|
169
|
+
{ x: 440, y: TGT_Y },
|
|
170
|
+
{ x: TGT_X, y: TGT_Y },
|
|
171
|
+
],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: '6. Wide jog',
|
|
176
|
+
description: 'Jog with different X on both endpoints — proper horizontal dragged segment',
|
|
177
|
+
bends: {
|
|
178
|
+
[EDGE_ID]: [
|
|
179
|
+
{ x: 380, y: SRC_Y },
|
|
180
|
+
{ x: 380, y: TGT_Y },
|
|
181
|
+
{ x: 420, y: TGT_Y },
|
|
182
|
+
{ x: 420, y: 140 },
|
|
183
|
+
{ x: 480, y: 140 },
|
|
184
|
+
{ x: 480, y: TGT_Y },
|
|
185
|
+
],
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: '7. Dragged split',
|
|
190
|
+
description: 'Split + drag result — V detour at x=380 then H-V approach',
|
|
191
|
+
bends: {
|
|
192
|
+
[EDGE_ID]: [
|
|
193
|
+
{ x: 380, y: SRC_Y },
|
|
194
|
+
{ x: 380, y: 211 },
|
|
195
|
+
{ x: 380, y: 140 },
|
|
196
|
+
{ x: 480, y: 140 },
|
|
197
|
+
{ x: 480, y: TGT_Y },
|
|
198
|
+
],
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
];
|
|
202
|
+
|
|
203
|
+
let activeIndex = $state(0);
|
|
204
|
+
const activeScenario = $derived(scenarios[activeIndex]);
|
|
205
|
+
let liveBends = $state<Record<string, Point[]>>({});
|
|
206
|
+
let livePaths = $state<{ edge: DiagramEdge; path: EdgePath }[]>([]);
|
|
207
|
+
let showConfig = $state(false);
|
|
208
|
+
|
|
209
|
+
function dedup(pts: Point[]): Point[] {
|
|
210
|
+
const result: Point[] = [pts[0]];
|
|
211
|
+
for (let i = 1; i < pts.length; i++) {
|
|
212
|
+
const prev = result[result.length - 1];
|
|
213
|
+
if (Math.abs(prev.x - pts[i].x) > 0.5 || Math.abs(prev.y - pts[i].y) > 0.5) {
|
|
214
|
+
result.push(pts[i]);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return result;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function formatBends(bends: Record<string, Point[]>): string {
|
|
221
|
+
const entries = Object.entries(bends);
|
|
222
|
+
if (entries.length === 0) return 'bends: {}';
|
|
223
|
+
const lines: string[] = ['bends: {'];
|
|
224
|
+
for (const [, pts] of entries) {
|
|
225
|
+
const clean = dedup(pts);
|
|
226
|
+
lines.push(`\t[EDGE_ID]: [`);
|
|
227
|
+
for (const p of clean) {
|
|
228
|
+
lines.push(`\t\t{ x: ${Math.round(p.x)}, y: ${Math.round(p.y)} },`);
|
|
229
|
+
}
|
|
230
|
+
lines.push(`\t],`);
|
|
231
|
+
}
|
|
232
|
+
lines.push('}');
|
|
233
|
+
return lines.join('\n');
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function formatPaths(paths: { edge: DiagramEdge; path: EdgePath }[]): string {
|
|
237
|
+
if (paths.length === 0) return 'paths: (none)';
|
|
238
|
+
const lines: string[] = [];
|
|
239
|
+
for (const { edge, path } of paths) {
|
|
240
|
+
lines.push(`--- ${edge.id} ---`);
|
|
241
|
+
lines.push(`points (${path.points.length}):`);
|
|
242
|
+
for (const p of path.points) {
|
|
243
|
+
lines.push(` (${Math.round(p.x)}, ${Math.round(p.y)})`);
|
|
244
|
+
}
|
|
245
|
+
lines.push(`srcPort: (${Math.round(path.srcPort.x)}, ${Math.round(path.srcPort.y)})`);
|
|
246
|
+
lines.push(`tgtPort: (${Math.round(path.tgtPort.x)}, ${Math.round(path.tgtPort.y)})`);
|
|
247
|
+
lines.push(`d: ${path.d}`);
|
|
248
|
+
}
|
|
249
|
+
return lines.join('\n');
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function formatSimpleEdges(resolvedEdges: ResolvedEdge[]): string {
|
|
253
|
+
if (resolvedEdges.length === 0) return 'edges: (none)';
|
|
254
|
+
const lines: string[] = [];
|
|
255
|
+
for (const e of resolvedEdges) {
|
|
256
|
+
lines.push(`--- ${e.id} ---`);
|
|
257
|
+
lines.push(`points (${e.points.length}):`);
|
|
258
|
+
for (const p of e.points) {
|
|
259
|
+
lines.push(` (${Math.round(p.x)}, ${Math.round(p.y)})`);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return lines.join('\n');
|
|
263
|
+
}
|
|
264
|
+
</script>
|
|
265
|
+
|
|
266
|
+
<div class="debug-page">
|
|
267
|
+
<header class="debug-header">
|
|
268
|
+
<span class="debug-title">Diagram Debug</span>
|
|
269
|
+
<div class="mode-toggle">
|
|
270
|
+
<button class="mode-btn" class:active={mode === 'current'} onclick={() => mode = 'current'}>Current</button>
|
|
271
|
+
<button class="mode-btn" class:active={mode === 'simple'} onclick={() => mode = 'simple'}>Simple</button>
|
|
272
|
+
</div>
|
|
273
|
+
<span class="text-body-secondary" style="font-size: 0.75rem;">
|
|
274
|
+
src=({SRC_X},{SRC_Y}) tgt=({TGT_X},{TGT_Y})
|
|
275
|
+
</span>
|
|
276
|
+
</header>
|
|
277
|
+
|
|
278
|
+
{#if mode === 'current'}
|
|
279
|
+
<div class="scenario-bar">
|
|
280
|
+
{#each scenarios as s, i}
|
|
281
|
+
<button
|
|
282
|
+
class="scenario-btn"
|
|
283
|
+
class:active={i === activeIndex}
|
|
284
|
+
onclick={() => activeIndex = i}
|
|
285
|
+
>{s.name}</button>
|
|
286
|
+
{/each}
|
|
287
|
+
</div>
|
|
288
|
+
|
|
289
|
+
<div class="scenario-info">
|
|
290
|
+
{activeScenario.description}
|
|
291
|
+
{#if Object.keys(activeScenario.bends).length > 0}
|
|
292
|
+
{@const bends = activeScenario.bends[EDGE_ID]}
|
|
293
|
+
{#if bends}
|
|
294
|
+
— {bends.length} bend{bends.length === 1 ? '' : 's'}:
|
|
295
|
+
{#each bends as b, i}{#if i > 0}, {/if}({b.x},{b.y}){/each}
|
|
296
|
+
{/if}
|
|
297
|
+
{/if}
|
|
298
|
+
<button class="config-toggle" onclick={() => showConfig = !showConfig}>
|
|
299
|
+
{showConfig ? 'Hide' : 'Show'} live config
|
|
300
|
+
</button>
|
|
301
|
+
</div>
|
|
302
|
+
|
|
303
|
+
<div class="debug-body">
|
|
304
|
+
{#key activeIndex}
|
|
305
|
+
<div class="debug-canvas">
|
|
306
|
+
<ModelDiagram nodes={fixedNodes} {edges} initialBendPoints={activeScenario.bends}
|
|
307
|
+
onBendPointsChange={(b) => liveBends = b}
|
|
308
|
+
onEdgePathsChange={(p) => livePaths = p} />
|
|
309
|
+
</div>
|
|
310
|
+
{/key}
|
|
311
|
+
|
|
312
|
+
{#if showConfig}
|
|
313
|
+
<div class="config-panel">
|
|
314
|
+
<div class="config-header">
|
|
315
|
+
<span>Live Config</span>
|
|
316
|
+
<button class="config-copy" onclick={() => navigator.clipboard.writeText(formatBends(liveBends))}>
|
|
317
|
+
Copy
|
|
318
|
+
</button>
|
|
319
|
+
</div>
|
|
320
|
+
<pre class="config-pre">{formatBends(liveBends)}
|
|
321
|
+
|
|
322
|
+
{formatPaths(livePaths)}</pre>
|
|
323
|
+
</div>
|
|
324
|
+
{/if}
|
|
325
|
+
</div>
|
|
326
|
+
{:else}
|
|
327
|
+
<div class="scenario-info">
|
|
328
|
+
Simple mode — topological layout + deterministic H→V→H routing. No bend state, no segment dragging.
|
|
329
|
+
<button class="config-toggle" onclick={() => showConfig = !showConfig}>
|
|
330
|
+
{showConfig ? 'Hide' : 'Show'} edge data
|
|
331
|
+
</button>
|
|
332
|
+
</div>
|
|
333
|
+
|
|
334
|
+
<div class="debug-body">
|
|
335
|
+
<div class="debug-canvas">
|
|
336
|
+
<SimpleDiagram nodes={simpleResult.nodes} edges={simpleResult.edges} />
|
|
337
|
+
</div>
|
|
338
|
+
|
|
339
|
+
{#if showConfig}
|
|
340
|
+
<div class="config-panel">
|
|
341
|
+
<div class="config-header">
|
|
342
|
+
<span>Edge Data</span>
|
|
343
|
+
</div>
|
|
344
|
+
<pre class="config-pre">{formatSimpleEdges(simpleResult.edges)}</pre>
|
|
345
|
+
</div>
|
|
346
|
+
{/if}
|
|
347
|
+
</div>
|
|
348
|
+
{/if}
|
|
349
|
+
</div>
|
|
350
|
+
|
|
351
|
+
<style>
|
|
352
|
+
.debug-page {
|
|
353
|
+
height: 100vh;
|
|
354
|
+
display: flex;
|
|
355
|
+
flex-direction: column;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.debug-header {
|
|
359
|
+
display: flex;
|
|
360
|
+
align-items: center;
|
|
361
|
+
gap: 0.75rem;
|
|
362
|
+
height: 40px;
|
|
363
|
+
padding: 0 0.75rem;
|
|
364
|
+
border-bottom: 1px solid var(--bs-border-color);
|
|
365
|
+
background-color: var(--bs-body-bg);
|
|
366
|
+
flex-shrink: 0;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.debug-title {
|
|
370
|
+
font-size: 0.9rem;
|
|
371
|
+
font-weight: 600;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.mode-toggle {
|
|
375
|
+
display: flex;
|
|
376
|
+
border: 1px solid var(--bs-border-color);
|
|
377
|
+
border-radius: 4px;
|
|
378
|
+
overflow: hidden;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.mode-btn {
|
|
382
|
+
padding: 0.15rem 0.5rem;
|
|
383
|
+
font-size: 0.72rem;
|
|
384
|
+
border: none;
|
|
385
|
+
background: var(--bs-body-bg);
|
|
386
|
+
color: var(--bs-body-color);
|
|
387
|
+
cursor: pointer;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.mode-btn + .mode-btn {
|
|
391
|
+
border-left: 1px solid var(--bs-border-color);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.mode-btn.active {
|
|
395
|
+
background: var(--bs-primary);
|
|
396
|
+
color: white;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.scenario-bar {
|
|
400
|
+
display: flex;
|
|
401
|
+
flex-wrap: wrap;
|
|
402
|
+
gap: 0.25rem;
|
|
403
|
+
padding: 0.4rem 0.75rem;
|
|
404
|
+
border-bottom: 1px solid var(--bs-border-color);
|
|
405
|
+
background: var(--bs-tertiary-bg);
|
|
406
|
+
flex-shrink: 0;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.scenario-btn {
|
|
410
|
+
padding: 0.2rem 0.5rem;
|
|
411
|
+
font-size: 0.72rem;
|
|
412
|
+
border: 1px solid var(--bs-border-color);
|
|
413
|
+
border-radius: 4px;
|
|
414
|
+
background: var(--bs-body-bg);
|
|
415
|
+
color: var(--bs-body-color);
|
|
416
|
+
cursor: pointer;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.scenario-btn.active {
|
|
420
|
+
background: var(--bs-primary);
|
|
421
|
+
color: white;
|
|
422
|
+
border-color: var(--bs-primary);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.scenario-info {
|
|
426
|
+
display: flex;
|
|
427
|
+
align-items: center;
|
|
428
|
+
gap: 0.5rem;
|
|
429
|
+
padding: 0.3rem 0.75rem;
|
|
430
|
+
font-size: 0.7rem;
|
|
431
|
+
color: var(--bs-secondary-color);
|
|
432
|
+
border-bottom: 1px solid var(--bs-border-color);
|
|
433
|
+
flex-shrink: 0;
|
|
434
|
+
font-family: monospace;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.config-toggle {
|
|
438
|
+
margin-left: auto;
|
|
439
|
+
padding: 0.1rem 0.4rem;
|
|
440
|
+
font-size: 0.65rem;
|
|
441
|
+
border: 1px solid var(--bs-border-color);
|
|
442
|
+
border-radius: 3px;
|
|
443
|
+
background: var(--bs-body-bg);
|
|
444
|
+
color: var(--bs-body-color);
|
|
445
|
+
cursor: pointer;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.debug-body {
|
|
449
|
+
flex: 1;
|
|
450
|
+
min-height: 0;
|
|
451
|
+
display: flex;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.debug-canvas {
|
|
455
|
+
flex: 1;
|
|
456
|
+
min-height: 0;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.config-panel {
|
|
460
|
+
width: 280px;
|
|
461
|
+
flex-shrink: 0;
|
|
462
|
+
border-left: 1px solid var(--bs-border-color);
|
|
463
|
+
display: flex;
|
|
464
|
+
flex-direction: column;
|
|
465
|
+
background: var(--bs-tertiary-bg);
|
|
466
|
+
overflow: hidden;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.config-header {
|
|
470
|
+
display: flex;
|
|
471
|
+
align-items: center;
|
|
472
|
+
justify-content: space-between;
|
|
473
|
+
padding: 0.3rem 0.5rem;
|
|
474
|
+
font-size: 0.7rem;
|
|
475
|
+
font-weight: 600;
|
|
476
|
+
border-bottom: 1px solid var(--bs-border-color);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.config-copy {
|
|
480
|
+
padding: 0.1rem 0.35rem;
|
|
481
|
+
font-size: 0.6rem;
|
|
482
|
+
border: 1px solid var(--bs-border-color);
|
|
483
|
+
border-radius: 3px;
|
|
484
|
+
background: var(--bs-body-bg);
|
|
485
|
+
color: var(--bs-body-color);
|
|
486
|
+
cursor: pointer;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.config-pre {
|
|
490
|
+
flex: 1;
|
|
491
|
+
margin: 0;
|
|
492
|
+
padding: 0.4rem 0.5rem;
|
|
493
|
+
font-size: 0.62rem;
|
|
494
|
+
line-height: 1.5;
|
|
495
|
+
overflow: auto;
|
|
496
|
+
white-space: pre;
|
|
497
|
+
tab-size: 2;
|
|
498
|
+
}
|
|
499
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiagramDebug.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/SimpleDiagram/DiagramDebug.svelte.ts"],"names":[],"mappings":"AAqWA,QAAA,MAAM,YAAY,2DAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|