@getartisanflow/alpineflow 0.2.3-alpha → 0.2.5-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 (145) hide show
  1. package/README.md +1 -0
  2. package/dist/alpineflow-collab.esm.js.map +1 -1
  3. package/dist/alpineflow-collab.js.map +1 -1
  4. package/dist/alpineflow-schema.esm.js +785 -679
  5. package/dist/alpineflow-schema.esm.js.map +1 -1
  6. package/dist/alpineflow-workflow.esm.js.map +1 -1
  7. package/dist/alpineflow.bundle.esm.js +7007 -6869
  8. package/dist/alpineflow.bundle.esm.js.map +1 -1
  9. package/dist/alpineflow.esm.js +2 -2
  10. package/dist/alpineflow.js +1 -1
  11. package/dist/{index-B8jw3ALY.js → index-iNX5XDHl.js} +6086 -5948
  12. package/dist/index-iNX5XDHl.js.map +1 -0
  13. package/dist/locales/de.json +62 -0
  14. package/dist/locales/en.json +62 -0
  15. package/dist/types/lib/collab.d.ts +2 -2
  16. package/dist/types/lib/core.d.ts +2 -2
  17. package/dist/types/lib/dagre.d.ts +1 -1
  18. package/dist/types/lib/elk.d.ts +1 -1
  19. package/dist/types/lib/force.d.ts +1 -1
  20. package/dist/types/lib/hierarchy.d.ts +1 -1
  21. package/dist/types/lib/schema.d.ts +2 -2
  22. package/dist/types/lib/whiteboard.d.ts +1 -1
  23. package/dist/types/lib/workflow.d.ts +2 -2
  24. package/dist/types/src/animate/animator.d.ts +6 -6
  25. package/dist/types/src/animate/clamp-dimensions.d.ts +1 -1
  26. package/dist/types/src/animate/flow-group.d.ts +1 -1
  27. package/dist/types/src/animate/handle-registry.d.ts +1 -1
  28. package/dist/types/src/animate/index.d.ts +19 -19
  29. package/dist/types/src/animate/interpolators.d.ts +1 -1
  30. package/dist/types/src/animate/motion/decay.d.ts +1 -1
  31. package/dist/types/src/animate/motion/index.d.ts +7 -7
  32. package/dist/types/src/animate/motion/inertia.d.ts +1 -1
  33. package/dist/types/src/animate/motion/keyframes.d.ts +1 -1
  34. package/dist/types/src/animate/motion/presets.d.ts +1 -1
  35. package/dist/types/src/animate/motion/spring.d.ts +1 -1
  36. package/dist/types/src/animate/particle-renderers.d.ts +1 -1
  37. package/dist/types/src/animate/recording/event-cursor.d.ts +1 -1
  38. package/dist/types/src/animate/recording/index.d.ts +7 -7
  39. package/dist/types/src/animate/recording/recorder.d.ts +1 -1
  40. package/dist/types/src/animate/recording/recording.d.ts +1 -1
  41. package/dist/types/src/animate/recording/replay.d.ts +2 -2
  42. package/dist/types/src/animate/recording/thumbnail.d.ts +1 -1
  43. package/dist/types/src/animate/recording/types.d.ts +3 -3
  44. package/dist/types/src/animate/recording/virtual-engine.d.ts +1 -1
  45. package/dist/types/src/animate/timeline.d.ts +5 -5
  46. package/dist/types/src/animate/transaction.d.ts +1 -1
  47. package/dist/types/src/collab/awareness.d.ts +1 -1
  48. package/dist/types/src/collab/bridge.d.ts +2 -2
  49. package/dist/types/src/collab/directives/flow-cursors.d.ts +1 -1
  50. package/dist/types/src/collab/index.d.ts +9 -9
  51. package/dist/types/src/collab/providers/in-memory.d.ts +1 -1
  52. package/dist/types/src/collab/providers/reverb.d.ts +1 -1
  53. package/dist/types/src/collab/providers/websocket.d.ts +1 -1
  54. package/dist/types/src/collab/store.d.ts +2 -2
  55. package/dist/types/src/core/__fixtures__/nodes.d.ts +1 -1
  56. package/dist/types/src/core/announcer.d.ts +10 -3
  57. package/dist/types/src/core/child-layout.d.ts +1 -1
  58. package/dist/types/src/core/child-validation.d.ts +1 -1
  59. package/dist/types/src/core/clipboard.d.ts +1 -1
  60. package/dist/types/src/core/collapse.d.ts +1 -1
  61. package/dist/types/src/core/compute.d.ts +1 -1
  62. package/dist/types/src/core/connections.d.ts +1 -1
  63. package/dist/types/src/core/controls-panel.d.ts +3 -0
  64. package/dist/types/src/core/crossing-reduction.d.ts +2 -2
  65. package/dist/types/src/core/drag.d.ts +1 -1
  66. package/dist/types/src/core/edge-paths/avoidant.d.ts +3 -3
  67. package/dist/types/src/core/edge-paths/bezier.d.ts +2 -2
  68. package/dist/types/src/core/edge-paths/editable.d.ts +2 -2
  69. package/dist/types/src/core/edge-paths/index.d.ts +7 -7
  70. package/dist/types/src/core/edge-paths/orthogonal.d.ts +2 -2
  71. package/dist/types/src/core/edge-paths/smoothstep.d.ts +2 -2
  72. package/dist/types/src/core/edge-paths/straight.d.ts +1 -1
  73. package/dist/types/src/core/edge-paths/utils.d.ts +1 -1
  74. package/dist/types/src/core/edge-utils.d.ts +3 -3
  75. package/dist/types/src/core/endpoint-spread.d.ts +1 -1
  76. package/dist/types/src/core/export.d.ts +1 -1
  77. package/dist/types/src/core/floating-edge.d.ts +1 -1
  78. package/dist/types/src/core/geometry.d.ts +1 -1
  79. package/dist/types/src/core/gradients.d.ts +1 -1
  80. package/dist/types/src/core/graph.d.ts +1 -1
  81. package/dist/types/src/core/helper-lines.d.ts +1 -1
  82. package/dist/types/src/core/history.d.ts +1 -1
  83. package/dist/types/src/core/index.d.ts +17 -17
  84. package/dist/types/src/core/intersection.d.ts +1 -1
  85. package/dist/types/src/core/lasso-hit-test.d.ts +1 -1
  86. package/dist/types/src/core/lasso.d.ts +2 -2
  87. package/dist/types/src/core/layout/dagre.d.ts +1 -1
  88. package/dist/types/src/core/layout/elk.d.ts +1 -1
  89. package/dist/types/src/core/layout/force.d.ts +1 -1
  90. package/dist/types/src/core/layout/hierarchy.d.ts +1 -1
  91. package/dist/types/src/core/minimap.d.ts +1 -1
  92. package/dist/types/src/core/pan-zoom.d.ts +10 -4
  93. package/dist/types/src/core/proximity-connect.d.ts +1 -1
  94. package/dist/types/src/core/render-plan.d.ts +1 -1
  95. package/dist/types/src/core/resize.d.ts +1 -1
  96. package/dist/types/src/core/schema-geometry.d.ts +1 -1
  97. package/dist/types/src/core/selection-box.d.ts +1 -1
  98. package/dist/types/src/core/shapes.d.ts +1 -1
  99. package/dist/types/src/core/sub-flow.d.ts +1 -1
  100. package/dist/types/src/core/translations.d.ts +175 -0
  101. package/dist/types/src/core/types.d.ts +29 -11
  102. package/dist/types/src/index.d.ts +31 -30
  103. package/dist/types/src/plugin/connection-utils.d.ts +3 -3
  104. package/dist/types/src/plugin/data/__real-canvas-harness.d.ts +1 -1
  105. package/dist/types/src/plugin/data/__test-utils.d.ts +1 -1
  106. package/dist/types/src/plugin/data/canvas-animation.d.ts +13 -13
  107. package/dist/types/src/plugin/data/canvas-batch.d.ts +1 -1
  108. package/dist/types/src/plugin/data/canvas-collapse.d.ts +1 -1
  109. package/dist/types/src/plugin/data/canvas-compute.d.ts +2 -2
  110. package/dist/types/src/plugin/data/canvas-condense.d.ts +1 -1
  111. package/dist/types/src/plugin/data/canvas-config.d.ts +1 -1
  112. package/dist/types/src/plugin/data/canvas-context.d.ts +22 -22
  113. package/dist/types/src/plugin/data/canvas-dom.d.ts +2 -2
  114. package/dist/types/src/plugin/data/canvas-edges.d.ts +2 -2
  115. package/dist/types/src/plugin/data/canvas-history.d.ts +2 -2
  116. package/dist/types/src/plugin/data/canvas-layout.d.ts +4 -4
  117. package/dist/types/src/plugin/data/canvas-nodes.d.ts +2 -2
  118. package/dist/types/src/plugin/data/canvas-particles.d.ts +2 -2
  119. package/dist/types/src/plugin/data/canvas-rows.d.ts +2 -2
  120. package/dist/types/src/plugin/data/canvas-selection.d.ts +1 -1
  121. package/dist/types/src/plugin/data/canvas-validation.d.ts +2 -2
  122. package/dist/types/src/plugin/data/canvas-viewport.d.ts +4 -4
  123. package/dist/types/src/plugin/directives/flow-edge.d.ts +1 -1
  124. package/dist/types/src/plugin/directives/flow-handle-validate.d.ts +1 -1
  125. package/dist/types/src/plugin/directives/flow-handle.d.ts +2 -2
  126. package/dist/types/src/plugin/drag-validation.d.ts +1 -1
  127. package/dist/types/src/plugin/handle-index.d.ts +1 -1
  128. package/dist/types/src/schema/canvas-augmentation.test-d.d.ts +1 -1
  129. package/dist/types/src/schema/diff.d.ts +1 -1
  130. package/dist/types/src/schema/dot.d.ts +1 -1
  131. package/dist/types/src/schema/field-ops.d.ts +1 -1
  132. package/dist/types/src/schema/history.d.ts +1 -1
  133. package/dist/types/src/schema/index.d.ts +24 -24
  134. package/dist/types/src/schema/layout.d.ts +1 -1
  135. package/dist/types/src/schema/references.d.ts +1 -1
  136. package/dist/types/src/schema/serialization.d.ts +1 -1
  137. package/dist/types/src/schema/types.d.ts +1 -1
  138. package/dist/types/src/schema/validate.d.ts +1 -1
  139. package/dist/types/src/workflow/condition.d.ts +1 -1
  140. package/dist/types/src/workflow/index.d.ts +3 -3
  141. package/dist/types/src/workflow/replay.d.ts +1 -1
  142. package/dist/types/src/workflow/run.d.ts +1 -1
  143. package/dist/types/src/workflow/types.d.ts +3 -3
  144. package/package.json +5 -2
  145. package/dist/index-B8jw3ALY.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { type RoutePoint } from './edge-paths/orthogonal';
