@vanduo-oss/vd3-cbun 1.0.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/LICENSE +22 -0
  3. package/README.md +160 -0
  4. package/SKILL.md +119 -0
  5. package/dist/charts/core.d.ts +273 -0
  6. package/dist/charts/index.cjs +1828 -0
  7. package/dist/charts/index.cjs.map +7 -0
  8. package/dist/charts/index.d.ts +65 -0
  9. package/dist/charts/index.js +1805 -0
  10. package/dist/charts/index.js.map +7 -0
  11. package/dist/charts/vd3-charts.css +51 -0
  12. package/dist/charts/vue.d.ts +86 -0
  13. package/dist/flowchart/core.d.ts +288 -0
  14. package/dist/flowchart/index.cjs +3447 -0
  15. package/dist/flowchart/index.cjs.map +7 -0
  16. package/dist/flowchart/index.d.ts +54 -0
  17. package/dist/flowchart/index.js +3424 -0
  18. package/dist/flowchart/index.js.map +7 -0
  19. package/dist/flowchart/vd3-flowchart.css +600 -0
  20. package/dist/flowchart/vue.d.ts +66 -0
  21. package/dist/hex-grid/core.d.ts +200 -0
  22. package/dist/hex-grid/hex-math.cjs +162 -0
  23. package/dist/hex-grid/hex-math.cjs.map +7 -0
  24. package/dist/hex-grid/hex-math.d.ts +119 -0
  25. package/dist/hex-grid/hex-math.js +141 -0
  26. package/dist/hex-grid/hex-math.js.map +7 -0
  27. package/dist/hex-grid/index.cjs +915 -0
  28. package/dist/hex-grid/index.cjs.map +7 -0
  29. package/dist/hex-grid/index.d.ts +15 -0
  30. package/dist/hex-grid/index.js +894 -0
  31. package/dist/hex-grid/index.js.map +7 -0
  32. package/dist/hex-grid/vue.d.ts +14 -0
  33. package/dist/index.d.ts +13 -0
  34. package/dist/index.js +11 -0
  35. package/dist/index.js.map +7 -0
  36. package/dist/meta.json +551 -0
  37. package/dist/music-player/core.d.ts +88 -0
  38. package/dist/music-player/index.cjs +1227 -0
  39. package/dist/music-player/index.cjs.map +7 -0
  40. package/dist/music-player/index.d.ts +12 -0
  41. package/dist/music-player/index.js +1204 -0
  42. package/dist/music-player/index.js.map +7 -0
  43. package/dist/music-player/vd3-music-player.css +829 -0
  44. package/dist/music-player/vue.d.ts +32 -0
  45. package/package.json +105 -0
