@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.
- package/README.md +1 -0
- package/dist/alpineflow-collab.esm.js.map +1 -1
- package/dist/alpineflow-collab.js.map +1 -1
- package/dist/alpineflow-schema.esm.js +785 -679
- package/dist/alpineflow-schema.esm.js.map +1 -1
- package/dist/alpineflow-workflow.esm.js.map +1 -1
- package/dist/alpineflow.bundle.esm.js +7007 -6869
- package/dist/alpineflow.bundle.esm.js.map +1 -1
- package/dist/alpineflow.esm.js +2 -2
- package/dist/alpineflow.js +1 -1
- package/dist/{index-B8jw3ALY.js → index-iNX5XDHl.js} +6086 -5948
- package/dist/index-iNX5XDHl.js.map +1 -0
- package/dist/locales/de.json +62 -0
- package/dist/locales/en.json +62 -0
- package/dist/types/lib/collab.d.ts +2 -2
- package/dist/types/lib/core.d.ts +2 -2
- package/dist/types/lib/dagre.d.ts +1 -1
- package/dist/types/lib/elk.d.ts +1 -1
- package/dist/types/lib/force.d.ts +1 -1
- package/dist/types/lib/hierarchy.d.ts +1 -1
- package/dist/types/lib/schema.d.ts +2 -2
- package/dist/types/lib/whiteboard.d.ts +1 -1
- package/dist/types/lib/workflow.d.ts +2 -2
- package/dist/types/src/animate/animator.d.ts +6 -6
- package/dist/types/src/animate/clamp-dimensions.d.ts +1 -1
- package/dist/types/src/animate/flow-group.d.ts +1 -1
- package/dist/types/src/animate/handle-registry.d.ts +1 -1
- package/dist/types/src/animate/index.d.ts +19 -19
- package/dist/types/src/animate/interpolators.d.ts +1 -1
- package/dist/types/src/animate/motion/decay.d.ts +1 -1
- package/dist/types/src/animate/motion/index.d.ts +7 -7
- package/dist/types/src/animate/motion/inertia.d.ts +1 -1
- package/dist/types/src/animate/motion/keyframes.d.ts +1 -1
- package/dist/types/src/animate/motion/presets.d.ts +1 -1
- package/dist/types/src/animate/motion/spring.d.ts +1 -1
- package/dist/types/src/animate/particle-renderers.d.ts +1 -1
- package/dist/types/src/animate/recording/event-cursor.d.ts +1 -1
- package/dist/types/src/animate/recording/index.d.ts +7 -7
- package/dist/types/src/animate/recording/recorder.d.ts +1 -1
- package/dist/types/src/animate/recording/recording.d.ts +1 -1
- package/dist/types/src/animate/recording/replay.d.ts +2 -2
- package/dist/types/src/animate/recording/thumbnail.d.ts +1 -1
- package/dist/types/src/animate/recording/types.d.ts +3 -3
- package/dist/types/src/animate/recording/virtual-engine.d.ts +1 -1
- package/dist/types/src/animate/timeline.d.ts +5 -5
- package/dist/types/src/animate/transaction.d.ts +1 -1
- package/dist/types/src/collab/awareness.d.ts +1 -1
- package/dist/types/src/collab/bridge.d.ts +2 -2
- package/dist/types/src/collab/directives/flow-cursors.d.ts +1 -1
- package/dist/types/src/collab/index.d.ts +9 -9
- package/dist/types/src/collab/providers/in-memory.d.ts +1 -1
- package/dist/types/src/collab/providers/reverb.d.ts +1 -1
- package/dist/types/src/collab/providers/websocket.d.ts +1 -1
- package/dist/types/src/collab/store.d.ts +2 -2
- package/dist/types/src/core/__fixtures__/nodes.d.ts +1 -1
- package/dist/types/src/core/announcer.d.ts +10 -3
- package/dist/types/src/core/child-layout.d.ts +1 -1
- package/dist/types/src/core/child-validation.d.ts +1 -1
- package/dist/types/src/core/clipboard.d.ts +1 -1
- package/dist/types/src/core/collapse.d.ts +1 -1
- package/dist/types/src/core/compute.d.ts +1 -1
- package/dist/types/src/core/connections.d.ts +1 -1
- package/dist/types/src/core/controls-panel.d.ts +3 -0
- package/dist/types/src/core/crossing-reduction.d.ts +2 -2
- package/dist/types/src/core/drag.d.ts +1 -1
- package/dist/types/src/core/edge-paths/avoidant.d.ts +3 -3
- package/dist/types/src/core/edge-paths/bezier.d.ts +2 -2
- package/dist/types/src/core/edge-paths/editable.d.ts +2 -2
- package/dist/types/src/core/edge-paths/index.d.ts +7 -7
- package/dist/types/src/core/edge-paths/orthogonal.d.ts +2 -2
- package/dist/types/src/core/edge-paths/smoothstep.d.ts +2 -2
- package/dist/types/src/core/edge-paths/straight.d.ts +1 -1
- package/dist/types/src/core/edge-paths/utils.d.ts +1 -1
- package/dist/types/src/core/edge-utils.d.ts +3 -3
- package/dist/types/src/core/endpoint-spread.d.ts +1 -1
- package/dist/types/src/core/export.d.ts +1 -1
- package/dist/types/src/core/floating-edge.d.ts +1 -1
- package/dist/types/src/core/geometry.d.ts +1 -1
- package/dist/types/src/core/gradients.d.ts +1 -1
- package/dist/types/src/core/graph.d.ts +1 -1
- package/dist/types/src/core/helper-lines.d.ts +1 -1
- package/dist/types/src/core/history.d.ts +1 -1
- package/dist/types/src/core/index.d.ts +17 -17
- package/dist/types/src/core/intersection.d.ts +1 -1
- package/dist/types/src/core/lasso-hit-test.d.ts +1 -1
- package/dist/types/src/core/lasso.d.ts +2 -2
- package/dist/types/src/core/layout/dagre.d.ts +1 -1
- package/dist/types/src/core/layout/elk.d.ts +1 -1
- package/dist/types/src/core/layout/force.d.ts +1 -1
- package/dist/types/src/core/layout/hierarchy.d.ts +1 -1
- package/dist/types/src/core/minimap.d.ts +1 -1
- package/dist/types/src/core/pan-zoom.d.ts +10 -4
- package/dist/types/src/core/proximity-connect.d.ts +1 -1
- package/dist/types/src/core/render-plan.d.ts +1 -1
- package/dist/types/src/core/resize.d.ts +1 -1
- package/dist/types/src/core/schema-geometry.d.ts +1 -1
- package/dist/types/src/core/selection-box.d.ts +1 -1
- package/dist/types/src/core/shapes.d.ts +1 -1
- package/dist/types/src/core/sub-flow.d.ts +1 -1
- package/dist/types/src/core/translations.d.ts +175 -0
- package/dist/types/src/core/types.d.ts +29 -11
- package/dist/types/src/index.d.ts +31 -30
- package/dist/types/src/plugin/connection-utils.d.ts +3 -3
- package/dist/types/src/plugin/data/__real-canvas-harness.d.ts +1 -1
- package/dist/types/src/plugin/data/__test-utils.d.ts +1 -1
- package/dist/types/src/plugin/data/canvas-animation.d.ts +13 -13
- package/dist/types/src/plugin/data/canvas-batch.d.ts +1 -1
- package/dist/types/src/plugin/data/canvas-collapse.d.ts +1 -1
- package/dist/types/src/plugin/data/canvas-compute.d.ts +2 -2
- package/dist/types/src/plugin/data/canvas-condense.d.ts +1 -1
- package/dist/types/src/plugin/data/canvas-config.d.ts +1 -1
- package/dist/types/src/plugin/data/canvas-context.d.ts +22 -22
- package/dist/types/src/plugin/data/canvas-dom.d.ts +2 -2
- package/dist/types/src/plugin/data/canvas-edges.d.ts +2 -2
- package/dist/types/src/plugin/data/canvas-history.d.ts +2 -2
- package/dist/types/src/plugin/data/canvas-layout.d.ts +4 -4
- package/dist/types/src/plugin/data/canvas-nodes.d.ts +2 -2
- package/dist/types/src/plugin/data/canvas-particles.d.ts +2 -2
- package/dist/types/src/plugin/data/canvas-rows.d.ts +2 -2
- package/dist/types/src/plugin/data/canvas-selection.d.ts +1 -1
- package/dist/types/src/plugin/data/canvas-validation.d.ts +2 -2
- package/dist/types/src/plugin/data/canvas-viewport.d.ts +4 -4
- package/dist/types/src/plugin/directives/flow-edge.d.ts +1 -1
- package/dist/types/src/plugin/directives/flow-handle-validate.d.ts +1 -1
- package/dist/types/src/plugin/directives/flow-handle.d.ts +2 -2
- package/dist/types/src/plugin/drag-validation.d.ts +1 -1
- package/dist/types/src/plugin/handle-index.d.ts +1 -1
- package/dist/types/src/schema/canvas-augmentation.test-d.d.ts +1 -1
- package/dist/types/src/schema/diff.d.ts +1 -1
- package/dist/types/src/schema/dot.d.ts +1 -1
- package/dist/types/src/schema/field-ops.d.ts +1 -1
- package/dist/types/src/schema/history.d.ts +1 -1
- package/dist/types/src/schema/index.d.ts +24 -24
- package/dist/types/src/schema/layout.d.ts +1 -1
- package/dist/types/src/schema/references.d.ts +1 -1
- package/dist/types/src/schema/serialization.d.ts +1 -1
- package/dist/types/src/schema/types.d.ts +1 -1
- package/dist/types/src/schema/validate.d.ts +1 -1
- package/dist/types/src/workflow/condition.d.ts +1 -1
- package/dist/types/src/workflow/index.d.ts +3 -3
- package/dist/types/src/workflow/replay.d.ts +1 -1
- package/dist/types/src/workflow/run.d.ts +1 -1
- package/dist/types/src/workflow/types.d.ts +3 -3
- package/package.json +5 -2
- 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,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,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 { 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,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,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 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, 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
|
-
/**
|
|
85
|
-
|
|
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, 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 { 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;
|
|
@@ -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 {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
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
|
|
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.
|