@getartisanflow/alpineflow 0.1.0-alpha

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 (196) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +88 -0
  3. package/dist/alpineflow-collab.esm.js +465 -0
  4. package/dist/alpineflow-collab.esm.js.map +1 -0
  5. package/dist/alpineflow-collab.js +247 -0
  6. package/dist/alpineflow-collab.js.map +1 -0
  7. package/dist/alpineflow-dagre.esm.js +1661 -0
  8. package/dist/alpineflow-dagre.esm.js.map +1 -0
  9. package/dist/alpineflow-dagre.js +1655 -0
  10. package/dist/alpineflow-dagre.js.map +1 -0
  11. package/dist/alpineflow-elk.esm.js +47378 -0
  12. package/dist/alpineflow-elk.esm.js.map +1 -0
  13. package/dist/alpineflow-elk.js +47373 -0
  14. package/dist/alpineflow-elk.js.map +1 -0
  15. package/dist/alpineflow-force.esm.js +599 -0
  16. package/dist/alpineflow-force.esm.js.map +1 -0
  17. package/dist/alpineflow-force.js +477 -0
  18. package/dist/alpineflow-force.js.map +1 -0
  19. package/dist/alpineflow-hierarchy.esm.js +398 -0
  20. package/dist/alpineflow-hierarchy.esm.js.map +1 -0
  21. package/dist/alpineflow-hierarchy.js +393 -0
  22. package/dist/alpineflow-hierarchy.js.map +1 -0
  23. package/dist/alpineflow-theme.css +473 -0
  24. package/dist/alpineflow-whiteboard.esm.js +922 -0
  25. package/dist/alpineflow-whiteboard.esm.js.map +1 -0
  26. package/dist/alpineflow-whiteboard.js +922 -0
  27. package/dist/alpineflow-whiteboard.js.map +1 -0
  28. package/dist/alpineflow.bundle.esm.js +12604 -0
  29. package/dist/alpineflow.bundle.esm.js.map +1 -0
  30. package/dist/alpineflow.css +1415 -0
  31. package/dist/alpineflow.esm.js +158 -0
  32. package/dist/alpineflow.esm.js.map +1 -0
  33. package/dist/alpineflow.js +5 -0
  34. package/dist/alpineflow.js.map +1 -0
  35. package/dist/export-DjmXOnKD.js +76 -0
  36. package/dist/export-DjmXOnKD.js.map +1 -0
  37. package/dist/geometry-DZSZoYHE.js +82 -0
  38. package/dist/geometry-DZSZoYHE.js.map +1 -0
  39. package/dist/index-C0N1DL3G.js +11728 -0
  40. package/dist/index-C0N1DL3G.js.map +1 -0
  41. package/dist/index-L3Zm-CoX.js +513 -0
  42. package/dist/index-L3Zm-CoX.js.map +1 -0
  43. package/dist/registry-CChkuoVJ.js +15 -0
  44. package/dist/registry-CChkuoVJ.js.map +1 -0
  45. package/dist/store-CaFAFEdD.js +9 -0
  46. package/dist/store-CaFAFEdD.js.map +1 -0
  47. package/dist/timer-B39XOBYL.js +124 -0
  48. package/dist/timer-B39XOBYL.js.map +1 -0
  49. package/dist/types/lib/collab.cdn.d.ts +1 -0
  50. package/dist/types/lib/collab.d.ts +2 -0
  51. package/dist/types/lib/core.cdn.d.ts +1 -0
  52. package/dist/types/lib/core.d.ts +2 -0
  53. package/dist/types/lib/dagre.cdn.d.ts +1 -0
  54. package/dist/types/lib/dagre.d.ts +1 -0
  55. package/dist/types/lib/elk.cdn.d.ts +1 -0
  56. package/dist/types/lib/elk.d.ts +1 -0
  57. package/dist/types/lib/force.cdn.d.ts +1 -0
  58. package/dist/types/lib/force.d.ts +1 -0
  59. package/dist/types/lib/hierarchy.cdn.d.ts +1 -0
  60. package/dist/types/lib/hierarchy.d.ts +1 -0
  61. package/dist/types/lib/whiteboard.cdn.d.ts +1 -0
  62. package/dist/types/lib/whiteboard.d.ts +1 -0
  63. package/dist/types/src/animate/animator.d.ts +57 -0
  64. package/dist/types/src/animate/easing.d.ts +4 -0
  65. package/dist/types/src/animate/edge-transitions.d.ts +22 -0
  66. package/dist/types/src/animate/engine.d.ts +37 -0
  67. package/dist/types/src/animate/index.d.ts +10 -0
  68. package/dist/types/src/animate/interpolators.d.ts +14 -0
  69. package/dist/types/src/animate/paths.d.ts +64 -0
  70. package/dist/types/src/animate/timeline.d.ts +149 -0
  71. package/dist/types/src/collab/awareness.d.ts +40 -0
  72. package/dist/types/src/collab/bridge.d.ts +36 -0
  73. package/dist/types/src/collab/directives/flow-cursors.d.ts +16 -0
  74. package/dist/types/src/collab/index.d.ts +19 -0
  75. package/dist/types/src/collab/providers/in-memory.d.ts +41 -0
  76. package/dist/types/src/collab/providers/reverb.d.ts +59 -0
  77. package/dist/types/src/collab/providers/websocket.d.ts +33 -0
  78. package/dist/types/src/collab/store.d.ts +22 -0
  79. package/dist/types/src/collab/types.d.ts +55 -0
  80. package/dist/types/src/core/__fixtures__/nodes.d.ts +42 -0
  81. package/dist/types/src/core/announcer.d.ts +21 -0
  82. package/dist/types/src/core/auto-pan.d.ts +37 -0
  83. package/dist/types/src/core/child-layout.d.ts +18 -0
  84. package/dist/types/src/core/child-validation.d.ts +23 -0
  85. package/dist/types/src/core/clipboard.d.ts +29 -0
  86. package/dist/types/src/core/collapse.d.ts +54 -0
  87. package/dist/types/src/core/color-mode.d.ts +11 -0
  88. package/dist/types/src/core/compute.d.ts +33 -0
  89. package/dist/types/src/core/connections.d.ts +32 -0
  90. package/dist/types/src/core/constants.d.ts +18 -0
  91. package/dist/types/src/core/controls-panel.d.ts +23 -0
  92. package/dist/types/src/core/debug.d.ts +10 -0
  93. package/dist/types/src/core/deep-merge.d.ts +10 -0
  94. package/dist/types/src/core/drag.d.ts +63 -0
  95. package/dist/types/src/core/edge-paths/avoidant.d.ts +25 -0
  96. package/dist/types/src/core/edge-paths/bezier.d.ts +26 -0
  97. package/dist/types/src/core/edge-paths/editable.d.ts +22 -0
  98. package/dist/types/src/core/edge-paths/index.d.ts +7 -0
  99. package/dist/types/src/core/edge-paths/orthogonal.d.ts +27 -0
  100. package/dist/types/src/core/edge-paths/smoothstep.d.ts +22 -0
  101. package/dist/types/src/core/edge-paths/straight.d.ts +12 -0
  102. package/dist/types/src/core/edge-paths/utils.d.ts +30 -0
  103. package/dist/types/src/core/edge-utils.d.ts +57 -0
  104. package/dist/types/src/core/export.d.ts +12 -0
  105. package/dist/types/src/core/floating-edge.d.ts +33 -0
  106. package/dist/types/src/core/geometry.d.ts +79 -0
  107. package/dist/types/src/core/gradients.d.ts +30 -0
  108. package/dist/types/src/core/graph.d.ts +38 -0
  109. package/dist/types/src/core/helper-lines.d.ts +32 -0
  110. package/dist/types/src/core/history.d.ts +19 -0
  111. package/dist/types/src/core/index.d.ts +17 -0
  112. package/dist/types/src/core/intersection.d.ts +30 -0
  113. package/dist/types/src/core/keyboard-shortcuts.d.ts +45 -0
  114. package/dist/types/src/core/lasso-hit-test.d.ts +25 -0
  115. package/dist/types/src/core/lasso.d.ts +10 -0
  116. package/dist/types/src/core/layout/dagre.d.ts +11 -0
  117. package/dist/types/src/core/layout/elk.d.ts +13 -0
  118. package/dist/types/src/core/layout/force.d.ts +15 -0
  119. package/dist/types/src/core/layout/hierarchy.d.ts +13 -0
  120. package/dist/types/src/core/long-press.d.ts +11 -0
  121. package/dist/types/src/core/markers.d.ts +49 -0
  122. package/dist/types/src/core/minimap.d.ts +18 -0
  123. package/dist/types/src/core/node-flags.d.ts +19 -0
  124. package/dist/types/src/core/pan-zoom.d.ts +62 -0
  125. package/dist/types/src/core/proximity-connect.d.ts +25 -0
  126. package/dist/types/src/core/registry.d.ts +16 -0
  127. package/dist/types/src/core/render-plan.d.ts +52 -0
  128. package/dist/types/src/core/resize.d.ts +31 -0
  129. package/dist/types/src/core/rotation.d.ts +8 -0
  130. package/dist/types/src/core/selection-box.d.ts +14 -0
  131. package/dist/types/src/core/shapes.d.ts +10 -0
  132. package/dist/types/src/core/sub-flow.d.ts +61 -0
  133. package/dist/types/src/core/svg-path.d.ts +5 -0
  134. package/dist/types/src/core/types.d.ts +1238 -0
  135. package/dist/types/src/core/wire-bridge.d.ts +36 -0
  136. package/dist/types/src/index.d.ts +43 -0
  137. package/dist/types/src/layout/dagre.d.ts +2 -0
  138. package/dist/types/src/layout/elk.d.ts +2 -0
  139. package/dist/types/src/layout/force.d.ts +2 -0
  140. package/dist/types/src/layout/hierarchy.d.ts +2 -0
  141. package/dist/types/src/plugin/connection-utils.d.ts +54 -0
  142. package/dist/types/src/plugin/data/__test-utils.d.ts +9 -0
  143. package/dist/types/src/plugin/data/canvas-animation.d.ts +62 -0
  144. package/dist/types/src/plugin/data/canvas-collapse.d.ts +35 -0
  145. package/dist/types/src/plugin/data/canvas-compute.d.ts +6 -0
  146. package/dist/types/src/plugin/data/canvas-condense.d.ts +19 -0
  147. package/dist/types/src/plugin/data/canvas-config.d.ts +4 -0
  148. package/dist/types/src/plugin/data/canvas-context.d.ts +570 -0
  149. package/dist/types/src/plugin/data/canvas-dom.d.ts +13 -0
  150. package/dist/types/src/plugin/data/canvas-edges.d.ts +37 -0
  151. package/dist/types/src/plugin/data/canvas-history.d.ts +53 -0
  152. package/dist/types/src/plugin/data/canvas-layout.d.ts +151 -0
  153. package/dist/types/src/plugin/data/canvas-nodes.d.ts +73 -0
  154. package/dist/types/src/plugin/data/canvas-rows.d.ts +13 -0
  155. package/dist/types/src/plugin/data/canvas-selection.d.ts +45 -0
  156. package/dist/types/src/plugin/data/canvas-validation.d.ts +21 -0
  157. package/dist/types/src/plugin/data/canvas-viewport.d.ts +111 -0
  158. package/dist/types/src/plugin/data/flow-canvas.d.ts +2 -0
  159. package/dist/types/src/plugin/directives/flow-action.d.ts +12 -0
  160. package/dist/types/src/plugin/directives/flow-animate.d.ts +2 -0
  161. package/dist/types/src/plugin/directives/flow-arrow-draw.d.ts +2 -0
  162. package/dist/types/src/plugin/directives/flow-circle-draw.d.ts +2 -0
  163. package/dist/types/src/plugin/directives/flow-collapse.d.ts +2 -0
  164. package/dist/types/src/plugin/directives/flow-condense.d.ts +2 -0
  165. package/dist/types/src/plugin/directives/flow-context-menu.d.ts +2 -0
  166. package/dist/types/src/plugin/directives/flow-detail.d.ts +2 -0
  167. package/dist/types/src/plugin/directives/flow-devtools.d.ts +2 -0
  168. package/dist/types/src/plugin/directives/flow-drag-handle.d.ts +2 -0
  169. package/dist/types/src/plugin/directives/flow-draggable.d.ts +2 -0
  170. package/dist/types/src/plugin/directives/flow-edge-toolbar.d.ts +2 -0
  171. package/dist/types/src/plugin/directives/flow-edge.d.ts +7 -0
  172. package/dist/types/src/plugin/directives/flow-eraser.d.ts +2 -0
  173. package/dist/types/src/plugin/directives/flow-filter.d.ts +9 -0
  174. package/dist/types/src/plugin/directives/flow-follow.d.ts +9 -0
  175. package/dist/types/src/plugin/directives/flow-freehand.d.ts +2 -0
  176. package/dist/types/src/plugin/directives/flow-handle-connectable.d.ts +12 -0
  177. package/dist/types/src/plugin/directives/flow-handle-limit.d.ts +9 -0
  178. package/dist/types/src/plugin/directives/flow-handle-validate.d.ts +10 -0
  179. package/dist/types/src/plugin/directives/flow-handle.d.ts +29 -0
  180. package/dist/types/src/plugin/directives/flow-highlighter.d.ts +2 -0
  181. package/dist/types/src/plugin/directives/flow-loading.d.ts +2 -0
  182. package/dist/types/src/plugin/directives/flow-node-toolbar.d.ts +2 -0
  183. package/dist/types/src/plugin/directives/flow-node.d.ts +10 -0
  184. package/dist/types/src/plugin/directives/flow-panel.d.ts +2 -0
  185. package/dist/types/src/plugin/directives/flow-rectangle-draw.d.ts +2 -0
  186. package/dist/types/src/plugin/directives/flow-resizer.d.ts +2 -0
  187. package/dist/types/src/plugin/directives/flow-rotate.d.ts +11 -0
  188. package/dist/types/src/plugin/directives/flow-row-select.d.ts +2 -0
  189. package/dist/types/src/plugin/directives/flow-snapshot.d.ts +14 -0
  190. package/dist/types/src/plugin/directives/flow-text-tool.d.ts +2 -0
  191. package/dist/types/src/plugin/directives/flow-timeline.d.ts +2 -0
  192. package/dist/types/src/plugin/directives/flow-viewport.d.ts +2 -0
  193. package/dist/types/src/plugin/magics/flow.d.ts +2 -0
  194. package/dist/types/src/plugin/store.d.ts +2 -0
  195. package/dist/types/src/whiteboard/index.d.ts +2 -0
  196. package/package.json +153 -0
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Wire Bridge — Livewire <-> AlpineFlow integration.
3
+ *
4
+ * Dynamically imported by flowCanvas when $wire is detected.
5
+ * Maps AlpineFlow events to $wire method calls (client->server)
6
+ * and Livewire dispatches to canvas methods (server->client).
7
+ */
8
+ /**
9
+ * Maps event names to functions that extract positional arguments
10
+ * from the event detail object. These args are spread into $wire.method(...args).
11
+ */
12
+ export declare const WIRE_PAYLOAD_MAP: Record<string, (d: any) => any[]>;
13
+ /**
14
+ * Maps Livewire dispatch event names to flowCanvas method names.
15
+ * All commands are auto-registered when $wire is detected.
16
+ */
17
+ export declare const WIRE_COMMAND_MAP: Record<string, string>;
18
+ /**
19
+ * Register convenience commands that compose multiple canvas operations.
20
+ * Returns a cleanup function.
21
+ */
22
+ export declare function registerCustomWireCommands(canvas: any, $wire: any): () => void;
23
+ /**
24
+ * Register config callbacks that bridge AlpineFlow events to $wire method calls.
25
+ * Modifies the config object in-place, adding onXxx callbacks.
26
+ *
27
+ * @param config - The flowCanvas config object (mutated)
28
+ * @param $wire - Livewire's $wire proxy
29
+ * @param wireEvents - Map of event names to Livewire method names
30
+ */
31
+ export declare function registerWireEvents(config: any, $wire: any, wireEvents: Record<string, string>): void;
32
+ /**
33
+ * Register $wire.on() listeners for all server->client commands.
34
+ * Returns a cleanup function that deregisters all listeners.
35
+ */
36
+ export declare function registerWireCommands(canvas: any, $wire: any): () => void;
@@ -0,0 +1,43 @@
1
+ import type { Alpine } from 'alpinejs';
2
+ /**
3
+ * The Alpine.js plugin function.
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * import Alpine from 'alpinejs';
8
+ * import AlpineFlow from 'alpinejs-flow';
9
+ *
10
+ * Alpine.plugin(AlpineFlow);
11
+ * Alpine.start();
12
+ * ```
13
+ */
14
+ export default function AlpineFlow(Alpine: Alpine): void;
15
+ export type { FlowNode, FlowEdge, Viewport, XYPosition, CoordinateExtent, FlowCanvasConfig, FlowInstance, Connection, ConnectionLineProps, HandlePosition, HandleType, EdgeType, } from './core/types';
16
+ export type { MarkerType, MarkerConfig, CustomMarkerRenderer } from './core/markers';
17
+ export { registerMarker } from './core/markers';
18
+ export { getBezierPath, getSimpleBezierPath, getSmoothStepPath, getStepPath, getStraightPath, } from './core/edge-paths';
19
+ export { getNodesBounds, getViewportForBounds, getNodesInRect, getNodesFullyInRect } from './core/geometry';
20
+ export { getConnectedEdges, getOutgoers, getIncomers, areNodesConnected } from './core/graph';
21
+ export { ComputeEngine, type ComputeDefinition } from './core/compute';
22
+ export { getNodeIntersection, getEdgePosition, getFloatingEdgeParams, getSimpleFloatingPosition, } from './core/floating-edge';
23
+ export type { DagreDirection, DagreLayoutOptions } from './core/layout/dagre';
24
+ export type { ForceLayoutOptions } from './core/layout/force';
25
+ export type { ElkAlgorithm, ElkDirection, ElkLayoutOptions } from './core/layout/elk';
26
+ export type { HierarchyLayoutType, HierarchyDirection, HierarchyLayoutOptions } from './core/layout/hierarchy';
27
+ export { buildNodeMap, getAbsolutePosition, toAbsoluteNode, toAbsoluteNodes, getDescendantIds, sortNodesTopological, computeZIndex, clampToExtent, clampToParent, expandParentToFitChild, } from './core/sub-flow';
28
+ export type { PathFunction, OrbitConfig, WaveConfig, AlongConfig, PendulumConfig, DriftConfig } from './animate/paths';
29
+ export { orbit, wave, along, pendulum, drift, stagger } from './animate/paths';
30
+ export { FlowHistory, type HistorySnapshot } from './core/history';
31
+ export type { ResizeDirection, ResizeConstraints } from './core/resize';
32
+ export type { ControlsPanelInstance } from './core/controls-panel';
33
+ export type { SelectionBoxInstance } from './core/selection-box';
34
+ export type { LassoInstance } from './core/lasso';
35
+ export { pointInPolygon, polygonIntersectsAABB, getNodesInPolygon, getNodesFullyInPolygon } from './core/lasso-hit-test';
36
+ export type { AutoPanInstance } from './core/auto-pan';
37
+ export { getAutoPanDelta } from './core/auto-pan';
38
+ export { computeRenderPlan, type RenderPlan, type RenderPlanConfig, type RenderPlanNode, type RenderPlanEdge } from './core/render-plan';
39
+ export type { KeyboardShortcuts, KeyCode } from './core/keyboard-shortcuts';
40
+ export { SHORTCUT_DEFAULTS, resolveShortcuts, matchesKey, matchesModifier } from './core/keyboard-shortcuts';
41
+ export type { ChildValidation, ChildValidationResult, ChildValidationFailDetail } from './core/types';
42
+ export { resolveChildValidation, validateChildAdd, validateChildRemove, computeValidationErrors } from './core/child-validation';
43
+ export { isDraggable, isDeletable, isConnectable, isSelectable, isResizable } from './core/node-flags';
@@ -0,0 +1,2 @@
1
+ import type { Alpine } from 'alpinejs';
2
+ export default function AlpineFlowDagre(_Alpine: Alpine): void;
@@ -0,0 +1,2 @@
1
+ import type { Alpine } from 'alpinejs';
2
+ export default function AlpineFlowElk(_Alpine: Alpine): void;
@@ -0,0 +1,2 @@
1
+ import type { Alpine } from 'alpinejs';
2
+ export default function AlpineFlowForce(_Alpine: Alpine): void;
@@ -0,0 +1,2 @@
1
+ import type { Alpine } from 'alpinejs';
2
+ export default function AlpineFlowHierarchy(_Alpine: Alpine): void;
@@ -0,0 +1,54 @@
1
+ import type { XYPosition, ConnectionLineProps, FlowCanvasConfig } from '../core/types';
2
+ import { type AutoPanInstance } from '../core/auto-pan';
3
+ /**
4
+ * Updatable connection line instance returned by `createConnectionLine()`.
5
+ * Supports preset path types (straight, bezier, smoothstep, step) and a
6
+ * fully custom SVG renderer callback.
7
+ */
8
+ export interface ConnectionLineInstance {
9
+ svg: SVGSVGElement;
10
+ update(props: Omit<ConnectionLineProps, 'connectionLineType' | 'connectionLineStyle'>): void;
11
+ destroy(): void;
12
+ }
13
+ /**
14
+ * Create a connection line with configurable path type, style, and optional
15
+ * custom renderer. Returns an updatable instance whose `update()` method
16
+ * recomputes the SVG path from new coordinates.
17
+ */
18
+ export declare function createConnectionLine(config: {
19
+ connectionLineType?: FlowCanvasConfig['connectionLineType'];
20
+ connectionLineStyle?: FlowCanvasConfig['connectionLineStyle'];
21
+ connectionLine?: FlowCanvasConfig['connectionLine'];
22
+ invalid?: boolean;
23
+ containerEl?: HTMLElement;
24
+ }): ConnectionLineInstance;
25
+ /**
26
+ * Find the closest connectable handle within a snap radius.
27
+ *
28
+ * Queries the container for all handles of the given type, skips handles on
29
+ * the excluded node and non-connectable nodes, then returns the closest one
30
+ * (if any) along with its flow-space position.
31
+ */
32
+ export declare function findSnapTarget(params: {
33
+ containerEl: HTMLElement;
34
+ handleType: 'source' | 'target';
35
+ excludeNodeId: string;
36
+ cursorFlowPos: XYPosition;
37
+ connectionSnapRadius: number;
38
+ getNode: (id: string) => {
39
+ connectable?: boolean;
40
+ locked?: boolean;
41
+ } | undefined;
42
+ toFlowPosition: (screenX: number, screenY: number) => XYPosition;
43
+ targetNodeId?: string;
44
+ connectionMode?: 'strict' | 'loose';
45
+ }): {
46
+ element: HTMLElement | null;
47
+ position: XYPosition;
48
+ };
49
+ /**
50
+ * Start auto-pan behavior for a connection drag. Returns the AutoPanInstance
51
+ * (or null if auto-pan is disabled via config). The instance should be stopped
52
+ * when the drag ends.
53
+ */
54
+ export declare function startConnectionAutoPan(containerEl: HTMLElement, canvas: Record<string, any>, clientX: number, clientY: number): AutoPanInstance | null;
@@ -0,0 +1,9 @@
1
+ import type { CanvasContext } from './canvas-context';
2
+ /**
3
+ * Create a mock CanvasContext with sensible defaults for unit tests.
4
+ *
5
+ * All internal helper methods are stubbed with `vi.fn()`.
6
+ * Pass `overrides` to customize specific properties or provide
7
+ * pre-populated nodes/edges/maps.
8
+ */
9
+ export declare function mockCtx(overrides?: Partial<CanvasContext>): CanvasContext;
@@ -0,0 +1,62 @@
1
+ import type { CanvasContext } from './canvas-context';
2
+ import type { XYPosition, AnimateTargets, AnimateOptions, FlowAnimationHandle, FollowOptions, ParticleHandle } from '../../core/types';
3
+ import { FlowTimeline } from '../../animate/timeline';
4
+ export declare function createAnimationMixin(ctx: CanvasContext): {
5
+ /**
6
+ * Synchronize the `_animationLocked` flag from active timelines and
7
+ * manage history suspension while any timeline is playing.
8
+ */
9
+ _syncAnimationState(): void;
10
+ /**
11
+ * Create a new FlowTimeline wired to this canvas. Lock flag and
12
+ * history suspension are automatically managed via timeline events.
13
+ */
14
+ timeline(): FlowTimeline;
15
+ /**
16
+ * Register a named animation (used by x-flow-animate directive).
17
+ */
18
+ registerAnimation(name: string, steps: any[]): void;
19
+ /**
20
+ * Unregister a named animation.
21
+ */
22
+ unregisterAnimation(name: string): void;
23
+ /**
24
+ * Play a named animation registered via x-flow-animate directive.
25
+ */
26
+ playAnimation(name: string): Promise<void>;
27
+ /**
28
+ * Update nodes, edges, and/or the viewport.
29
+ *
30
+ * The core method for applying property changes. When duration is 0
31
+ * (the default), changes are applied instantly via DOM flushing.
32
+ * When duration > 0, transitions are delegated to the Animator for
33
+ * frame-by-frame interpolation.
34
+ *
35
+ * Use `animate()` for a convenience wrapper that defaults to smooth
36
+ * transitions (duration: 300ms).
37
+ */
38
+ update(targets: AnimateTargets, options?: AnimateOptions): FlowAnimationHandle;
39
+ /**
40
+ * Animate nodes, edges, and/or the viewport with smooth transitions.
41
+ *
42
+ * Convenience wrapper around `update()` that defaults to 300ms duration.
43
+ * Pass `duration: 0` for instant changes, or use `update()` directly.
44
+ */
45
+ animate(targets: AnimateTargets, options?: AnimateOptions): FlowAnimationHandle;
46
+ /**
47
+ * Track a target with the viewport camera. The target can be a node ID,
48
+ * a ParticleHandle, an animation handle, or a static XYPosition.
49
+ * The viewport smoothly follows via engine tick with linear interpolation.
50
+ */
51
+ follow(target: string | FlowAnimationHandle | ParticleHandle | XYPosition, options?: FollowOptions): FlowAnimationHandle;
52
+ /**
53
+ * Engine tick callback — processes all active particles in one pass.
54
+ * Returns true to unregister from engine when all particles are done.
55
+ */
56
+ _tickParticles(): boolean;
57
+ /**
58
+ * Fire a particle along an edge path. The particle is an SVG circle
59
+ * that follows the edge's `<path>` element using `getPointAtLength`.
60
+ */
61
+ sendParticle(edgeId: string, options?: Record<string, any>): ParticleHandle | undefined;
62
+ };
@@ -0,0 +1,35 @@
1
+ import type { CanvasContext } from './canvas-context';
2
+ export declare function createCollapseMixin(ctx: CanvasContext): {
3
+ /**
4
+ * Collapse a node — hide its descendants/outgoers and optionally animate.
5
+ */
6
+ collapseNode(id: string, options?: {
7
+ animate?: boolean;
8
+ recursive?: boolean;
9
+ }): void;
10
+ /**
11
+ * Expand a previously collapsed node — restore descendants/outgoers.
12
+ */
13
+ expandNode(id: string, options?: {
14
+ animate?: boolean;
15
+ }): void;
16
+ /**
17
+ * Toggle collapse/expand state of a node.
18
+ */
19
+ toggleNode(id: string, options?: {
20
+ animate?: boolean;
21
+ recursive?: boolean;
22
+ }): void;
23
+ /**
24
+ * Check if a node is collapsed.
25
+ */
26
+ isCollapsed(id: string): boolean;
27
+ /**
28
+ * Get the number of nodes that would be hidden when collapsing this node.
29
+ */
30
+ getCollapseTargetCount(id: string): number;
31
+ /**
32
+ * Get the number of descendants (via parentId hierarchy) of a node.
33
+ */
34
+ getDescendantCount(id: string): number;
35
+ };
@@ -0,0 +1,6 @@
1
+ import type { CanvasContext } from './canvas-context';
2
+ import type { ComputeDefinition } from '../../core/compute';
3
+ export declare function createComputeMixin(ctx: CanvasContext): {
4
+ registerCompute(nodeType: string, definition: ComputeDefinition): void;
5
+ compute(startNodeId?: string): Map<string, Record<string, any>>;
6
+ };
@@ -0,0 +1,19 @@
1
+ import type { CanvasContext } from './canvas-context';
2
+ export declare function createCondenseMixin(ctx: CanvasContext): {
3
+ /**
4
+ * Condense a node — switch to summary view hiding internal rows.
5
+ */
6
+ condenseNode(id: string): void;
7
+ /**
8
+ * Uncondense a node — restore full row view.
9
+ */
10
+ uncondenseNode(id: string): void;
11
+ /**
12
+ * Toggle condensed state of a node.
13
+ */
14
+ toggleCondense(id: string): void;
15
+ /**
16
+ * Check if a node is condensed.
17
+ */
18
+ isCondensed(id: string): boolean;
19
+ };
@@ -0,0 +1,4 @@
1
+ import type { CanvasContext } from './canvas-context';
2
+ export declare function createConfigMixin(ctx: CanvasContext): {
3
+ _applyConfigPatch(changes: Record<string, any>): void;
4
+ };