system-canvas 0.1.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/canvas.d.ts +28 -0
- package/dist/canvas.d.ts.map +1 -0
- package/dist/canvas.js +95 -0
- package/dist/canvas.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/rendering/anchor-points.d.ts +16 -0
- package/dist/rendering/anchor-points.d.ts.map +1 -0
- package/dist/rendering/anchor-points.js +53 -0
- package/dist/rendering/anchor-points.js.map +1 -0
- package/dist/rendering/edge-routing.d.ts +10 -0
- package/dist/rendering/edge-routing.d.ts.map +1 -0
- package/dist/rendering/edge-routing.js +109 -0
- package/dist/rendering/edge-routing.js.map +1 -0
- package/dist/rendering/index.d.ts +4 -0
- package/dist/rendering/index.d.ts.map +1 -0
- package/dist/rendering/index.js +4 -0
- package/dist/rendering/index.js.map +1 -0
- package/dist/rendering/viewport-math.d.ts +25 -0
- package/dist/rendering/viewport-math.d.ts.map +1 -0
- package/dist/rendering/viewport-math.js +66 -0
- package/dist/rendering/viewport-math.js.map +1 -0
- package/dist/themes/blueprint.d.ts +7 -0
- package/dist/themes/blueprint.d.ts.map +1 -0
- package/dist/themes/blueprint.js +62 -0
- package/dist/themes/blueprint.js.map +1 -0
- package/dist/themes/dark.d.ts +7 -0
- package/dist/themes/dark.d.ts.map +1 -0
- package/dist/themes/dark.js +62 -0
- package/dist/themes/dark.js.map +1 -0
- package/dist/themes/index.d.ts +7 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.js +7 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/themes/light.d.ts +7 -0
- package/dist/themes/light.d.ts.map +1 -0
- package/dist/themes/light.js +62 -0
- package/dist/themes/light.js.map +1 -0
- package/dist/themes/midnight.d.ts +7 -0
- package/dist/themes/midnight.d.ts.map +1 -0
- package/dist/themes/midnight.js +62 -0
- package/dist/themes/midnight.js.map +1 -0
- package/dist/themes/resolve.d.ts +17 -0
- package/dist/themes/resolve.d.ts.map +1 -0
- package/dist/themes/resolve.js +88 -0
- package/dist/themes/resolve.js.map +1 -0
- package/dist/themes/warm.d.ts +7 -0
- package/dist/themes/warm.d.ts.map +1 -0
- package/dist/themes/warm.js +62 -0
- package/dist/themes/warm.js.map +1 -0
- package/dist/types.d.ts +191 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +25 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default dark theme — inspired by the architecture diagram reference.
|
|
3
|
+
* Slate-950 background, glowing colored nodes, grid pattern, JetBrains Mono.
|
|
4
|
+
*/
|
|
5
|
+
export const darkTheme = {
|
|
6
|
+
name: 'dark',
|
|
7
|
+
background: '#020617', // slate-950
|
|
8
|
+
grid: {
|
|
9
|
+
size: 40,
|
|
10
|
+
color: '#1e293b', // slate-800
|
|
11
|
+
strokeWidth: 0.5,
|
|
12
|
+
},
|
|
13
|
+
node: {
|
|
14
|
+
fill: 'rgba(30, 41, 59, 0.5)', // slate default
|
|
15
|
+
stroke: '#94a3b8', // slate-400
|
|
16
|
+
strokeWidth: 1.5,
|
|
17
|
+
cornerRadius: 6,
|
|
18
|
+
labelColor: '#ffffff',
|
|
19
|
+
sublabelColor: '#94a3b8', // slate-400
|
|
20
|
+
fontFamily: "'JetBrains Mono', 'Fira Code', 'SF Mono', monospace",
|
|
21
|
+
fontSize: 12,
|
|
22
|
+
sublabelFontSize: 9,
|
|
23
|
+
refIndicator: {
|
|
24
|
+
icon: 'chevron',
|
|
25
|
+
color: 'rgba(148, 163, 184, 0.6)', // slate-400 at 60%
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
edge: {
|
|
29
|
+
stroke: '#64748b', // slate-500
|
|
30
|
+
strokeWidth: 1.5,
|
|
31
|
+
arrowSize: 10,
|
|
32
|
+
labelColor: '#94a3b8', // slate-400
|
|
33
|
+
labelFontSize: 9,
|
|
34
|
+
},
|
|
35
|
+
group: {
|
|
36
|
+
fill: 'rgba(30, 41, 59, 0.15)',
|
|
37
|
+
stroke: '#475569', // slate-600
|
|
38
|
+
strokeWidth: 1,
|
|
39
|
+
strokeDasharray: '8,4',
|
|
40
|
+
labelColor: '#94a3b8', // slate-400
|
|
41
|
+
labelFontSize: 11,
|
|
42
|
+
cornerRadius: 12,
|
|
43
|
+
},
|
|
44
|
+
breadcrumbs: {
|
|
45
|
+
background: 'rgba(15, 23, 42, 0.9)', // slate-900 at 90%
|
|
46
|
+
textColor: '#94a3b8',
|
|
47
|
+
activeColor: '#e2e8f0', // slate-200
|
|
48
|
+
separatorColor: '#475569', // slate-600
|
|
49
|
+
fontFamily: "'JetBrains Mono', 'Fira Code', 'SF Mono', monospace",
|
|
50
|
+
fontSize: 12,
|
|
51
|
+
},
|
|
52
|
+
presetColors: {
|
|
53
|
+
'1': { fill: 'rgba(136, 19, 55, 0.4)', stroke: '#fb7185' }, // rose — security/auth
|
|
54
|
+
'2': { fill: 'rgba(120, 53, 15, 0.3)', stroke: '#fb923c' }, // orange — events/messaging
|
|
55
|
+
'3': { fill: 'rgba(120, 53, 15, 0.3)', stroke: '#fbbf24' }, // amber — cloud/infra
|
|
56
|
+
'4': { fill: 'rgba(6, 78, 59, 0.4)', stroke: '#34d399' }, // emerald — backend/services
|
|
57
|
+
'5': { fill: 'rgba(8, 51, 68, 0.4)', stroke: '#22d3ee' }, // cyan — frontend/client
|
|
58
|
+
'6': { fill: 'rgba(76, 29, 149, 0.4)', stroke: '#a78bfa' }, // violet — database/storage
|
|
59
|
+
},
|
|
60
|
+
categories: {},
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=dark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dark.js","sourceRoot":"","sources":["../../src/themes/dark.ts"],"names":[],"mappings":"AAEA;;;GAGG;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B,EAAI,MAAM,EAAE,SAAS,EAAE,EAAG,uBAAuB;QACtF,GAAG,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAI,MAAM,EAAE,SAAS,EAAE,EAAG,4BAA4B;QAC3F,GAAG,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAI,MAAM,EAAE,SAAS,EAAE,EAAG,sBAAsB;QACrF,GAAG,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAM,MAAM,EAAE,SAAS,EAAE,EAAG,6BAA6B;QAC5F,GAAG,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAM,MAAM,EAAE,SAAS,EAAE,EAAG,yBAAyB;QACxF,GAAG,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAI,MAAM,EAAE,SAAS,EAAE,EAAG,4BAA4B;KAC5F;IAED,UAAU,EAAE,EAAE;CACf,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { darkTheme } from './dark.js';
|
|
2
|
+
export { midnightTheme } from './midnight.js';
|
|
3
|
+
export { lightTheme } from './light.js';
|
|
4
|
+
export { blueprintTheme } from './blueprint.js';
|
|
5
|
+
export { warmTheme } from './warm.js';
|
|
6
|
+
export { resolveTheme, resolveColor, resolveNode } from './resolve.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/themes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { darkTheme } from './dark.js';
|
|
2
|
+
export { midnightTheme } from './midnight.js';
|
|
3
|
+
export { lightTheme } from './light.js';
|
|
4
|
+
export { blueprintTheme } from './blueprint.js';
|
|
5
|
+
export { warmTheme } from './warm.js';
|
|
6
|
+
export { resolveTheme, resolveColor, resolveNode } from './resolve.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/themes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"light.d.ts","sourceRoot":"","sources":["../../src/themes/light.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,WAgExB,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Light theme — clean white/gray, subtle borders, muted fills.
|
|
3
|
+
* Professional / documentation aesthetic.
|
|
4
|
+
*/
|
|
5
|
+
export const lightTheme = {
|
|
6
|
+
name: 'light',
|
|
7
|
+
background: '#f8fafc', // slate-50
|
|
8
|
+
grid: {
|
|
9
|
+
size: 40,
|
|
10
|
+
color: '#e2e8f0', // slate-200
|
|
11
|
+
strokeWidth: 0.5,
|
|
12
|
+
},
|
|
13
|
+
node: {
|
|
14
|
+
fill: 'rgba(241, 245, 249, 0.9)', // slate-100
|
|
15
|
+
stroke: '#cbd5e1', // slate-300
|
|
16
|
+
strokeWidth: 1,
|
|
17
|
+
cornerRadius: 8,
|
|
18
|
+
labelColor: '#0f172a', // slate-900
|
|
19
|
+
sublabelColor: '#64748b', // slate-500
|
|
20
|
+
fontFamily: "'Inter', 'Helvetica Neue', sans-serif",
|
|
21
|
+
fontSize: 12,
|
|
22
|
+
sublabelFontSize: 9,
|
|
23
|
+
refIndicator: {
|
|
24
|
+
icon: 'chevron',
|
|
25
|
+
color: 'rgba(100, 116, 139, 0.5)',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
edge: {
|
|
29
|
+
stroke: '#94a3b8', // slate-400
|
|
30
|
+
strokeWidth: 1.5,
|
|
31
|
+
arrowSize: 10,
|
|
32
|
+
labelColor: '#64748b', // slate-500
|
|
33
|
+
labelFontSize: 9,
|
|
34
|
+
},
|
|
35
|
+
group: {
|
|
36
|
+
fill: 'rgba(241, 245, 249, 0.5)',
|
|
37
|
+
stroke: '#cbd5e1',
|
|
38
|
+
strokeWidth: 1,
|
|
39
|
+
strokeDasharray: '8,4',
|
|
40
|
+
labelColor: '#64748b',
|
|
41
|
+
labelFontSize: 11,
|
|
42
|
+
cornerRadius: 12,
|
|
43
|
+
},
|
|
44
|
+
breadcrumbs: {
|
|
45
|
+
background: 'rgba(255, 255, 255, 0.95)',
|
|
46
|
+
textColor: '#64748b',
|
|
47
|
+
activeColor: '#0f172a',
|
|
48
|
+
separatorColor: '#cbd5e1',
|
|
49
|
+
fontFamily: "'Inter', 'Helvetica Neue', sans-serif",
|
|
50
|
+
fontSize: 12,
|
|
51
|
+
},
|
|
52
|
+
presetColors: {
|
|
53
|
+
'1': { fill: 'rgba(254, 226, 226, 0.7)', stroke: '#ef4444' }, // red
|
|
54
|
+
'2': { fill: 'rgba(255, 237, 213, 0.7)', stroke: '#f97316' }, // orange
|
|
55
|
+
'3': { fill: 'rgba(254, 249, 195, 0.7)', stroke: '#eab308' }, // yellow
|
|
56
|
+
'4': { fill: 'rgba(220, 252, 231, 0.7)', stroke: '#22c55e' }, // green
|
|
57
|
+
'5': { fill: 'rgba(207, 250, 254, 0.7)', stroke: '#06b6d4' }, // cyan
|
|
58
|
+
'6': { fill: 'rgba(237, 233, 254, 0.7)', stroke: '#8b5cf6' }, // violet
|
|
59
|
+
},
|
|
60
|
+
categories: {},
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=light.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"light.js","sourceRoot":"","sources":["../../src/themes/light.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAgB;IACrC,IAAI,EAAE,OAAO;IAEb,UAAU,EAAE,SAAS,EAAE,WAAW;IAElC,IAAI,EAAE;QACJ,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,SAAS,EAAE,YAAY;QAC9B,WAAW,EAAE,GAAG;KACjB;IAED,IAAI,EAAE;QACJ,IAAI,EAAE,0BAA0B,EAAG,YAAY;QAC/C,MAAM,EAAE,SAAS,EAAmB,YAAY;QAChD,WAAW,EAAE,CAAC;QACd,YAAY,EAAE,CAAC;QACf,UAAU,EAAE,SAAS,EAAe,YAAY;QAChD,aAAa,EAAE,SAAS,EAAY,YAAY;QAChD,UAAU,EAAE,uCAAuC;QACnD,QAAQ,EAAE,EAAE;QACZ,gBAAgB,EAAE,CAAC;QACnB,YAAY,EAAE;YACZ,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,0BAA0B;SAClC;KACF;IAED,IAAI,EAAE;QACJ,MAAM,EAAE,SAAS,EAAM,YAAY;QACnC,WAAW,EAAE,GAAG;QAChB,SAAS,EAAE,EAAE;QACb,UAAU,EAAE,SAAS,EAAE,YAAY;QACnC,aAAa,EAAE,CAAC;KACjB;IAED,KAAK,EAAE;QACL,IAAI,EAAE,0BAA0B;QAChC,MAAM,EAAE,SAAS;QACjB,WAAW,EAAE,CAAC;QACd,eAAe,EAAE,KAAK;QACtB,UAAU,EAAE,SAAS;QACrB,aAAa,EAAE,EAAE;QACjB,YAAY,EAAE,EAAE;KACjB;IAED,WAAW,EAAE;QACX,UAAU,EAAE,2BAA2B;QACvC,SAAS,EAAE,SAAS;QACpB,WAAW,EAAE,SAAS;QACtB,cAAc,EAAE,SAAS;QACzB,UAAU,EAAE,uCAAuC;QACnD,QAAQ,EAAE,EAAE;KACb;IAED,YAAY,EAAE;QACZ,GAAG,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE,MAAM,EAAE,SAAS,EAAE,EAAG,MAAM;QACrE,GAAG,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE,MAAM,EAAE,SAAS,EAAE,EAAG,SAAS;QACxE,GAAG,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE,MAAM,EAAE,SAAS,EAAE,EAAG,SAAS;QACxE,GAAG,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE,MAAM,EAAE,SAAS,EAAE,EAAG,QAAQ;QACvE,GAAG,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE,MAAM,EAAE,SAAS,EAAE,EAAG,OAAO;QACtE,GAAG,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE,MAAM,EAAE,SAAS,EAAE,EAAG,SAAS;KACzE;IAED,UAAU,EAAE,EAAE;CACf,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"midnight.d.ts","sourceRoot":"","sources":["../../src/themes/midnight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,WAgE3B,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Midnight theme — deeper blacks, higher contrast, neon accents.
|
|
3
|
+
* Terminal/hacker aesthetic.
|
|
4
|
+
*/
|
|
5
|
+
export const midnightTheme = {
|
|
6
|
+
name: 'midnight',
|
|
7
|
+
background: '#000000',
|
|
8
|
+
grid: {
|
|
9
|
+
size: 32,
|
|
10
|
+
color: '#111111',
|
|
11
|
+
strokeWidth: 0.3,
|
|
12
|
+
},
|
|
13
|
+
node: {
|
|
14
|
+
fill: 'rgba(10, 10, 10, 0.8)',
|
|
15
|
+
stroke: '#6b7280', // gray-500
|
|
16
|
+
strokeWidth: 1,
|
|
17
|
+
cornerRadius: 4,
|
|
18
|
+
labelColor: '#e5e7eb', // gray-200
|
|
19
|
+
sublabelColor: '#6b7280', // gray-500
|
|
20
|
+
fontFamily: "'JetBrains Mono', 'Fira Code', monospace",
|
|
21
|
+
fontSize: 11,
|
|
22
|
+
sublabelFontSize: 8,
|
|
23
|
+
refIndicator: {
|
|
24
|
+
icon: 'arrow',
|
|
25
|
+
color: 'rgba(107, 114, 128, 0.5)',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
edge: {
|
|
29
|
+
stroke: '#374151', // gray-700
|
|
30
|
+
strokeWidth: 1,
|
|
31
|
+
arrowSize: 8,
|
|
32
|
+
labelColor: '#6b7280', // gray-500
|
|
33
|
+
labelFontSize: 8,
|
|
34
|
+
},
|
|
35
|
+
group: {
|
|
36
|
+
fill: 'rgba(17, 17, 17, 0.4)',
|
|
37
|
+
stroke: '#374151',
|
|
38
|
+
strokeWidth: 1,
|
|
39
|
+
strokeDasharray: '6,3',
|
|
40
|
+
labelColor: '#6b7280',
|
|
41
|
+
labelFontSize: 10,
|
|
42
|
+
cornerRadius: 8,
|
|
43
|
+
},
|
|
44
|
+
breadcrumbs: {
|
|
45
|
+
background: 'rgba(0, 0, 0, 0.95)',
|
|
46
|
+
textColor: '#6b7280',
|
|
47
|
+
activeColor: '#00ff88',
|
|
48
|
+
separatorColor: '#374151',
|
|
49
|
+
fontFamily: "'JetBrains Mono', monospace",
|
|
50
|
+
fontSize: 11,
|
|
51
|
+
},
|
|
52
|
+
presetColors: {
|
|
53
|
+
'1': { fill: 'rgba(255, 0, 60, 0.15)', stroke: '#ff003c' }, // neon red
|
|
54
|
+
'2': { fill: 'rgba(255, 140, 0, 0.15)', stroke: '#ff8c00' }, // neon orange
|
|
55
|
+
'3': { fill: 'rgba(255, 230, 0, 0.15)', stroke: '#ffe600' }, // neon yellow
|
|
56
|
+
'4': { fill: 'rgba(0, 255, 136, 0.15)', stroke: '#00ff88' }, // neon green
|
|
57
|
+
'5': { fill: 'rgba(0, 200, 255, 0.15)', stroke: '#00c8ff' }, // neon cyan
|
|
58
|
+
'6': { fill: 'rgba(160, 0, 255, 0.15)', stroke: '#a000ff' }, // neon purple
|
|
59
|
+
},
|
|
60
|
+
categories: {},
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=midnight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"midnight.js","sourceRoot":"","sources":["../../src/themes/midnight.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAgB;IACxC,IAAI,EAAE,UAAU;IAEhB,UAAU,EAAE,SAAS;IAErB,IAAI,EAAE;QACJ,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,GAAG;KACjB;IAED,IAAI,EAAE;QACJ,IAAI,EAAE,uBAAuB;QAC7B,MAAM,EAAE,SAAS,EAAgB,WAAW;QAC5C,WAAW,EAAE,CAAC;QACd,YAAY,EAAE,CAAC;QACf,UAAU,EAAE,SAAS,EAAY,WAAW;QAC5C,aAAa,EAAE,SAAS,EAAS,WAAW;QAC5C,UAAU,EAAE,0CAA0C;QACtD,QAAQ,EAAE,EAAE;QACZ,gBAAgB,EAAE,CAAC;QACnB,YAAY,EAAE;YACZ,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,0BAA0B;SAClC;KACF;IAED,IAAI,EAAE;QACJ,MAAM,EAAE,SAAS,EAAO,WAAW;QACnC,WAAW,EAAE,CAAC;QACd,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,SAAS,EAAG,WAAW;QACnC,aAAa,EAAE,CAAC;KACjB;IAED,KAAK,EAAE;QACL,IAAI,EAAE,uBAAuB;QAC7B,MAAM,EAAE,SAAS;QACjB,WAAW,EAAE,CAAC;QACd,eAAe,EAAE,KAAK;QACtB,UAAU,EAAE,SAAS;QACrB,aAAa,EAAE,EAAE;QACjB,YAAY,EAAE,CAAC;KAChB;IAED,WAAW,EAAE;QACX,UAAU,EAAE,qBAAqB;QACjC,SAAS,EAAE,SAAS;QACpB,WAAW,EAAE,SAAS;QACtB,cAAc,EAAE,SAAS;QACzB,UAAU,EAAE,6BAA6B;QACzC,QAAQ,EAAE,EAAE;KACb;IAED,YAAY,EAAE;QACZ,GAAG,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAI,MAAM,EAAE,SAAS,EAAE,EAAG,WAAW;QAC1E,GAAG,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAG,MAAM,EAAE,SAAS,EAAE,EAAG,cAAc;QAC7E,GAAG,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAG,MAAM,EAAE,SAAS,EAAE,EAAG,cAAc;QAC7E,GAAG,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAG,MAAM,EAAE,SAAS,EAAE,EAAG,aAAa;QAC5E,GAAG,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAG,MAAM,EAAE,SAAS,EAAE,EAAG,YAAY;QAC3E,GAAG,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAG,MAAM,EAAE,SAAS,EAAE,EAAG,cAAc;KAC9E;IAED,UAAU,EAAE,EAAE;CACf,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CanvasTheme, CanvasNode, ResolvedNode, PresetColor } from '../types.js';
|
|
2
|
+
/** Deep-merge a partial theme into a base theme. */
|
|
3
|
+
export declare function resolveTheme(partial?: Partial<CanvasTheme>, base?: CanvasTheme): CanvasTheme;
|
|
4
|
+
/**
|
|
5
|
+
* Resolve a CanvasColor string to a fill/stroke pair.
|
|
6
|
+
*
|
|
7
|
+
* - Preset "1"-"6" → looked up in theme.presetColors
|
|
8
|
+
* - Hex string like "#FF0000" → used as stroke, fill is derived at 30% opacity
|
|
9
|
+
* - undefined → returns the theme's default node fill/stroke
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveColor(color: string | undefined, theme: CanvasTheme): PresetColor;
|
|
12
|
+
/**
|
|
13
|
+
* Resolve a canvas node into a fully-resolved node with all dimensions,
|
|
14
|
+
* colors, and visual properties computed from the theme.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveNode(node: CanvasNode, theme: CanvasTheme): ResolvedNode;
|
|
17
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/themes/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,WAAW,EACZ,MAAM,aAAa,CAAA;AAGpB,oDAAoD;AACpD,wBAAgB,YAAY,CAC1B,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,EAC9B,IAAI,GAAE,WAAuB,GAC5B,WAAW,CAcb;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,KAAK,EAAE,WAAW,GACjB,WAAW,CAsBb;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,WAAW,GACjB,YAAY,CA0Cd"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { darkTheme } from './dark.js';
|
|
2
|
+
/** Deep-merge a partial theme into a base theme. */
|
|
3
|
+
export function resolveTheme(partial, base = darkTheme) {
|
|
4
|
+
if (!partial)
|
|
5
|
+
return base;
|
|
6
|
+
return {
|
|
7
|
+
name: partial.name ?? base.name,
|
|
8
|
+
background: partial.background ?? base.background,
|
|
9
|
+
grid: { ...base.grid, ...partial.grid },
|
|
10
|
+
node: { ...base.node, ...partial.node },
|
|
11
|
+
edge: { ...base.edge, ...partial.edge },
|
|
12
|
+
group: { ...base.group, ...partial.group },
|
|
13
|
+
breadcrumbs: { ...base.breadcrumbs, ...partial.breadcrumbs },
|
|
14
|
+
presetColors: { ...base.presetColors, ...partial.presetColors },
|
|
15
|
+
categories: { ...base.categories, ...partial.categories },
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Resolve a CanvasColor string to a fill/stroke pair.
|
|
20
|
+
*
|
|
21
|
+
* - Preset "1"-"6" → looked up in theme.presetColors
|
|
22
|
+
* - Hex string like "#FF0000" → used as stroke, fill is derived at 30% opacity
|
|
23
|
+
* - undefined → returns the theme's default node fill/stroke
|
|
24
|
+
*/
|
|
25
|
+
export function resolveColor(color, theme) {
|
|
26
|
+
if (!color) {
|
|
27
|
+
return { fill: theme.node.fill, stroke: theme.node.stroke };
|
|
28
|
+
}
|
|
29
|
+
// Preset color
|
|
30
|
+
const preset = theme.presetColors[color];
|
|
31
|
+
if (preset)
|
|
32
|
+
return preset;
|
|
33
|
+
// Hex color — use as stroke, derive a semi-transparent fill
|
|
34
|
+
if (color.startsWith('#')) {
|
|
35
|
+
const r = parseInt(color.slice(1, 3), 16);
|
|
36
|
+
const g = parseInt(color.slice(3, 5), 16);
|
|
37
|
+
const b = parseInt(color.slice(5, 7), 16);
|
|
38
|
+
return {
|
|
39
|
+
fill: `rgba(${r}, ${g}, ${b}, 0.3)`,
|
|
40
|
+
stroke: color,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
// Unknown — fallback to defaults
|
|
44
|
+
return { fill: theme.node.fill, stroke: theme.node.stroke };
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Resolve a canvas node into a fully-resolved node with all dimensions,
|
|
48
|
+
* colors, and visual properties computed from the theme.
|
|
49
|
+
*/
|
|
50
|
+
export function resolveNode(node, theme) {
|
|
51
|
+
const categoryDef = node.category
|
|
52
|
+
? theme.categories[node.category]
|
|
53
|
+
: undefined;
|
|
54
|
+
// Resolve dimensions: explicit > category > fallback
|
|
55
|
+
const width = node.width || categoryDef?.defaultWidth || 120;
|
|
56
|
+
const height = node.height || categoryDef?.defaultHeight || 60;
|
|
57
|
+
// Resolve colors: explicit color > category > theme default
|
|
58
|
+
let fill;
|
|
59
|
+
let stroke;
|
|
60
|
+
if (node.color) {
|
|
61
|
+
const resolved = resolveColor(node.color, theme);
|
|
62
|
+
fill = resolved.fill;
|
|
63
|
+
stroke = resolved.stroke;
|
|
64
|
+
}
|
|
65
|
+
else if (categoryDef) {
|
|
66
|
+
fill = categoryDef.fill;
|
|
67
|
+
stroke = categoryDef.stroke;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
fill = theme.node.fill;
|
|
71
|
+
stroke = theme.node.stroke;
|
|
72
|
+
}
|
|
73
|
+
// Resolve corner radius: category > theme default
|
|
74
|
+
const cornerRadius = categoryDef?.cornerRadius ?? theme.node.cornerRadius;
|
|
75
|
+
// Resolve icon from category
|
|
76
|
+
const icon = categoryDef?.icon ?? null;
|
|
77
|
+
return {
|
|
78
|
+
...node,
|
|
79
|
+
width,
|
|
80
|
+
height,
|
|
81
|
+
resolvedFill: fill,
|
|
82
|
+
resolvedStroke: stroke,
|
|
83
|
+
resolvedCornerRadius: cornerRadius,
|
|
84
|
+
isNavigable: node.ref != null,
|
|
85
|
+
resolvedIcon: icon,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/themes/resolve.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,oDAAoD;AACpD,MAAM,UAAU,YAAY,CAC1B,OA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AAA;QACpB,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAA;IAC1B,CAAC;SAAM,IAAI,WAAW,EAAE,CAAC;QACvB,IAAI,GAAG,WAAW,CAAC,IAAI,CAAA;QACvB,MAAM,GAAG,WAAW,CAAC,MAAM,CAAA;IAC7B,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAA;QACtB,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAA;IAC5B,CAAC;IAED,kDAAkD;IAClD,MAAM,YAAY,GAChB,WAAW,EAAE,YAAY,IAAI,KAAK,CAAC,IAAI,CAAC,YAAY,CAAA;IAEtD,6BAA6B;IAC7B,MAAM,IAAI,GAAG,WAAW,EAAE,IAAI,IAAI,IAAI,CAAA;IAEtC,OAAO;QACL,GAAG,IAAI;QACP,KAAK;QACL,MAAM;QACN,YAAY,EAAE,IAAI;QAClB,cAAc,EAAE,MAAM;QACtB,oBAAoB,EAAE,YAAY;QAClC,WAAW,EAAE,IAAI,CAAC,GAAG,IAAI,IAAI;QAC7B,YAAY,EAAE,IAAI;KACnB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warm.d.ts","sourceRoot":"","sources":["../../src/themes/warm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,WAgEvB,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Warm theme — dark warm grays, earth-tone accents.
|
|
3
|
+
* Design studio / organic aesthetic.
|
|
4
|
+
*/
|
|
5
|
+
export const warmTheme = {
|
|
6
|
+
name: 'warm',
|
|
7
|
+
background: '#1a1714',
|
|
8
|
+
grid: {
|
|
9
|
+
size: 36,
|
|
10
|
+
color: '#2a2520',
|
|
11
|
+
strokeWidth: 0.4,
|
|
12
|
+
},
|
|
13
|
+
node: {
|
|
14
|
+
fill: 'rgba(42, 37, 32, 0.6)',
|
|
15
|
+
stroke: '#8b7e6a',
|
|
16
|
+
strokeWidth: 1,
|
|
17
|
+
cornerRadius: 10,
|
|
18
|
+
labelColor: '#e8ddd0',
|
|
19
|
+
sublabelColor: '#8b7e6a',
|
|
20
|
+
fontFamily: "'IBM Plex Mono', 'Menlo', monospace",
|
|
21
|
+
fontSize: 12,
|
|
22
|
+
sublabelFontSize: 9,
|
|
23
|
+
refIndicator: {
|
|
24
|
+
icon: 'chevron',
|
|
25
|
+
color: 'rgba(139, 126, 106, 0.5)',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
edge: {
|
|
29
|
+
stroke: '#6b5e4a',
|
|
30
|
+
strokeWidth: 1.5,
|
|
31
|
+
arrowSize: 10,
|
|
32
|
+
labelColor: '#8b7e6a',
|
|
33
|
+
labelFontSize: 9,
|
|
34
|
+
},
|
|
35
|
+
group: {
|
|
36
|
+
fill: 'rgba(42, 37, 32, 0.3)',
|
|
37
|
+
stroke: '#6b5e4a',
|
|
38
|
+
strokeWidth: 1,
|
|
39
|
+
strokeDasharray: '8,4',
|
|
40
|
+
labelColor: '#8b7e6a',
|
|
41
|
+
labelFontSize: 11,
|
|
42
|
+
cornerRadius: 14,
|
|
43
|
+
},
|
|
44
|
+
breadcrumbs: {
|
|
45
|
+
background: 'rgba(26, 23, 20, 0.95)',
|
|
46
|
+
textColor: '#8b7e6a',
|
|
47
|
+
activeColor: '#e8ddd0',
|
|
48
|
+
separatorColor: '#4a4238',
|
|
49
|
+
fontFamily: "'IBM Plex Mono', monospace",
|
|
50
|
+
fontSize: 12,
|
|
51
|
+
},
|
|
52
|
+
presetColors: {
|
|
53
|
+
'1': { fill: 'rgba(160, 60, 50, 0.3)', stroke: '#c77e6a' }, // terracotta
|
|
54
|
+
'2': { fill: 'rgba(180, 120, 50, 0.3)', stroke: '#d4a060' }, // amber/honey
|
|
55
|
+
'3': { fill: 'rgba(180, 160, 60, 0.3)', stroke: '#c8b860' }, // gold
|
|
56
|
+
'4': { fill: 'rgba(80, 120, 70, 0.3)', stroke: '#8aaa70' }, // sage
|
|
57
|
+
'5': { fill: 'rgba(70, 120, 130, 0.3)', stroke: '#70a8aa' }, // teal
|
|
58
|
+
'6': { fill: 'rgba(100, 70, 120, 0.3)', stroke: '#9a80b0' }, // dusty plum
|
|
59
|
+
},
|
|
60
|
+
categories: {},
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=warm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warm.js","sourceRoot":"","sources":["../../src/themes/warm.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAgB;IACpC,IAAI,EAAE,MAAM;IAEZ,UAAU,EAAE,SAAS;IAErB,IAAI,EAAE;QACJ,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,GAAG;KACjB;IAED,IAAI,EAAE;QACJ,IAAI,EAAE,uBAAuB;QAC7B,MAAM,EAAE,SAAS;QACjB,WAAW,EAAE,CAAC;QACd,YAAY,EAAE,EAAE;QAChB,UAAU,EAAE,SAAS;QACrB,aAAa,EAAE,SAAS;QACxB,UAAU,EAAE,qCAAqC;QACjD,QAAQ,EAAE,EAAE;QACZ,gBAAgB,EAAE,CAAC;QACnB,YAAY,EAAE;YACZ,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,0BAA0B;SAClC;KACF;IAED,IAAI,EAAE;QACJ,MAAM,EAAE,SAAS;QACjB,WAAW,EAAE,GAAG;QAChB,SAAS,EAAE,EAAE;QACb,UAAU,EAAE,SAAS;QACrB,aAAa,EAAE,CAAC;KACjB;IAED,KAAK,EAAE;QACL,IAAI,EAAE,uBAAuB;QAC7B,MAAM,EAAE,SAAS;QACjB,WAAW,EAAE,CAAC;QACd,eAAe,EAAE,KAAK;QACtB,UAAU,EAAE,SAAS;QACrB,aAAa,EAAE,EAAE;QACjB,YAAY,EAAE,EAAE;KACjB;IAED,WAAW,EAAE;QACX,UAAU,EAAE,wBAAwB;QACpC,SAAS,EAAE,SAAS;QACpB,WAAW,EAAE,SAAS;QACtB,cAAc,EAAE,SAAS;QACzB,UAAU,EAAE,4BAA4B;QACxC,QAAQ,EAAE,EAAE;KACb;IAED,YAAY,EAAE;QACZ,GAAG,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAI,MAAM,EAAE,SAAS,EAAE,EAAG,aAAa;QAC5E,GAAG,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAG,MAAM,EAAE,SAAS,EAAE,EAAG,cAAc;QAC7E,GAAG,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAG,MAAM,EAAE,SAAS,EAAE,EAAG,OAAO;QACtE,GAAG,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAI,MAAM,EAAE,SAAS,EAAE,EAAG,OAAO;QACtE,GAAG,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAG,MAAM,EAAE,SAAS,EAAE,EAAG,OAAO;QACtE,GAAG,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAG,MAAM,EAAE,SAAS,EAAE,EAAG,aAAa;KAC7E;IAED,UAAU,EAAE,EAAE;CACf,CAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/** Preset color "1"-"6" or a hex string like "#FF0000" */
|
|
2
|
+
export type CanvasColor = string;
|
|
3
|
+
export type NodeType = 'text' | 'file' | 'link' | 'group';
|
|
4
|
+
export type Side = 'top' | 'right' | 'bottom' | 'left';
|
|
5
|
+
export type EndShape = 'none' | 'arrow';
|
|
6
|
+
export type EdgeStyle = 'bezier' | 'straight' | 'orthogonal';
|
|
7
|
+
export type BackgroundStyle = 'cover' | 'ratio' | 'repeat';
|
|
8
|
+
/**
|
|
9
|
+
* A node on the canvas.
|
|
10
|
+
*
|
|
11
|
+
* `width` and `height` are optional when a `category` is set — the category's
|
|
12
|
+
* default dimensions (defined in the theme) will be used as fallback.
|
|
13
|
+
*/
|
|
14
|
+
export interface CanvasNode {
|
|
15
|
+
id: string;
|
|
16
|
+
type: NodeType;
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
width?: number;
|
|
20
|
+
height?: number;
|
|
21
|
+
color?: CanvasColor;
|
|
22
|
+
category?: string;
|
|
23
|
+
ref?: string;
|
|
24
|
+
/** type: 'text' — markdown content */
|
|
25
|
+
text?: string;
|
|
26
|
+
/** type: 'file' — path to a file */
|
|
27
|
+
file?: string;
|
|
28
|
+
/** type: 'file' — subpath (heading/block), starts with # */
|
|
29
|
+
subpath?: string;
|
|
30
|
+
/** type: 'link' — URL */
|
|
31
|
+
url?: string;
|
|
32
|
+
/** type: 'group' — label text */
|
|
33
|
+
label?: string;
|
|
34
|
+
/** type: 'group' — background image path */
|
|
35
|
+
background?: string;
|
|
36
|
+
/** type: 'group' — background rendering style */
|
|
37
|
+
backgroundStyle?: BackgroundStyle;
|
|
38
|
+
}
|
|
39
|
+
/** An edge connecting two nodes. */
|
|
40
|
+
export interface CanvasEdge {
|
|
41
|
+
id: string;
|
|
42
|
+
fromNode: string;
|
|
43
|
+
fromSide?: Side;
|
|
44
|
+
fromEnd?: EndShape;
|
|
45
|
+
toNode: string;
|
|
46
|
+
toSide?: Side;
|
|
47
|
+
/** Defaults to 'arrow' */
|
|
48
|
+
toEnd?: EndShape;
|
|
49
|
+
color?: CanvasColor;
|
|
50
|
+
label?: string;
|
|
51
|
+
/** Per-edge routing style override */
|
|
52
|
+
style?: EdgeStyle;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Canvas-level theme hint. Allows a canvas document to declare
|
|
56
|
+
* a base theme and inline category definitions so that LLM-generated
|
|
57
|
+
* canvases are fully self-describing.
|
|
58
|
+
*/
|
|
59
|
+
export interface CanvasThemeHint {
|
|
60
|
+
/** Name of a built-in base theme: "dark", "midnight", "light", "blueprint", "warm" */
|
|
61
|
+
base?: string;
|
|
62
|
+
/** Inline category definitions, merged into the active theme's categories */
|
|
63
|
+
categories?: Record<string, CategoryDefinition>;
|
|
64
|
+
}
|
|
65
|
+
/** A JSON Canvas document (with system-canvas extensions). */
|
|
66
|
+
export interface CanvasData {
|
|
67
|
+
nodes?: CanvasNode[];
|
|
68
|
+
edges?: CanvasEdge[];
|
|
69
|
+
/** Optional theme hint — lets the document declare categories and a preferred base theme */
|
|
70
|
+
theme?: CanvasThemeHint;
|
|
71
|
+
}
|
|
72
|
+
export interface CategoryDefinition {
|
|
73
|
+
defaultWidth: number;
|
|
74
|
+
defaultHeight: number;
|
|
75
|
+
fill: string;
|
|
76
|
+
stroke: string;
|
|
77
|
+
cornerRadius?: number;
|
|
78
|
+
/** Icon identifier — rendered inside the node */
|
|
79
|
+
icon?: string | null;
|
|
80
|
+
}
|
|
81
|
+
export interface PresetColor {
|
|
82
|
+
fill: string;
|
|
83
|
+
stroke: string;
|
|
84
|
+
}
|
|
85
|
+
export interface GridConfig {
|
|
86
|
+
size: number;
|
|
87
|
+
color: string;
|
|
88
|
+
strokeWidth: number;
|
|
89
|
+
}
|
|
90
|
+
export interface RefIndicatorConfig {
|
|
91
|
+
icon: 'chevron' | 'arrow' | 'expand' | 'none';
|
|
92
|
+
color: string;
|
|
93
|
+
}
|
|
94
|
+
export interface NodeTheme {
|
|
95
|
+
fill: string;
|
|
96
|
+
stroke: string;
|
|
97
|
+
strokeWidth: number;
|
|
98
|
+
cornerRadius: number;
|
|
99
|
+
labelColor: string;
|
|
100
|
+
sublabelColor: string;
|
|
101
|
+
fontFamily: string;
|
|
102
|
+
fontSize: number;
|
|
103
|
+
sublabelFontSize: number;
|
|
104
|
+
refIndicator: RefIndicatorConfig;
|
|
105
|
+
}
|
|
106
|
+
export interface EdgeTheme {
|
|
107
|
+
stroke: string;
|
|
108
|
+
strokeWidth: number;
|
|
109
|
+
arrowSize: number;
|
|
110
|
+
labelColor: string;
|
|
111
|
+
labelFontSize: number;
|
|
112
|
+
}
|
|
113
|
+
export interface GroupTheme {
|
|
114
|
+
fill: string;
|
|
115
|
+
stroke: string;
|
|
116
|
+
strokeWidth: number;
|
|
117
|
+
strokeDasharray: string;
|
|
118
|
+
labelColor: string;
|
|
119
|
+
labelFontSize: number;
|
|
120
|
+
cornerRadius: number;
|
|
121
|
+
}
|
|
122
|
+
export interface BreadcrumbTheme {
|
|
123
|
+
background: string;
|
|
124
|
+
textColor: string;
|
|
125
|
+
activeColor: string;
|
|
126
|
+
separatorColor: string;
|
|
127
|
+
fontFamily: string;
|
|
128
|
+
fontSize: number;
|
|
129
|
+
}
|
|
130
|
+
export interface CanvasTheme {
|
|
131
|
+
name: string;
|
|
132
|
+
background: string;
|
|
133
|
+
grid: GridConfig;
|
|
134
|
+
node: NodeTheme;
|
|
135
|
+
edge: EdgeTheme;
|
|
136
|
+
group: GroupTheme;
|
|
137
|
+
breadcrumbs: BreadcrumbTheme;
|
|
138
|
+
/** Map preset colors "1"-"6" to fill/stroke */
|
|
139
|
+
presetColors: Record<string, PresetColor>;
|
|
140
|
+
/** Map category strings to visual definitions */
|
|
141
|
+
categories: Record<string, CategoryDefinition>;
|
|
142
|
+
}
|
|
143
|
+
/** A node with all dimensions resolved (category defaults applied). */
|
|
144
|
+
export interface ResolvedNode extends CanvasNode {
|
|
145
|
+
width: number;
|
|
146
|
+
height: number;
|
|
147
|
+
/** Resolved fill color */
|
|
148
|
+
resolvedFill: string;
|
|
149
|
+
/** Resolved stroke color */
|
|
150
|
+
resolvedStroke: string;
|
|
151
|
+
/** Resolved corner radius */
|
|
152
|
+
resolvedCornerRadius: number;
|
|
153
|
+
/** Whether this node has a sub-canvas ref */
|
|
154
|
+
isNavigable: boolean;
|
|
155
|
+
/** Resolved icon identifier (from category or null) */
|
|
156
|
+
resolvedIcon: string | null;
|
|
157
|
+
}
|
|
158
|
+
/** A computed point on a node's edge. */
|
|
159
|
+
export interface AnchorPoint {
|
|
160
|
+
x: number;
|
|
161
|
+
y: number;
|
|
162
|
+
}
|
|
163
|
+
/** Viewport transform state. */
|
|
164
|
+
export interface ViewportState {
|
|
165
|
+
x: number;
|
|
166
|
+
y: number;
|
|
167
|
+
zoom: number;
|
|
168
|
+
}
|
|
169
|
+
/** Breadcrumb entry for navigation. */
|
|
170
|
+
export interface BreadcrumbEntry {
|
|
171
|
+
label: string;
|
|
172
|
+
ref?: string;
|
|
173
|
+
}
|
|
174
|
+
/** The bounding box of all nodes on a canvas. */
|
|
175
|
+
export interface BoundingBox {
|
|
176
|
+
minX: number;
|
|
177
|
+
minY: number;
|
|
178
|
+
maxX: number;
|
|
179
|
+
maxY: number;
|
|
180
|
+
width: number;
|
|
181
|
+
height: number;
|
|
182
|
+
}
|
|
183
|
+
export interface ContextMenuEvent {
|
|
184
|
+
type: 'node' | 'edge' | 'canvas';
|
|
185
|
+
target?: CanvasNode | CanvasEdge;
|
|
186
|
+
position: {
|
|
187
|
+
x: number;
|
|
188
|
+
y: number;
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,0DAA0D;AAC1D,MAAM,MAAM,WAAW,GAAG,MAAM,CAAA;AAEhC,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AACzD,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AACtD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;AACvC,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,YAAY,CAAA;AAC5D,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAA;AAE1D;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MA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