2
- import type { Rect } from './types';
1
+ import { type RoutePoint } from './edge-paths/orthogonal.js';
2
+ import type { Rect } from './types.js';
3
3
  export type CrossingReductionConfig = boolean | {
4
4
  channelGap?: number;
5
5
  };
@@ -1,4 +1,4 @@
1
- import type { XYPosition, Viewport } from './types';
1
+ import type { XYPosition, Viewport } from './types.js';
2
2
  export interface DragOptions {
3
3
  /** Called when a drag gesture starts */
4
4
  onDragStart?: (event: DragStartEvent) => void;
@@ -1,6 +1,6 @@
1
- import type { HandlePosition, Rect } from '../types';
2
- import type { EdgePathResult } from './utils';
3
- import { type RoutePoint } from './orthogonal';
1
+ import type { HandlePosition, Rect } from '../types.js';
2
+ import type { EdgePathResult } from './utils.js';
3
+ import { type RoutePoint } from './orthogonal.js';
4
4
  export interface AvoidantPathParams {
5
5
  sourceX: number;
6
6
  sourceY: number;
@@ -1,5 +1,5 @@
1
- import type { HandlePosition } from '../types';
2
- import { type EdgePathResult } from './utils';
1
+ import type { HandlePosition } from '../types.js';
2
+ import { type EdgePathResult } from './utils.js';
3
3
  interface BezierPathParams {
4
4
  sourceX: number;
5
5
  sourceY: number;
@@ -1,5 +1,5 @@
1
- import type { HandlePosition } from '../types';
2
- import { type EdgePathResult } from './utils';
1
+ import type { HandlePosition } from '../types.js';
2
+ import { type EdgePathResult } from './utils.js';
3
3
  export type EditablePathStyle = 'linear' | 'step' | 'smoothstep' | 'catmull-rom' | 'bezier';
4
4
  export interface EditablePathParams {
5
5
  sourceX: number;
@@ -1,7 +1,7 @@
1
- export { getAvoidantPath, buildCatmullRomPath } from './avoidant';
2
- export { getBezierPath, getSimpleBezierPath } from './bezier';
3
- export { getOrthogonalPath } from './orthogonal';
4
- export { getSmoothStepPath, getStepPath } from './smoothstep';
5
- export { getStraightPath } from './straight';
6
- export { getEditablePath, type EditablePathStyle } from './editable';
7
- export { getEdgeCenter, type EdgePathResult } from './utils';
1
+ export { getAvoidantPath, buildCatmullRomPath } from './avoidant.js';
2
+ export { getBezierPath, getSimpleBezierPath } from './bezier.js';
3
+ export { getOrthogonalPath } from './orthogonal.js';
4
+ export { getSmoothStepPath, getStepPath } from './smoothstep.js';
5
+ export { getStraightPath } from './straight.js';
6
+ export { getEditablePath, type EditablePathStyle } from './editable.js';
7
+ export { getEdgeCenter, type EdgePathResult } from './utils.js';
@@ -1,5 +1,5 @@
1
- import type { HandlePosition, Rect } from '../types';
2
- import { type EdgePathResult } from './utils';
1
+ import type { HandlePosition, Rect } from '../types.js';
2
+ import { type EdgePathResult } from './utils.js';
3
3
  export declare const OBSTACLE_PADDING = 20;
4
4
  export interface OrthogonalPathParams {
5
5
  sourceX: number;
@@ -1,5 +1,5 @@
1
- import type { HandlePosition } from '../types';
2
- import { type EdgePathResult } from './utils';
1
+ import type { HandlePosition } from '../types.js';
2
+ import { type EdgePathResult } from './utils.js';
3
3
  interface SmoothStepPathParams {
4
4
  sourceX: number;
5
5
  sourceY: number;
@@ -1,4 +1,4 @@
1
- import { type EdgePathResult } from './utils';
1
+ import { type EdgePathResult } from './utils.js';
2
2
  interface StraightPathParams {
3
3
  sourceX: number;
4
4
  sourceY: number;
@@ -1,4 +1,4 @@
1
- import type { XYPosition } from '../types';
1
+ import type { XYPosition } from '../types.js';
2
2
  export interface EdgePathResult {
3
3
  /** SVG path `d` attribute */
4
4
  path: string;
@@ -1,6 +1,6 @@
1
- import type { FlowEdge, FlowNode, HandlePosition, Rect, ShapeDefinition } from './types';
2
- import type { MarkerType, MarkerConfig } from './markers';
3
- import type { EdgePathResult } from './edge-paths/utils';
1
+ import type { FlowEdge, FlowNode, HandlePosition, Rect, ShapeDefinition } from './types.js';
2
+ import type { MarkerType, MarkerConfig } from './markers.js';
3
+ import type { EdgePathResult } from './edge-paths/utils.js';
4
4
  /**
5
5
  * Compute the x,y coordinates where an edge connects to a node based on
6
6
  * the handle's position (top/right/bottom/left + corners).
@@ -1,4 +1,4 @@
1
- import type { HandlePosition } from './types';
1
+ import type { HandlePosition } from './types.js';
2
2
  /** Default px gap between adjacent lanes when spacing isn't specified. */
3
3
  export declare const DEFAULT_SPREAD_SPACING = 5;
4
4
  /** Resolve the desired lane spacing from the config value; null = disabled. */
@@ -1,4 +1,4 @@
1
- import type { FlowNode, Viewport, ToImageOptions } from './types';
1
+ import type { FlowNode, Viewport, ToImageOptions } from './types.js';
2
2
  /**
3
3
  * Capture the flow canvas as a PNG data URL.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { XYPosition, FlowNode, HandlePosition } from './types';
1
+ import type { XYPosition, FlowNode, HandlePosition } from './types.js';
2
2
  /**
3
3
  * Compute the intersection point where a line from a node's center toward
4
4
  * a target point crosses the node's rectangular boundary.
@@ -1,4 +1,4 @@
1
- import type { XYPosition, Viewport, Rect, FlowNode } from './types';
1
+ import type { XYPosition, Viewport, Rect, FlowNode } from './types.js';
2
2
  /**
3
3
  * Convert screen (client) coordinates to flow coordinates.
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { EdgeGradient } from './types';
1
+ import type { EdgeGradient } from './types.js';
2
2
  /**
3
3
  * Type guard: is this color value a gradient object?
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { FlowNode, FlowEdge } from './types';
1
+ import type { FlowNode, FlowEdge } from './types.js';
2
2
  /**
3
3
  * Get all edges connected to a node (incoming and outgoing).
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { FlowNode } from './types';
1
+ import type { FlowNode } from './types.js';
2
2
  export interface NodeBox {
3
3
  id: string;
4
4
  x: number;
@@ -1,4 +1,4 @@
1
- import type { FlowNode, FlowEdge } from './types';
1
+ import type { FlowNode, FlowEdge } from './types.js';
2
2
  export interface HistorySnapshot {
3
3
  nodes: FlowNode[];
4
4
  edges: FlowEdge[];
@@ -1,17 +1,17 @@
1
- export type { XYPosition, Viewport, Rect, Dimensions, CoordinateExtent, FlowNode, FlowEdge, EdgeType, HandleType, HandlePosition, HandleConfig, Connection, PendingConnection, FlowEvents, FlowCanvasConfig, FlowInstance, SchemaNodeDecorator, SchemaRowDecorator, SchemaNodeDecoratorContext, SchemaRowDecoratorContext, SchemaRowSlots, SchemaClassValue, SchemaRowClassResolver, SchemaNodeClassResolver, SchemaRowClassContext, SchemaNodeClassContext, SchemaRowClassMap, SchemaNodeClassMap, } from './types';
2
- export { isNode, isEdge } from './types';
3
- export { getBezierPath, getSimpleBezierPath, getSmoothStepPath, getStepPath, getStraightPath, getEdgeCenter, type EdgePathResult, } from './edge-paths';
4
- export { createPanZoom, type PanZoomOptions, type PanZoomInstance } from './pan-zoom';
5
- export { createDrag, type DragOptions, type DragInstance } from './drag';
6
- export { isPointInHandle, findClosestHandle, isValidConnection, type HandleBounds } from './connections';
7
- export { getConnectedEdges, getConnectedEdgesForNodes, getOutgoers, getIncomers, areNodesConnected, wouldCreateCycle, } from './graph';
8
- export { screenToFlowPosition, flowToScreenPosition, getNodesBounds, getViewportForBounds, } from './geometry';
9
- export { computeResize, DEFAULT_RESIZE_CONSTRAINTS, type ResizeDirection, type ResizeConstraints, type ResizeResult, } from './resize';
10
- export { getNodeIntersection, getEdgePosition, getFloatingEdgeParams, getSimpleFloatingPosition, } from './floating-edge';
11
- export { buildNodeMap, getAbsolutePosition, toAbsoluteNode, toAbsoluteNodes, getDescendantIds, sortNodesTopological, computeZIndex, clampToExtent, clampToParent, expandParentToFitChild, } from './sub-flow';
12
- export { FlowHistory, type HistorySnapshot } from './history';
13
- export { getNodeRect, rectsIntersect, getIntersectingNodes, isNodeIntersecting, clampToAvoidOverlap, } from './intersection';
14
- export { createColorMode } from './color-mode';
15
- export type { ColorMode, ColorModeHandle } from './color-mode';
16
- export { debug, setDebugEnabled, isDebugEnabled } from './debug';
17
- export { normalizeMarker, getMarkerId, getMarkerSvg, registerMarker, type MarkerType, type MarkerConfig, type CustomMarkerRenderer, } from './markers';
1
+ export type { XYPosition, Viewport, Rect, Dimensions, CoordinateExtent, FlowNode, FlowEdge, EdgeType, HandleType, HandlePosition, HandleConfig, Connection, PendingConnection, FlowEvents, FlowCanvasConfig, FlowInstance, SchemaNodeDecorator, SchemaRowDecorator, SchemaNodeDecoratorContext, SchemaRowDecoratorContext, SchemaRowSlots, SchemaClassValue, SchemaRowClassResolver, SchemaNodeClassResolver, SchemaRowClassContext, SchemaNodeClassContext, SchemaRowClassMap, SchemaNodeClassMap, } from './types.js';
2
+ export { isNode, isEdge } from './types.js';
3
+ export { getBezierPath, getSimpleBezierPath, getSmoothStepPath, getStepPath, getStraightPath, getEdgeCenter, type EdgePathResult, } from './edge-paths/index.js';
4
+ export { createPanZoom, type PanZoomOptions, type PanZoomInstance } from './pan-zoom.js';
5
+ export { createDrag, type DragOptions, type DragInstance } from './drag.js';
6
+ export { isPointInHandle, findClosestHandle, isValidConnection, type HandleBounds } from './connections.js';
7
+ export { getConnectedEdges, getConnectedEdgesForNodes, getOutgoers, getIncomers, areNodesConnected, wouldCreateCycle, } from './graph.js';
8
+ export { screenToFlowPosition, flowToScreenPosition, getNodesBounds, getViewportForBounds, } from './geometry.js';
9
+ export { computeResize, DEFAULT_RESIZE_CONSTRAINTS, type ResizeDirection, type ResizeConstraints, type ResizeResult, } from './resize.js';
10
+ export { getNodeIntersection, getEdgePosition, getFloatingEdgeParams, getSimpleFloatingPosition, } from './floating-edge.js';
11
+ export { buildNodeMap, getAbsolutePosition, toAbsoluteNode, toAbsoluteNodes, getDescendantIds, sortNodesTopological, computeZIndex, clampToExtent, clampToParent, expandParentToFitChild, } from './sub-flow.js';
12
+ export { FlowHistory, type HistorySnapshot } from './history.js';
13
+ export { getNodeRect, rectsIntersect, getIntersectingNodes, isNodeIntersecting, clampToAvoidOverlap, } from './intersection.js';
14
+ export { createColorMode } from './color-mode.js';
15
+ export type { ColorMode, ColorModeHandle } from './color-mode.js';
16
+ export { debug, setDebugEnabled, isDebugEnabled } from './debug.js';
17
+ export { normalizeMarker, getMarkerId, getMarkerSvg, registerMarker, type MarkerType, type MarkerConfig, type CustomMarkerRenderer, } from './markers.js';
@@ -1,4 +1,4 @@
1
- import type { FlowNode, Rect } from './types';
1
+ import type { FlowNode, Rect } from './types.js';
2
2
  /** Get the bounding rect of a node (uses measured or default dimensions). */
3
3
  export declare function getNodeRect(node: FlowNode, globalOrigin?: [number, number]): Rect;
4
4
  /** AABB overlap test between two rectangles. */
@@ -1,4 +1,4 @@
1
- import type { FlowNode, Rect } from './types';
1
+ import type { FlowNode, Rect } from './types.js';
2
2
  export interface Point {
3
3
  x: number;
4
4
  y: number;
@@ -1,5 +1,5 @@
1
- import type { Viewport } from './types';
2
- import type { Point } from './lasso-hit-test';
1
+ import type { Viewport } from './types.js';
2
+ import type { Point } from './lasso-hit-test.js';
3
3
  export interface LassoInstance {
4
4
  start(containerX: number, containerY: number, mode?: 'partial' | 'full'): void;
5
5
  update(containerX: number, containerY: number): void;
@@ -1,4 +1,4 @@
1
- import type { FlowNode, FlowEdge } from '../types';
1
+ import type { FlowNode, FlowEdge } from '../types.js';
2
2
  export type DagreDirection = 'TB' | 'LR' | 'BT' | 'RL';
3
3
  export interface DagreLayoutOptions {
4
4
  direction?: DagreDirection;
@@ -1,4 +1,4 @@
1
- import type { FlowNode, FlowEdge } from '../types';
1
+ import type { FlowNode, FlowEdge } from '../types.js';
2
2
  export type ElkAlgorithm = 'layered' | 'force' | 'mrtree' | 'radial' | 'stress' | 'rectpacking';
3
3
  export type ElkDirection = 'DOWN' | 'RIGHT' | 'UP' | 'LEFT';
4
4
  export interface ElkLayoutOptions {
@@ -1,4 +1,4 @@
1
- import type { FlowNode, FlowEdge } from '../types';
1
+ import type { FlowNode, FlowEdge } from '../types.js';
2
2
  export interface ForceLayoutOptions {
3
3
  strength?: number;
4
4
  distance?: number;
@@ -1,4 +1,4 @@
1
- import type { FlowNode, FlowEdge } from '../types';
1
+ import type { FlowNode, FlowEdge } from '../types.js';
2
2
  export type HierarchyLayoutType = 'tree' | 'cluster';
3
3
  export type HierarchyDirection = 'TB' | 'LR';
4
4
  export interface HierarchyLayoutOptions {
@@ -1,4 +1,4 @@
1
- import type { FlowNode, Viewport, FlowCanvasConfig } from './types';
1
+ import type { FlowNode, Viewport, FlowCanvasConfig } from './types.js';
2
2
  export declare const MINIMAP_DEFAULT_WIDTH = 200;
3
3
  export declare const MINIMAP_DEFAULT_HEIGHT = 150;
4
4
  export interface MiniMapState {
@@ -1,6 +1,5 @@
1
- import { type ZoomTransform } from 'd3-zoom';
2
1
  import 'd3-transition';
3
- import type { Viewport } from './types';
2
+ import type { Viewport } from './types.js';
4
3
  export interface PanZoomOptions {
5
4
  /** Called whenever the viewport transform changes */
6
5
  onTransformChange: (viewport: Viewport) => void;
@@ -81,8 +80,15 @@ export interface PanZoomInstance {
81
80
  setViewport(viewport: Partial<Viewport>, options?: {
82
81
  duration?: number;
83
82
  }): void;
84
- /** Get current d3 transform */
85
- getTransform(): ZoomTransform;
83
+ /**
84
+ * Get the current d3 transform (translate `x`/`y`, scale `k`). Typed
85
+ * structurally so the published declarations don't depend on d3-zoom's types.
86
+ */
87
+ getTransform(): {
88
+ x: number;
89
+ y: number;
90
+ k: number;
91
+ };
86
92
  /** Update options at runtime (e.g. toggle pannable/zoomable) */
87
93
  update(options: Partial<PanZoomOptions>): void;
88
94
  /** Clean up d3 listeners */
@@ -1,4 +1,4 @@
1
- import type { XYPosition } from './types';
1
+ import type { XYPosition } from './types.js';
2
2
  interface NodeCenter {
3
3
  id: string;
4
4
  center: XYPosition;
@@ -1,4 +1,4 @@
1
- import type { FlowNode, FlowEdge, Rect, Viewport } from './types';
1
+ import type { FlowNode, FlowEdge, Rect, Viewport } from './types.js';
2
2
  /** A single node in the render plan output. */
3
3
  export interface RenderPlanNode {
4
4
  id: string;
@@ -1,4 +1,4 @@
1
- import type { XYPosition, Dimensions } from './types';
1
+ import type { XYPosition, Dimensions } from './types.js';
2
2
  /** Which edge or corner is being dragged */
3
3
  export type ResizeDirection = 'top-left' | 'top' | 'top-right' | 'left' | 'right' | 'bottom-left' | 'bottom' | 'bottom-right';
4
4
  /** Min/max size constraints for resizable nodes */
@@ -1,4 +1,4 @@
1
- import type { XYPosition, SchemaMetrics } from './types';
1
+ import type { XYPosition, SchemaMetrics } from './types.js';
2
2
  /** Resolved center of a schema field row's handle, in flow space. */
3
3
  export interface SchemaHandlePoint {
4
4
  x: number;
@@ -1,4 +1,4 @@
1
- import type { Rect, Viewport } from './types';
1
+ import type { Rect, Viewport } from './types.js';
2
2
  export interface SelectionBoxInstance {
3
3
  /** Start a new selection at a position relative to the container */
4
4
  start(containerX: number, containerY: number, mode?: 'partial' | 'full'): void;
@@ -1,4 +1,4 @@
1
- import type { HandlePosition, ShapeDefinition } from './types';
1
+ import type { HandlePosition, ShapeDefinition } from './types.js';
2
2
  /** Rectangular fallback — same as the default getHandleCoords logic. */
3
3
  declare function rectPerimeter(w: number, h: number, position: HandlePosition): {
4
4
  x: number;
@@ -1,4 +1,4 @@
1
- import type { FlowNode, XYPosition, Dimensions, CoordinateExtent } from './types';
1
+ import type { FlowNode, XYPosition, Dimensions, CoordinateExtent } from './types.js';
2
2
  /**
3
3
  * Build a Map<string, FlowNode> for O(1) lookups by node ID.
4
4
  */
@@ -0,0 +1,175 @@
1
+ /**
2
+ * Every message the engine ships, keyed as in `locales/en.json`. Messages that
3
+ * carry a `:count` appear in the two plural forms English uses, `_one` and `_other`.
4
+ */
5
+ interface EnglishMessages {
6
+ /** Accessible name of the controls panel. */
7
+ 'controls.label'?: string;
8
+ /** Tooltip / accessible name of the zoom-in button. */
9
+ 'controls.zoomIn'?: string;
10
+ /** Tooltip / accessible name of the zoom-out button. */
11
+ 'controls.zoomOut'?: string;
12
+ /** Tooltip / accessible name of the fit-view button. */
13
+ 'controls.fitView'?: string;
14
+ /** Tooltip of the interactivity toggle before its state is known. */
15
+ 'controls.toggleInteractive'?: string;
16
+ /** Tooltip of the interactivity toggle while the canvas is interactive (click locks it). */
17
+ 'controls.lockInteractive'?: string;
18
+ /** Tooltip of the interactivity toggle while the canvas is locked (click unlocks it). */
19
+ 'controls.unlockInteractive'?: string;
20
+ /** Tooltip / accessible name of the reset-panels button. */
21
+ 'controls.resetPanels'?: string;
22
+ /** Tooltip of the fullscreen toggle before its state is known. */
23
+ 'controls.toggleFullscreen'?: string;
24
+ /** Tooltip of the fullscreen toggle while windowed (click enters fullscreen). */
25
+ 'controls.enterFullscreen'?: string;
26
+ /** Tooltip of the fullscreen toggle while fullscreen (click exits). */
27
+ 'controls.exitFullscreen'?: string;
28
+ /** Default `aria-label` of the canvas container (overridden by `ariaLabel`). */
29
+ 'canvas.label'?: string;
30
+ /** Text shown while the canvas initialises (overridden by `loadingText`). */
31
+ 'canvas.loading'?: string;
32
+ /** Touch hint shown while multi-selection mode is active. */
33
+ 'canvas.selectionMode'?: string;
34
+ /** Accessible name of a node with a label. Placeholder: `:label`. */
35
+ 'a11y.nodeLabel'?: string;
36
+ /** Accessible name of a node without a label. Placeholder: `:id`. */
37
+ 'a11y.nodeId'?: string;
38
+ /** Accessible name of an edge with a label. Placeholder: `:label`. */
39
+ 'a11y.edgeLabel'?: string;
40
+ /** Accessible name of an edge without a label. Placeholders: `:source`, `:target`. */
41
+ 'a11y.edgeEndpoints'?: string;
42
+ /** Accessible name of a source handle. Placeholder: `:id`. */
43
+ 'a11y.sourceHandle'?: string;
44
+ /** Accessible name of a target handle. Placeholder: `:id`. */
45
+ 'a11y.targetHandle'?: string;
46
+ /** Tooltip on an editable edge's midpoint. */
47
+ 'a11y.addControlPoint'?: string;
48
+ /** Announced when one labelled node is added. Placeholder: `:label`. */
49
+ 'announce.nodeAdded'?: string;
50
+ /** Announced when several nodes are added. Placeholder: `:count` (plural, singular form). */
51
+ 'announce.nodesAdded_one'?: string;
52
+ /** Announced when several nodes are added. Placeholder: `:count` (plural, default form). */
53
+ 'announce.nodesAdded_other'?: string;
54
+ /** Announced when one labelled node is removed. Placeholder: `:label`. */
55
+ 'announce.nodeRemoved'?: string;
56
+ /** Announced when several nodes are removed. Placeholder: `:count` (plural, singular form). */
57
+ 'announce.nodesRemoved_one'?: string;
58
+ /** Announced when several nodes are removed. Placeholder: `:count` (plural, default form). */
59
+ 'announce.nodesRemoved_other'?: string;
60
+ /** Announced when one edge is added. Placeholders: `:source`, `:target`. */
61
+ 'announce.connected'?: string;
62
+ /** Announced when several edges are added. Placeholder: `:count` (plural, singular form). */
63
+ 'announce.connectionsAdded_one'?: string;
64
+ /** Announced when several edges are added. Placeholder: `:count` (plural, default form). */
65
+ 'announce.connectionsAdded_other'?: string;
66
+ /** Announced when one edge with known endpoints is removed. Placeholders: `:source`, `:target`. */
67
+ 'announce.disconnected'?: string;
68
+ /** Announced when edges without known endpoints are removed. Placeholder: `:count` (plural, singular form). */
69
+ 'announce.connectionsRemoved_one'?: string;
70
+ /** Announced when edges without known endpoints are removed. Placeholder: `:count` (plural, default form). */
71
+ 'announce.connectionsRemoved_other'?: string;
72
+ /** Announced when the selection becomes empty. */
73
+ 'announce.selectionCleared'?: string;
74
+ /** Node part of a selection announcement. Placeholder: `:count` (plural, singular form). */
75
+ 'announce.nodesSelected_one'?: string;
76
+ /** Node part of a selection announcement. Placeholder: `:count` (plural, default form). */
77
+ 'announce.nodesSelected_other'?: string;
78
+ /** Edge part of a selection announcement. Placeholder: `:count` (plural, singular form). */
79
+ 'announce.edgesSelected_one'?: string;
80
+ /** Edge part of a selection announcement. Placeholder: `:count` (plural, default form). */
81
+ 'announce.edgesSelected_other'?: string;
82
+ /** Joins the node and edge parts of a selection announcement. Placeholders: `:nodes`, `:edges`. */
83
+ 'announce.selectionJoin'?: string;
84
+ /** Wraps the selection summary. Placeholder: `:items`. */
85
+ 'announce.selected'?: string;
86
+ /** Announced when panning or zooming ends. Placeholder: `:percent`. */
87
+ 'announce.viewportZoom'?: string;
88
+ /** Announced after fit-view. */
89
+ 'announce.viewFitted'?: string;
90
+ /** Fallback name for a node without label or id in reparent announcements. */
91
+ 'announce.node'?: string;
92
+ /** Announced when a node is moved into a parent. Placeholders: `:name`, `:parent`. */
93
+ 'announce.reparented'?: string;
94
+ /** Announced when a node leaves its parent. Placeholders: `:name`, `:parent`. */
95
+ 'announce.detached'?: string;
96
+ /** Default label of a condition node without `data.label`. */
97
+ 'workflow.condition'?: string;
98
+ /** Shown instead of an expression when a condition uses a custom evaluator function. */
99
+ 'workflow.customEvaluator'?: string;
100
+ /** Default label of a wait node without `data.label`. */
101
+ 'workflow.wait'?: string;
102
+ /** Node inspector placeholder while nothing is selected. */
103
+ 'schema.inspector.noNode'?: string;
104
+ /** Edge inspector placeholder while nothing is selected. */
105
+ 'schema.inspector.noEdge'?: string;
106
+ /** Row inspector placeholder while nothing is selected. */
107
+ 'schema.inspector.noRow'?: string;
108
+ /** Row inspector message when the selected row was deleted. */
109
+ 'schema.inspector.missingRow'?: string;
110
+ /** Form label of the edge label input. */
111
+ 'schema.inspector.label'?: string;
112
+ /** Form label of the row name input. */
113
+ 'schema.inspector.name'?: string;
114
+ /** Form label and placeholder of the row type input. */
115
+ 'schema.inspector.type'?: string;
116
+ /** Form label of the row "required" checkbox. */
117
+ 'schema.inspector.required'?: string;
118
+ /** Button verb that removes a row. */
119
+ 'schema.inspector.remove'?: string;
120
+ /** Button verb that deletes the selected edge. */
121
+ 'schema.inspector.delete'?: string;
122
+ /** Button verb that adds a row. */
123
+ 'schema.inspector.add'?: string;
124
+ /** Placeholder of the new-row name input. */
125
+ 'schema.inspector.fieldName'?: string;
126
+ }
127
+ type PluralCategory = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other';
128
+ /** Base keys of the messages with plural forms, e.g. `announce.nodesSelected`. */
129
+ type PluralMessage = keyof EnglishMessages extends infer K ? K extends `${infer Base}_other` ? Base : never : never;
130
+ /**
131
+ * Plural forms other languages need besides `_one` / `_other`: Arabic uses `_zero`
132
+ * and `_two`, Polish and Russian `_few` and `_many`. A language's categories are
133
+ * listed by `new Intl.PluralRules(locale).resolvedOptions().pluralCategories`.
134
+ */
135
+ type AdditionalPluralForms = {
136
+ [K in `${PluralMessage}_${Exclude<PluralCategory, 'one' | 'other'>}`]?: string;
137
+ };
138
+ /**
139
+ * UI messages of a canvas. Every key is optional; missing keys fall back to
140
+ * English. Messages are plain text with literal `:placeholder` substitution.
141
+ * Keys that carry a `:count` exist once per CLDR plural category (`_one`,
142
+ * `_few`, `_other`, …) and are selected with the canvas `locale`.
143
+ */
144
+ export interface FlowTranslations extends EnglishMessages, AdditionalPluralForms {
145
+ }
146
+ type MessageKey = keyof FlowTranslations;
147
+ /** Message keys as callers use them: plural variants collapse onto their base key. */
148
+ export type TranslationKey = MessageKey extends infer K ? K extends `${infer Base}_${PluralCategory}` ? Base : K : never;
149
+ /**
150
+ * Plural rules for a locale tag. Accepts Laravel-style underscores (`pt_BR`),
151
+ * defaults to the document language and falls back to English for invalid tags.
152
+ */
153
+ export declare function resolvePluralRules(locale?: string): Intl.PluralRules;
154
+ /** Translates a message key with optional placeholder values. See {@link createTranslator}. */
155
+ export type Translator = (key: TranslationKey, values?: Record<string, string | number>) => string;
156
+ /**
157
+ * Build a translator for one canvas. The overrides are copied once into a plain
158
+ * object, so later changes to the source dictionary (or Alpine reactivity on it)
159
+ * do not affect the result; recreate the canvas to change its language.
160
+ *
161
+ * Lookup order: the override for the locale's plural category, the override's
162
+ * `_other` form, then the English message selected with English plural rules.
163
+ * Empty strings and non-string values are ignored. Placeholders (`:label`) are
164
+ * substituted literally.
165
+ */
166
+ export declare function createTranslator(translations?: FlowTranslations, locale?: string): Translator;
167
+ /** English messages with English plural rules, shared by call sites that have no canvas. */
168
+ export declare const englishTranslator: Translator;
169
+ /**
170
+ * Translator for a directive's canvas scope: delegates to the canvas `t()` when
171
+ * present, otherwise English. Lets directives and inspectors mount against a
172
+ * plain `x-data` host (tests, custom shells) without a `flowCanvas` instance.
173
+ */
174
+ export declare function canvasTranslator(canvas: unknown): Translator;
175
+ export {};
@@ -1,11 +1,12 @@
1
- import type { EasingName } from '../animate/easing';
2
- import type { PathFunction } from '../animate/paths';
3
- import type { CollabConfig, CollabInstance } from '../collab/types';
4
- import type { FlowGroup } from '../animate/flow-group';
5
- import type { Transaction } from '../animate/transaction';
6
- import type { MotionConfig } from '../animate/motion/types';
7
- import type { Recording, RecordOptions, ReplayOptions, ReplayHandle } from '../animate/recording';
8
- import type { CanvasContext } from '../plugin/data/canvas-context';
1
+ import type { FlowTranslations, TranslationKey, Translator } from './translations.js';
2
+ import type { EasingName } from '../animate/easing.js';
3
+ import type { PathFunction } from '../animate/paths.js';
4
+ import type { CollabConfig, CollabInstance } from '../collab/types.js';
5
+ import type { FlowGroup } from '../animate/flow-group.js';
6
+ import type { Transaction } from '../animate/transaction.js';
7
+ import type { MotionConfig } from '../animate/motion/types.js';
8
+ import type { Recording, RecordOptions, ReplayOptions, ReplayHandle } from '../animate/recording/index.js';
9
+ import type { CanvasContext } from '../plugin/data/canvas-context.js';
9
10
  /** 2D coordinate */
10
11
  export interface XYPosition {
11
12
  x: number;
@@ -207,7 +208,7 @@ export interface ChildValidationFailDetail {
207
208
  export type EdgeType = 'bezier' | 'smoothstep' | 'straight' | 'floating' | 'orthogonal' | 'avoidant' | 'editable';
208
209
  /** Edge animation mode */
209
210
  export type EdgeAnimationMode = 'none' | 'dash' | 'pulse' | 'dot';
210
- import type { MarkerType, MarkerConfig } from './markers';
211
+ import type { MarkerType, MarkerConfig } from './markers.js';
211
212
  /** Two-color linear gradient for edge strokes. */
212
213
  export interface EdgeGradient {
213
214
  from: string;
@@ -1029,6 +1030,13 @@ export type SchemaRowClassResolver = (ctx: SchemaRowClassContext) => SchemaClass
1029
1030
  */
1030
1031
  export type SchemaNodeClassResolver = (ctx: SchemaNodeClassContext) => SchemaClassValue | SchemaNodeClassMap;
1031
1032
  export interface FlowCanvasConfig {
1033
+ /** UI message overrides for this canvas. Missing keys fall back to English. */
1034
+ translations?: FlowTranslations;
1035
+ /**
1036
+ * BCP 47 locale used to pick plural forms (`_one`, `_few`, …) from `translations`.
1037
+ * Laravel-style `pt_BR` is accepted. Default: `document.documentElement.lang`, then `en`.
1038
+ */
1039
+ locale?: string;
1032
1040
  nodes?: FlowNode[];
1033
1041
  edges?: FlowEdge[];
1034
1042
  /** Initial viewport state */
@@ -1254,6 +1262,10 @@ export interface FlowCanvasConfig {
1254
1262
  * to follow the container watches for a resize and calls `resize()` on the instance.
1255
1263
  */
1256
1264
  minimapWidth?: number;
1265
+ /**
1266
+ * The minimap's height in pixels (default 150). Pairs with `minimapWidth` — see there for how the
1267
+ * two together drive the fit scale and the shape of the viewport marker.
1268
+ */
1257
1269
  minimapHeight?: number;
1258
1270
  /**
1259
1271
  * Element to enter fullscreen mode, instead of the canvas container.
@@ -1285,13 +1297,13 @@ export interface FlowCanvasConfig {
1285
1297
  /** Screen reader announcements. true (default) = on, false = off,
1286
1298
  * or object with formatMessage callback for custom messages. */
1287
1299
  announcements?: boolean | {
1288
- formatMessage?: (event: string, detail: Record<string, any>) => string | null;
1300
+ formatMessage?: (event: string, detail: Record<string, any>, t: Translator) => string | null;
1289
1301
  };
1290
1302
  /** Compute mode. 'manual' (default) = explicit $flow.compute() calls,
1291
1303
  * 'auto' = re-propagate on node/edge changes (debounced). */
1292
1304
  computeMode?: 'auto' | 'manual';
1293
1305
  /** Customize keyboard shortcuts. Omit a key for default, set to null to disable. */
1294
- keyboardShortcuts?: import('./keyboard-shortcuts').KeyboardShortcuts;
1306
+ keyboardShortcuts?: import('./keyboard-shortcuts.js').KeyboardShortcuts;
1295
1307
  /** Selection containment mode. 'partial' selects on any overlap (default), 'full' requires entire node inside box. */
1296
1308
  selectionMode?: 'partial' | 'full';
1297
1309
  /** Start selection box on plain left-click drag (no modifier needed). Pair with panOnDrag: [2] for whiteboard UX. Default: false */
@@ -2020,6 +2032,12 @@ export interface FlowInstance {
2020
2032
  clearNodeFilter(): void;
2021
2033
  /** Update runtime config options (zoom limits, background, colorMode, etc.). */
2022
2034
  patchConfig(changes: Partial<PatchableConfig>): void;
2035
+ /**
2036
+ * Translate a UI message of this canvas (`$flow.t('controls.zoomIn')` in templates).
2037
+ * Resolved once at creation from `translations` + `locale`; a numeric `count`
2038
+ * selects the plural form. Unknown or missing keys fall back to English.
2039
+ */
2040
+ t(key: TranslationKey, values?: Record<string, string | number>): string;
2023
2041
  /** Current resolved color mode, or undefined if not managed. */
2024
2042
  readonly colorMode?: 'light' | 'dark';
2025
2043
  /** Return all nodes whose bounding rect overlaps the given node.