@@ -0,0 +1,288 @@
1
+ // Type definitions for the framework-agnostic flowchart editor core.
2
+ // Hand-written to mirror the runtime in ./core.js (the vanilla auto-init layer
3
+ // has been excised for the vd3-cbun bundle).
4
+
5
+ export type FlowchartNodeType =
6
+ 'rounded-rect' | 'rect' | 'diamond' | 'circle' | 'textbox' | 'label' | 'junction';
7
+
8
+ export type FlowchartPort = 'top' | 'right' | 'bottom' | 'left';
9
+ export type FlowchartEdgeMarker = 'none' | 'arrow' | 'dot';
10
+ export type FlowchartEdgeRoute = 'curve' | 'straight' | 'orthogonal';
11
+ export type FlowchartEdgeKind = 'line' | 'arrow';
12
+ export type FlowchartDirection = 'right' | 'left' | 'up' | 'down';
13
+ export type LayoutMode = 'tree' | 'radial' | 'grid';
14
+
15
+ export interface FlowchartViewport {
16
+ x: number;
17
+ y: number;
18
+ scale: number;
19
+ }
20
+
21
+ export interface FlowchartNode {
22
+ id: string;
23
+ type: FlowchartNodeType;
24
+ x: number;
25
+ y: number;
26
+ width: number;
27
+ height: number;
28
+ text: string;
29
+ data: Record<string, unknown>;
30
+ }
31
+
32
+ export interface FlowchartEndpoint {
33
+ nodeId: string;
34
+ port: FlowchartPort;
35
+ }
36
+
37
+ export interface FlowchartEdge {
38
+ id: string;
39
+ from: FlowchartEndpoint;
40
+ to: FlowchartEndpoint;
41
+ kind: FlowchartEdgeKind;
42
+ startMarker: FlowchartEdgeMarker;
43
+ endMarker: FlowchartEdgeMarker;
44
+ strokeWidth: number;
45
+ route: FlowchartEdgeRoute;
46
+ label: string;
47
+ data: Record<string, unknown>;
48
+ }
49
+
50
+ export interface FlowchartDocument {
51
+ version: string;
52
+ viewport: FlowchartViewport;
53
+ nodes: FlowchartNode[];
54
+ edges: FlowchartEdge[];
55
+ }
56
+
57
+ /** Snapshot delivered by the `select` event and `getSelectionSnapshot()`. */
58
+ export type FlowchartSelection =
59
+ | { kind: 'node'; id: string; node: FlowchartNode }
60
+ | { kind: 'edge'; id: string; edge: FlowchartEdge };
61
+
62
+ /** Reference to an anchor node for relative placement. */
63
+ export interface FlowchartRelativeTo {
64
+ node?: string;
65
+ nodeId?: string;
66
+ id?: string;
67
+ direction?: FlowchartDirection;
68
+ distance?: number;
69
+ /** Angle in degrees, screen space (0 = right, 90 = down). Overrides direction. */
70
+ angle?: number;
71
+ }
72
+
73
+ export interface FlowchartNodeInput {
74
+ id?: string;
75
+ type?: FlowchartNodeType;
76
+ x?: number;
77
+ y?: number;
78
+ width?: number;
79
+ height?: number;
80
+ text?: string;
81
+ data?: Record<string, unknown>;
82
+ /** Place relative to another node instead of at the viewport center. */
83
+ relativeTo?: string | FlowchartRelativeTo;
84
+ }
85
+
86
+ export interface FlowchartEndpointInput {
87
+ nodeId?: string;
88
+ port?: FlowchartPort;
89
+ }
90
+
91
+ export interface FlowchartEdgeInput {
92
+ id?: string;
93
+ from?: string | FlowchartEndpointInput;
94
+ to?: string | FlowchartEndpointInput;
95
+ /** Infer omitted ports from node geometry. */
96
+ autoPort?: boolean;
97
+ kind?: FlowchartEdgeKind;
98
+ startMarker?: FlowchartEdgeMarker;
99
+ endMarker?: FlowchartEdgeMarker;
100
+ strokeWidth?: number;
101
+ route?: FlowchartEdgeRoute;
102
+ label?: string;
103
+ data?: Record<string, unknown>;
104
+ }
105
+
106
+ export interface AddChildNodeOptions extends FlowchartNodeInput {
107
+ direction?: FlowchartDirection;
108
+ distance?: number;
109
+ angle?: number;
110
+ /** Extra options merged into the parent → child edge. */
111
+ edge?: FlowchartEdgeInput;
112
+ }
113
+
114
+ export interface LayoutOptions {
115
+ /** Force a specific root node id; defaults to nodes with no incoming edges. */
116
+ root?: string;
117
+ direction?: FlowchartDirection;
118
+ levelGap?: number;
119
+ siblingGap?: number;
120
+ radius?: number;
121
+ columns?: number;
122
+ gap?: number;
123
+ /** Re-pick edge ports after moving nodes (default true). */
124
+ reroutePorts?: boolean;
125
+ /** Call fitView() after arranging. */
126
+ fit?: boolean;
127
+ }
128
+
129
+ export interface MutationOptions {
130
+ reason?: string;
131
+ inspector?: boolean;
132
+ }
133
+
134
+ export interface LoadOptions {
135
+ /** Keep the prior selection if the entity still exists after load. */
136
+ preserveSelection?: boolean;
137
+ }
138
+
139
+ export interface RemoveNodeOptions {
140
+ /** Also remove every node reachable through outgoing edges (cycle-safe). */
141
+ cascade?: boolean;
142
+ reason?: string;
143
+ }
144
+
145
+ export interface FlowchartChangeEvent {
146
+ reason: string;
147
+ document: FlowchartDocument;
148
+ node?: FlowchartNode;
149
+ edge?: FlowchartEdge;
150
+ nodeId?: string;
151
+ nodeIds?: string[];
152
+ edgeId?: string;
153
+ mode?: LayoutMode;
154
+ }
155
+
156
+ export interface FlowchartSelectEvent {
157
+ selection: FlowchartSelection | null;
158
+ }
159
+
160
+ export interface FlowchartViewportEvent {
161
+ reason: string;
162
+ viewport: FlowchartViewport;
163
+ document: FlowchartDocument;
164
+ }
165
+
166
+ export interface FlowchartConnectEvent {
167
+ edge: FlowchartEdge;
168
+ }
169
+
170
+ export interface FlowchartHistoryEvent {
171
+ reason: string;
172
+ canUndo: boolean;
173
+ canRedo: boolean;
174
+ }
175
+
176
+ export interface FlowchartEventMap {
177
+ change: FlowchartChangeEvent;
178
+ select: FlowchartSelectEvent;
179
+ viewport: FlowchartViewportEvent;
180
+ connect: FlowchartConnectEvent;
181
+ history: FlowchartHistoryEvent;
182
+ ready: VdFlowchart;
183
+ }
184
+
185
+ export interface VdFlowchartOptions {
186
+ element?: Element | string;
187
+ /** Alias for `element`. */
188
+ target?: Element | string;
189
+ data?: Partial<FlowchartDocument> | string;
190
+ readonly?: boolean;
191
+ gridSize?: number;
192
+ /** Fit to content once the canvas reports a measurable size. */
193
+ autoFit?: boolean;
194
+ /** Enable built-in undo/redo (default true). */
195
+ history?: boolean;
196
+ /** Maximum retained history entries (default 100). */
197
+ historyLimit?: number;
198
+ }
199
+
200
+ export class VdFlowchart {
201
+ constructor(options?: VdFlowchartOptions);
202
+
203
+ readonly element: Element;
204
+ readonly readonly: boolean;
205
+ readonly gridSize: number;
206
+
207
+ // Selection
208
+ select(selection: { kind: 'node' | 'edge'; id: string } | null): void;
209
+ selectNode(nodeId: string): this;
210
+ selectEdge(edgeId: string): this;
211
+ deselect(): this;
212
+
213
+ // Events
214
+ on<K extends keyof FlowchartEventMap>(
215
+ event: K,
216
+ callback: (payload: FlowchartEventMap[K]) => void,
217
+ ): this;
218
+ off<K extends keyof FlowchartEventMap>(
219
+ event: K,
220
+ callback: (payload: FlowchartEventMap[K]) => void,
221
+ ): this;
222
+
223
+ // Nodes & edges
224
+ addNode(partialNode?: FlowchartNodeInput): FlowchartNode;
225
+ addChildNode(
226
+ parentId: string,
227
+ options?: AddChildNodeOptions,
228
+ ): { node: FlowchartNode; edge: FlowchartEdge | null } | null;
229
+ updateNode(
230
+ nodeId: string,
231
+ patch?: Partial<FlowchartNodeInput>,
232
+ options?: MutationOptions,
233
+ ): FlowchartNode | null;
234
+ removeNode(nodeId: string, options?: RemoveNodeOptions): boolean;
235
+ addEdge(partialEdge?: FlowchartEdgeInput): FlowchartEdge | null;
236
+ updateEdge(
237
+ edgeId: string,
238
+ patch?: FlowchartEdgeInput,
239
+ options?: MutationOptions,
240
+ ): FlowchartEdge | null;
241
+ removeEdge(edgeId: string): boolean;
242
+ deleteSelection(): boolean;
243
+
244
+ // Layout
245
+ layout(mode?: LayoutMode, options?: LayoutOptions): this;
246
+ autoArrange(options?: LayoutOptions): this;
247
+
248
+ // History
249
+ undo(): this;
250
+ redo(): this;
251
+ canUndo(): boolean;
252
+ canRedo(): boolean;
253
+ clearHistory(): this;
254
+
255
+ // Viewport
256
+ setViewport(viewport: Partial<FlowchartViewport>): this;
257
+ zoomIn(): this;
258
+ zoomOut(): this;
259
+ resetView(): this;
260
+ fitView(): this;
261
+
262
+ // Document
263
+ clear(): this;
264
+ load(data: Partial<FlowchartDocument> | string, options?: LoadOptions): this;
265
+ toJSON(): FlowchartDocument;
266
+
267
+ // Text editing
268
+ startTextEdit(nodeId: string): boolean;
269
+ stopTextEdit(options?: { commit?: boolean }): void;
270
+
271
+ // Lifecycle
272
+ destroy(): void;
273
+ }
274
+
275
+ /** Pure layout helper: computes node top-left positions without mutating input. */
276
+ export function computeLayout(
277
+ documentData: Partial<FlowchartDocument>,
278
+ mode?: LayoutMode,
279
+ options?: LayoutOptions,
280
+ ): Map<string, { x: number; y: number }>;
281
+
282
+ export const LAYOUT_MODES: readonly LayoutMode[];
283
+
284
+ export const VD_FLOWCHART_VERSION: string;
285
+ export const FLOWCHART_NODE_TYPES: readonly FlowchartNodeType[];
286
+ export const FLOWCHART_PORTS: readonly FlowchartPort[];
287
+ export const FLOWCHART_EDGE_MARKERS: readonly FlowchartEdgeMarker[];
288
+ export const FLOWCHART_EDGE_ROUTES: readonly FlowchartEdgeRoute[];