@pixerate/editor-react 0.39.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/index.cjs +516 -312
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +142 -6
- package/dist/canvas/index.d.ts +142 -6
- package/dist/canvas/index.js +203 -0
- package/dist/canvas/index.js.map +1 -1
- package/dist/chart/index.cjs +60 -6
- package/dist/chart/index.cjs.map +1 -1
- package/dist/chart/index.js +1 -1
- package/dist/{chunk-IYHD5Q65.js → chunk-SIEOYRHX.js} +68 -7
- package/dist/chunk-SIEOYRHX.js.map +1 -0
- package/dist/index.cjs +499 -418
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +53 -27
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-IYHD5Q65.js.map +0 -1
package/dist/canvas/index.d.cts
CHANGED
|
@@ -2,10 +2,10 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { AgentPresence } from '@pixerate/editor/agent';
|
|
4
4
|
import * as _pixerate_editor_canvas from '@pixerate/editor/canvas';
|
|
5
|
-
import { CanvasNode, CanvasEdge, IncrementalLayoutOptions, XYPosition, GraphDifferences, Rect, CanvasLayoutOptions, Side, PlaceBesideOptions, getCenteredNodePosition, CanvasDockingCallbacks, DockStrategy, ExplodeNodeOptions, CollapseNodeOptions, ExplosionSnapshot, ArrangeHistoryTarget, SnapGuidesOptions, NodeRectOptions, AutoLayoutOptions, GuideLine, CanvasArrangeAction, ArrangeShortcutBinding, CanvasScenesOptions, CanvasViewport, CanvasScenesStore, CanvasScene, FitViewportOptions, FreehandTool, FreehandStrokeStyle, FreehandStroke, FreehandDrawOptions, ShapeDescription, AutoLayoutMeasure, CanvasTokenOptions, AnimationHistoryTarget, Clock, AnimationLoopMode, AnimatableProperty, CanvasComponentSyncOptions, CanvasComponentsController } from '@pixerate/editor/canvas';
|
|
5
|
+
import { CanvasNode, CanvasEdge, IncrementalLayoutOptions, XYPosition, GraphDifferences, Rect, CanvasLayoutOptions, Side, PlaceBesideOptions, getCenteredNodePosition, CanvasDockingCallbacks, DockStrategy, ExplodeNodeOptions, CollapseNodeOptions, ExplosionSnapshot, ArrangeHistoryTarget, SnapGuidesOptions, NodeRectOptions, AutoLayoutOptions, GuideLine, CanvasArrangeAction, ArrangeShortcutBinding, CanvasScenesOptions, CanvasViewport, CanvasScenesStore, CanvasScene, FitViewportOptions, FreehandTool, FreehandStrokeStyle, FreehandStroke, FreehandDrawOptions, ShapeDescription, AutoLayoutMeasure, CanvasTokenOptions, AnimationHistoryTarget, Clock, AnimationLoopMode, AnimatableProperty, CanvasComponentSyncOptions, CanvasComponentsController, DiagramLayoutOptions, MermaidFlowNode, MermaidFlowEdge, DiagramLayout } from '@pixerate/editor/canvas';
|
|
6
6
|
export { ANIMATABLE_PROPERTIES, ANIMATION_DATA_KEY, ANIMATION_EASING_LABELS, ANIMATION_EASING_PRESETS, ANIMATION_TIME_EPSILON, AUTO_LAYOUT_DATA_KEY, AddCanvasVariantOptions, AlignEdge, AnimatableProperty, AnimateNodeOptions, AnimationDocument, AnimationEasing, AnimationEasingPreset, AnimationEditError, AnimationEditErrorCode, AnimationFrame, AnimationHistoryTarget, AnimationKeyframe, AnimationKeyframeClipboard, AnimationLoopMode, AnimationMotionPath, AnimationOverrides, AnimationPlayer, AnimationPlayerOptions, AnimationPlayerState, AnimationTrack, AnimationValue, AnimationValueType, ArrangeShortcutBinding, AutoLayout, AutoLayoutAlignContent, AutoLayoutAlignCross, AutoLayoutAlignMain, AutoLayoutCellAlign, AutoLayoutChild, AutoLayoutConstraints, AutoLayoutGrid, AutoLayoutGridArea, AutoLayoutGridCell, AutoLayoutGridGeometry, AutoLayoutGridTrack, AutoLayoutHorizontalConstraint, AutoLayoutInsertTarget, AutoLayoutMeasure, AutoLayoutMode, AutoLayoutOptions, AutoLayoutPadding, AutoLayoutSize, AutoLayoutSizing, AutoLayoutSizingPair, AutoLayoutVerticalConstraint, BezierCommand, BezierPath, BezierPathInput, CANVAS_COMPONENT_DRAG_TYPE, CANVAS_GRADIENT_PRESETS, CANVAS_TOKEN_PROPERTIES, CHILD_LAYOUT_DATA_KEY, CONNECTION_LINE_TYPES, CSS_ANIMATION_PROPERTIES, CUBIC_BEZIER_PRESETS, CanvasAnimationController, CanvasAnimationControllerOptions, CanvasAnimationState, CanvasArrangeAction, CanvasAutoLayoutController, CanvasAutoLayoutControllerOptions, CanvasClipboardPayload, CanvasComponentInfo, CanvasComponentPropertyDef, CanvasComponentPropertyField, CanvasComponentResult, CanvasComponentSetInfo, CanvasComponentSyncOptions, CanvasComponentsController, CanvasComponentsControllerOptions, CanvasConnectionLineType, CanvasDockingCallbacks, CanvasDrawControllerOptions, CanvasEdge, CanvasGradientDef, CanvasHeightOptions, CanvasInstanceInfo, CanvasLayoutOptions, CanvasLinearGradient, CanvasNode, CanvasNodeUpdate, CanvasRadialGradient, CanvasScene, CanvasScenesState, CanvasScenesStore, CanvasTokenBindingInfo, CanvasTokenOptions, CanvasTokenProperty, CanvasViewport, Clock, CollapseNodeOptions, CombineShapeNodesOptions, CombineShapeNodesRefusal, CombineShapeNodesResult, ConnectorSnap, ConnectorSnapTarget, CssAnimationExport, CssExportOptions, CubicBezierEasing, CubicSegment, DEFAULT_ARRANGE_SHORTCUTS, DirectionalDisplacementOptions, DisplacementDirection, DistributeAxis, DistributeMode, DividePathsResult, DockStrategy, EllipseShape, ExplodeNodeOptions, ExplosionSnapshot, FanOutTrajectoryOptions, FitCubicsOptions, FitPathDataOptions, FlattenOptions, FreehandStroke, FreehandStrokeStyle, FreehandTool, GradientStop, GraphDifferences, GuideIndex, GuideLine, IncrementalLayoutOptions, KeyframeDragState, KeyframePatch, KeyframeRef, KeyframeSnap, MAX_KEYFRAME_REFS, ManualClock, MeasureGuide, MeasureSelectionOptions, MeasureSelectionResult, MultiPolygon, NodeAnimation, NodeTransition, OffsetPathOptions, OffsetShapeNodesOptions, OklabColor, OutlineShapeStrokesOptions, OutlineStrokeOptions, PathBooleanResult, PathCommand, PathOperand, PathOperandInput, PathOpsOptions, PathShape, PlaceBesideOptions, Point, PolygonBooleanOperation, PolygonBooleanOptions, PolygonFillRule, PolygonInput, PolygonOperand, PolygonPiece, PolygonRing, PolygonToPathOptions, PolygonWithHoles, Position, RESIZE_HANDLES, Rect, RectShape, ReflowDisplacementOptions, RegularPolygonShape, ResizeHandle, SHAPE_DATA_KEY, SHAPE_KINDS, SHAPE_NODE_TYPE, SHAPE_OPERATIONS, SetCanvasVariantPropertiesOptions, ShapeDescription, ShapeKind, ShapeNodePolygonOptions, ShapeOperation, ShapePaint, ShapePathEditOperation, ShapePathEditRefusal, ShapePathEditResult, ShapeRenderData, ShapeSize, Side, SizeDimension, SnapGuidesOptions, SnapNodeResizeOptions, SnapNodeResizeResult, SnapResizeOptions, SnapResizeResult, SnapResult, SpringEasing, StarShape, StrokeCap, StrokeJoin, StrokeToShapeNodeOptions, SvgGradientDef, SvgGradientStop, TOKEN_BINDINGS_DATA_KEY, TOKEN_MODES_DATA_KEY, TimelineKeyframe, TimelineRow, TrajectoryFunction, TrajectoryPoint, WebAnimationSpec, XYPosition, ZOrderOperation, addCanvasVariant, addKeyframesAtTime, alignNodes, angleToSvgLinearCoords, animateNode, applyAnimation, applyAnimationOverrides, applyConstraints, applyNodeUpdates, applyShapeCombination, applyShapeReplacement, bezierPathArea, bezierPathBounds, bezierPathLength, bezierPathPointAtLength, bezierPathSignedArea, bezierPathToSvg, bindCanvasComponentProperty, bindCanvasToken, blendLayout, boundsOf, calculateDagreReflowDisplacement, calculateDirectionalDisplacement, canCombineShapeNodes, canOffsetShapeNodes, canOutlineShapeNodeStrokes, canvasHeight, centerNodes, centre, clampAnimationValue, clampLayoutSize, combineCanvasComponentsAsVariants, combineShapeNodes, computeNodesBoundingBox, computeSnapGuides, connectedOnly, copyKeyframes, countPathSegments, createAnimationPlayer, createBezierTrajectory, createCanvasAnimationController, createCanvasAutoLayoutController, createCanvasComponent, createCanvasComponentsController, createCanvasDrawController, createCanvasInstance, createCanvasScenesStore, createDefaultStrokeStyle, createFanOutTrajectory, createGuideIndex, createNodeGuideIndex, cubicBezierAt, cubicPointAt, cubicsToPathData, dashContours, defaultEasing, deleteKeyframes, detachCanvasInstance, detachTokenBindings, distanceToBezierPath, distributeNodes, dividePaths, dividePolygons, easingFromInfluence, easingLabel, easingToCss, ensureLayout, estimateCanvasHeight, estimateNodeSize, evaluateAnimation, evaluateEasing, evaluateTrack, excludePaths, exportCssAnimation, findConnectorSnap, findStrokesAtPoint, fitCubicRun, fitCubics, fitFreehandPath, fitPathData, fitViewportToNodes, fitViewportToRect, flattenSvgPath, flowSide, formatAnimationTime, formatOklab, getAbsolutePosition, getAnimatableProperty, getAnimatedProperties, getAnimatedValue, getAnimationDuration, getAnimationTrack, getAutoLayout, getAutoLayoutGrid, getAutoLayoutInsertTarget, getBindableTokenProperties, getCanvasComponentDragId, getCanvasTokenProperty, getCenteredNodePosition, getChildLayout, getComponentSourceId, getCssPropertyAnimations, getEffectiveTokenModes, getFlowChildren, getInstanceData, getInstanceStatus, getKeyframeTimes, getLayoutParent, getLayoutSizing, getLayoutedNodes, getNextVariantValues, getNodeAnimation, getNodeOverrides, getNodeRect, getNodeShape, getNodeSize, getNodeTokenBindings, getNodeTokenModes, getResizingNodeRect, getShapeRenderData, getShapeSvg, getTimelineRows, getTimelineTicks, getTokenPropertyScope, getTokensForProperty, gradientToSvgDef, handlePoint, hasVisibleStroke, inferResizeHandle, inspectCanvasInstance, inspectNodeTokens, interpolateAnimationValue, intersectPaths, intersectPolygons, invertNodeUpdates, isAnimationEasing, isAnimationKeyframe, isAutoLayoutFrame, isCanvasComponent, isCanvasComponentSet, isCanvasGradient, isCanvasInstance, isCssExportExact, isEventFromTextInput, isKeyframeSelected, isLocked, isMeasureModifierHeld, isNodeAnimated, isShapeDescription, isShapeNode, isStraightCubic, isValidCanvasNode, isValidUrl, layoutAll, layoutBounds, layoutFrame, layoutUp, layoutUpMany, linearPositionTrajectory, linearTrajectory, listCanvasComponents, lockNodes, makeSizingCoherent, matchArrangeShortcut, matchSize, measureBetween, measureLabel, measureSelection, measureToLine, mergeNodeUpdates, mixColorsOklab, moveKeyframes, moveLayoutChild, multiPolygonArea, multiPolygonBounds, nearestHandlePositions, normalizeBezierPath, normalizeKeyframes, offsetPath, offsetShapeNodes, oklabToRgb, oppositePosition, outlineShapeNodeStrokes, outlineStroke, overlaps, parseCanvasClipboardData, parseCanvasScenes, parseCssEasing, parseCssGradient, parseKeyframeClipboard, parseOklab, parseSvgPath, pasteKeyframes, pathBoolean, placeBeside, playWebAnimations, pointInBezierPath, pointInMultiPolygon, pointInRings, polygonArea, polygonBoolean, polygonToSvgPath, positionToSide, pruneCanvasTokenModes, pushCanvasInstanceOverrides, readAnimatableValue, readNodeStyleProperty, readStyleSize, realClock, recordAnimationChanges, relayoutUpdates, remapPastedNodes, removeCanvasVariant, removeTrack, renameCanvasVariantProperty, renameCanvasVariantValue, reorderNodes, repositionNodesTo, resetCanvasInstanceOverrides, resizeHandleAxes, resolveCanvasGradient, resolveCanvasTokens, resolveEasing, resolvePadding, restoreCanvasMainComponent, revertShapeCombination, rgbToOklab, ringSignedArea, runMultiNodeTransition, sampleAnimationFrames, scaleKeyframes, serializeCanvasNodes, setCanvasComponentProperty, setCanvasInstanceProperties, setCanvasTokenMode, setCanvasVariantProperties, setKeyframe, setKeyframeEasing, setMotionPath, setTrackEnabled, shapeNodeToBezierPath, shapeNodeToPolygon, shapeToBezierPath, shapeToPolygon, sideToPosition, simplifyRing, snapKeyframeDelta, snapNodeDrag, snapNodeResize, snapResize, snapTimeToFrame, snapToGrid, springAt, streamlinePoints, strokeOutlineRings, strokePointsToPathData, strokeToShapeNode, subtractPaths, subtractPolygons, swapCanvasInstance, syncAllCanvasInstances, syncCanvasComponents, syncCanvasInstance, timeToX, toBezierPath, toWebAnimations, toggleLockNodes, transformBezierPath, unionPolygons, unitePaths, unlockNodes, updateKeyframe, withNodeAnimation, withStyleSize, wouldCreateComponentCycle, wrapAnimationTime, writeNodeStyleProperty, xToTime, xorPolygons } from '@pixerate/editor/canvas';
|
|
7
7
|
import { TokenState, TokenStore, TokenModeContext } from '@pixerate/editor/tokens';
|
|
8
|
-
import
|
|
8
|
+
import { DiagramControllerOptions, DiagramController, DiagramState, MermaidDocument, EditOp, DiagramActionResult, DiagramPlacement, PresenceClock, PresenceStore, DiagramDirector, PresenceState } from '@pixerate/editor/diagram';
|
|
9
9
|
|
|
10
10
|
interface AgentPresenceLayerProps {
|
|
11
11
|
presences: AgentPresence[];
|
|
@@ -572,7 +572,7 @@ declare function useCanvasAnimation<TNode extends CanvasNode = CanvasNode>(optio
|
|
|
572
572
|
/** The nodes evaluated at the playhead; render these. */
|
|
573
573
|
displayNodes: TNode[];
|
|
574
574
|
clipboard: _pixerate_editor_canvas.AnimationKeyframeClipboard | null;
|
|
575
|
-
player:
|
|
575
|
+
player: _pixerate_editor_canvas.AnimationPlayer;
|
|
576
576
|
getState: () => _pixerate_editor_canvas.CanvasAnimationState;
|
|
577
577
|
subscribe(listener: (state: _pixerate_editor_canvas.CanvasAnimationState) => void): () => void;
|
|
578
578
|
refresh(): void;
|
|
@@ -594,10 +594,10 @@ declare function useCanvasAnimation<TNode extends CanvasNode = CanvasNode>(optio
|
|
|
594
594
|
display: (nodes?: readonly TNode[] | undefined) => TNode[];
|
|
595
595
|
applyDisplayChanges(next: TNode[]): _pixerate_editor_canvas.KeyframeRef[];
|
|
596
596
|
addKeyframe(ids?: Iterable<string>, keys?: readonly string[], time?: number): _pixerate_editor_canvas.KeyframeRef[];
|
|
597
|
-
setKeyframe(nodeId: string, property: string, value:
|
|
597
|
+
setKeyframe(nodeId: string, property: string, value: _pixerate_editor_canvas.AnimationValue, time?: number, easing?: _pixerate_editor_canvas.AnimationEasing | string): void;
|
|
598
598
|
updateKeyframe(ref: _pixerate_editor_canvas.KeyframeRef, patch: _pixerate_editor_canvas.KeyframePatch): void;
|
|
599
599
|
deleteKeyframes(refs?: readonly _pixerate_editor_canvas.KeyframeRef[]): boolean;
|
|
600
|
-
setEasing(easing:
|
|
600
|
+
setEasing(easing: _pixerate_editor_canvas.AnimationEasing | string | null, refs?: readonly _pixerate_editor_canvas.KeyframeRef[]): boolean;
|
|
601
601
|
setTrackEnabled(nodeId: string, property: string, enabled: boolean): void;
|
|
602
602
|
removeTrack(nodeId: string, property: string): void;
|
|
603
603
|
setMotionPath(nodeId: string, motionPath: {
|
|
@@ -766,4 +766,140 @@ interface CanvasInstanceInspectorProps<TNode extends CanvasNode = CanvasNode> {
|
|
|
766
766
|
*/
|
|
767
767
|
declare function CanvasInstanceInspector<TNode extends CanvasNode = CanvasNode>({ nodes, nodeId, components, onError, className }: CanvasInstanceInspectorProps<TNode>): React__default.JSX.Element | null;
|
|
768
768
|
|
|
769
|
-
|
|
769
|
+
interface UseMermaidDiagramOptions extends DiagramControllerOptions {
|
|
770
|
+
/** Layout spacing and node measuring for new nodes (stored positions always win). */
|
|
771
|
+
layoutOptions?: DiagramLayoutOptions;
|
|
772
|
+
}
|
|
773
|
+
type Placed = {
|
|
774
|
+
id: string;
|
|
775
|
+
position: {
|
|
776
|
+
x: number;
|
|
777
|
+
y: number;
|
|
778
|
+
};
|
|
779
|
+
parentId?: string;
|
|
780
|
+
};
|
|
781
|
+
interface UseMermaidDiagramResult {
|
|
782
|
+
controller: DiagramController;
|
|
783
|
+
state: DiagramState;
|
|
784
|
+
document: MermaidDocument;
|
|
785
|
+
/** The Mermaid text (with the `%% @pixerate` layout comment). */
|
|
786
|
+
source: string;
|
|
787
|
+
/** Canvas nodes (groups first, children relative to their group) and edges. */
|
|
788
|
+
nodes: MermaidFlowNode[];
|
|
789
|
+
edges: MermaidFlowEdge[];
|
|
790
|
+
layout: DiagramLayout;
|
|
791
|
+
apply: (ops: EditOp | EditOp[], label?: string) => DiagramActionResult;
|
|
792
|
+
/** Replaces the source; `clearHistory` when opening a different diagram. */
|
|
793
|
+
load: (source: string, options?: {
|
|
794
|
+
clearHistory?: boolean;
|
|
795
|
+
}) => DiagramActionResult;
|
|
796
|
+
/** Stores where dragged nodes ended up (pass every canvas node as `all` so groups carry their contents). */
|
|
797
|
+
moveNodes: (moved: readonly Placed[], all?: readonly Placed[]) => DiagramActionResult | null;
|
|
798
|
+
connect: (source: string, target: string, label?: string) => DiagramActionResult;
|
|
799
|
+
/** Removes nodes / groups (with their edges) and edges by id, as one undo step. */
|
|
800
|
+
remove: (ids: readonly string[]) => DiagramActionResult;
|
|
801
|
+
rename: (id: string, label: string) => DiagramActionResult;
|
|
802
|
+
select: (ids: readonly string[]) => void;
|
|
803
|
+
undo: () => void;
|
|
804
|
+
redo: () => void;
|
|
805
|
+
}
|
|
806
|
+
/** The controller's state (re-renders on every change). */
|
|
807
|
+
declare function useDiagramState(controller: DiagramController): DiagramState;
|
|
808
|
+
/**
|
|
809
|
+
* A Mermaid diagram on a React Flow canvas: subscribes to a `DiagramController` (or creates
|
|
810
|
+
* one from options), lays it out and returns canvas nodes and edges with bound edits. Every
|
|
811
|
+
* edit rewrites only the statements it touches; positions go into `%% @pixerate`.
|
|
812
|
+
*/
|
|
813
|
+
declare function useMermaidDiagram(controllerOrOptions?: DiagramController | UseMermaidDiagramOptions): UseMermaidDiagramResult;
|
|
814
|
+
interface UseMermaidStreamOptions extends DiagramLayoutOptions {
|
|
815
|
+
/** True once the whole source has arrived (unconnected nodes are shown then). */
|
|
816
|
+
complete?: boolean;
|
|
817
|
+
/** Glide duration between layouts in ms (default 300; 0 jumps). */
|
|
818
|
+
duration?: number;
|
|
819
|
+
}
|
|
820
|
+
interface UseMermaidStreamResult {
|
|
821
|
+
document: MermaidDocument | null;
|
|
822
|
+
nodes: MermaidFlowNode[];
|
|
823
|
+
edges: MermaidFlowEdge[];
|
|
824
|
+
/** The layout being shown (mid-glide while `settled` is false). */
|
|
825
|
+
layout: DiagramLayout | null;
|
|
826
|
+
settled: boolean;
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* Draws Mermaid that is still being written (e.g. a model's reply): nodes appear once an
|
|
830
|
+
* edge places them and glide to their new places as the layout grows. Read-only.
|
|
831
|
+
*/
|
|
832
|
+
declare function useMermaidStream(source: string, options?: UseMermaidStreamOptions): UseMermaidStreamResult;
|
|
833
|
+
|
|
834
|
+
/** Node data as `mermaidToCanvas` produces it. */
|
|
835
|
+
interface MermaidDiagramNodeData {
|
|
836
|
+
node?: {
|
|
837
|
+
id: string;
|
|
838
|
+
label: string;
|
|
839
|
+
shape: string;
|
|
840
|
+
data?: Record<string, unknown>;
|
|
841
|
+
};
|
|
842
|
+
group?: {
|
|
843
|
+
id: string;
|
|
844
|
+
label: string;
|
|
845
|
+
};
|
|
846
|
+
resolvedStyles?: Record<string, string>;
|
|
847
|
+
[key: string]: unknown;
|
|
848
|
+
}
|
|
849
|
+
interface MermaidDiagramNodeProps {
|
|
850
|
+
id?: string;
|
|
851
|
+
data: MermaidDiagramNodeData;
|
|
852
|
+
width?: number;
|
|
853
|
+
height?: number;
|
|
854
|
+
selected?: boolean;
|
|
855
|
+
className?: string;
|
|
856
|
+
/** Rendered over the node, e.g. React Flow `<Handle>`s. */
|
|
857
|
+
children?: React__default.ReactNode;
|
|
858
|
+
[key: string]: unknown;
|
|
859
|
+
}
|
|
860
|
+
/** Mermaid `style` / `classDef` declarations as the CSS the node paints with. */
|
|
861
|
+
declare function mermaidNodeStyle(styles?: Record<string, string>, selected?: boolean): React__default.CSSProperties;
|
|
862
|
+
/**
|
|
863
|
+
* Headless Mermaid node: draws the node's shape (flowchart, state, class, ER) as SVG with
|
|
864
|
+
* its label, painted from its Mermaid styles. Register it as the `mermaid-node` React Flow
|
|
865
|
+
* node type and pass `<Handle>`s as children.
|
|
866
|
+
*/
|
|
867
|
+
declare function MermaidDiagramNode({ data, width, height, selected, className, children }: MermaidDiagramNodeProps): React__default.JSX.Element | null;
|
|
868
|
+
/** Headless Mermaid group (subgraph, composite state, namespace): a titled frame. Register as `mermaid-group`. */
|
|
869
|
+
declare function MermaidDiagramGroup({ data, selected, className, children }: MermaidDiagramNodeProps): React__default.JSX.Element | null;
|
|
870
|
+
|
|
871
|
+
interface UseDiagramDirectorOptions {
|
|
872
|
+
/** Where nodes are drawn now, e.g. `() => diagram.layout` from `useMermaidDiagram`. */
|
|
873
|
+
placement: () => DiagramPlacement;
|
|
874
|
+
/** 1 = natural speed; 2 = twice as fast. */
|
|
875
|
+
speed?: number;
|
|
876
|
+
clock?: PresenceClock;
|
|
877
|
+
/** Hide a cursor this long after its last call (ms, default 1500). */
|
|
878
|
+
linger?: number;
|
|
879
|
+
}
|
|
880
|
+
/**
|
|
881
|
+
* A `PresenceStore` and `DiagramDirector` for a diagram, created once: pass `director` to
|
|
882
|
+
* `createDiagramToolProvider` so agent edits are acted out by a cursor, and `presence` to
|
|
883
|
+
* `<DiagramPresenceLayer>` to draw it.
|
|
884
|
+
*/
|
|
885
|
+
declare function useDiagramDirector(controller: DiagramController, options: UseDiagramDirectorOptions): {
|
|
886
|
+
presence: PresenceStore;
|
|
887
|
+
director: DiagramDirector;
|
|
888
|
+
};
|
|
889
|
+
/** The presence store's state (re-renders on every cursor move). */
|
|
890
|
+
declare function usePresenceState(presence: PresenceStore): PresenceState;
|
|
891
|
+
|
|
892
|
+
interface DiagramPresenceLayerProps {
|
|
893
|
+
presence: PresenceStore;
|
|
894
|
+
/** The canvas viewport (React Flow's `useViewport()`), to place cursors given in canvas coordinates. */
|
|
895
|
+
viewport: {
|
|
896
|
+
x: number;
|
|
897
|
+
y: number;
|
|
898
|
+
zoom: number;
|
|
899
|
+
};
|
|
900
|
+
className?: string;
|
|
901
|
+
}
|
|
902
|
+
/** Agent cursors and their notes over a canvas, from a `PresenceStore` (see `DiagramDirector`). */
|
|
903
|
+
declare function DiagramPresenceLayer({ presence, viewport, className }: DiagramPresenceLayerProps): React__default.JSX.Element | null;
|
|
904
|
+
|
|
905
|
+
export { AgentPresenceLayer, type AgentPresenceLayerProps, AnimationTimeline, type AnimationTimelineProps, type CanvasAnimation, type CanvasArrange, type CanvasAutoLayout, type CanvasComponents, CanvasComponentsPanel, type CanvasComponentsPanelActions, type CanvasComponentsPanelProps, type CanvasDraw, type CanvasDrawActions, CanvasDrawLayer, type CanvasDrawLayerProps, type CanvasDrawState, type CanvasGraphTarget, CanvasGuidesLayer, type CanvasGuidesLayerProps, CanvasInstanceInspector, type CanvasInstanceInspectorActions, type CanvasInstanceInspectorProps, type CanvasMeasure, type CanvasScenes, type CanvasTokens, DiagramPresenceLayer, type DiagramPresenceLayerProps, MermaidDiagramGroup, MermaidDiagramNode, type MermaidDiagramNodeData, type MermaidDiagramNodeProps, ShapeNode, type ShapeNodeProps, TokenBindingPicker, type TokenBindingPickerProps, TokenModeSwitcher, type TokenModeSwitcherProps, type UseCanvasAnimationOptions, type UseCanvasArrangeOptions, type UseCanvasArrangeShortcutsOptions, type UseCanvasAutoLayoutOptions, type UseCanvasClipboardOptions, type UseCanvasComponentsOptions, type UseCanvasDockingOptions, type UseCanvasDrawOptions, type UseCanvasGraphOptions, type UseCanvasLayoutOptions, type UseCanvasMeasureOptions, type UseCanvasScenesOptions, type UseCanvasShortcutsOptions, type UseCanvasTokensOptions, type UseDiagramDirectorOptions, type UseMermaidDiagramOptions, type UseMermaidDiagramResult, type UseMermaidStreamOptions, type UseMermaidStreamResult, type UseStreamingCanvasOptions, mermaidNodeStyle, useCanvasAnimation, useCanvasArrange, useCanvasArrangeShortcuts, useCanvasAutoLayout, useCanvasClipboard, useCanvasComponents, useCanvasDocking, useCanvasDraw, useCanvasExplosion, useCanvasGraph, useCanvasLayout, useCanvasMeasure, useCanvasScenes, useCanvasShortcuts, useCanvasTokens, useDiagramDirector, useDiagramState, useMermaidDiagram, useMermaidStream, usePresenceState, useStreamingCanvas };
|
package/dist/canvas/index.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { AgentPresence } from '@pixerate/editor/agent';
|
|
4
4
|
import * as _pixerate_editor_canvas from '@pixerate/editor/canvas';
|
|
5
|
-
import { CanvasNode, CanvasEdge, IncrementalLayoutOptions, XYPosition, GraphDifferences, Rect, CanvasLayoutOptions, Side, PlaceBesideOptions, getCenteredNodePosition, CanvasDockingCallbacks, DockStrategy, ExplodeNodeOptions, CollapseNodeOptions, ExplosionSnapshot, ArrangeHistoryTarget, SnapGuidesOptions, NodeRectOptions, AutoLayoutOptions, GuideLine, CanvasArrangeAction, ArrangeShortcutBinding, CanvasScenesOptions, CanvasViewport, CanvasScenesStore, CanvasScene, FitViewportOptions, FreehandTool, FreehandStrokeStyle, FreehandStroke, FreehandDrawOptions, ShapeDescription, AutoLayoutMeasure, CanvasTokenOptions, AnimationHistoryTarget, Clock, AnimationLoopMode, AnimatableProperty, CanvasComponentSyncOptions, CanvasComponentsController } from '@pixerate/editor/canvas';
|
|
5
|
+
import { CanvasNode, CanvasEdge, IncrementalLayoutOptions, XYPosition, GraphDifferences, Rect, CanvasLayoutOptions, Side, PlaceBesideOptions, getCenteredNodePosition, CanvasDockingCallbacks, DockStrategy, ExplodeNodeOptions, CollapseNodeOptions, ExplosionSnapshot, ArrangeHistoryTarget, SnapGuidesOptions, NodeRectOptions, AutoLayoutOptions, GuideLine, CanvasArrangeAction, ArrangeShortcutBinding, CanvasScenesOptions, CanvasViewport, CanvasScenesStore, CanvasScene, FitViewportOptions, FreehandTool, FreehandStrokeStyle, FreehandStroke, FreehandDrawOptions, ShapeDescription, AutoLayoutMeasure, CanvasTokenOptions, AnimationHistoryTarget, Clock, AnimationLoopMode, AnimatableProperty, CanvasComponentSyncOptions, CanvasComponentsController, DiagramLayoutOptions, MermaidFlowNode, MermaidFlowEdge, DiagramLayout } from '@pixerate/editor/canvas';
|
|
6
6
|
export { ANIMATABLE_PROPERTIES, ANIMATION_DATA_KEY, ANIMATION_EASING_LABELS, ANIMATION_EASING_PRESETS, ANIMATION_TIME_EPSILON, AUTO_LAYOUT_DATA_KEY, AddCanvasVariantOptions, AlignEdge, AnimatableProperty, AnimateNodeOptions, AnimationDocument, AnimationEasing, AnimationEasingPreset, AnimationEditError, AnimationEditErrorCode, AnimationFrame, AnimationHistoryTarget, AnimationKeyframe, AnimationKeyframeClipboard, AnimationLoopMode, AnimationMotionPath, AnimationOverrides, AnimationPlayer, AnimationPlayerOptions, AnimationPlayerState, AnimationTrack, AnimationValue, AnimationValueType, ArrangeShortcutBinding, AutoLayout, AutoLayoutAlignContent, AutoLayoutAlignCross, AutoLayoutAlignMain, AutoLayoutCellAlign, AutoLayoutChild, AutoLayoutConstraints, AutoLayoutGrid, AutoLayoutGridArea, AutoLayoutGridCell, AutoLayoutGridGeometry, AutoLayoutGridTrack, AutoLayoutHorizontalConstraint, AutoLayoutInsertTarget, AutoLayoutMeasure, AutoLayoutMode, AutoLayoutOptions, AutoLayoutPadding, AutoLayoutSize, AutoLayoutSizing, AutoLayoutSizingPair, AutoLayoutVerticalConstraint, BezierCommand, BezierPath, BezierPathInput, CANVAS_COMPONENT_DRAG_TYPE, CANVAS_GRADIENT_PRESETS, CANVAS_TOKEN_PROPERTIES, CHILD_LAYOUT_DATA_KEY, CONNECTION_LINE_TYPES, CSS_ANIMATION_PROPERTIES, CUBIC_BEZIER_PRESETS, CanvasAnimationController, CanvasAnimationControllerOptions, CanvasAnimationState, CanvasArrangeAction, CanvasAutoLayoutController, CanvasAutoLayoutControllerOptions, CanvasClipboardPayload, CanvasComponentInfo, CanvasComponentPropertyDef, CanvasComponentPropertyField, CanvasComponentResult, CanvasComponentSetInfo, CanvasComponentSyncOptions, CanvasComponentsController, CanvasComponentsControllerOptions, CanvasConnectionLineType, CanvasDockingCallbacks, CanvasDrawControllerOptions, CanvasEdge, CanvasGradientDef, CanvasHeightOptions, CanvasInstanceInfo, CanvasLayoutOptions, CanvasLinearGradient, CanvasNode, CanvasNodeUpdate, CanvasRadialGradient, CanvasScene, CanvasScenesState, CanvasScenesStore, CanvasTokenBindingInfo, CanvasTokenOptions, CanvasTokenProperty, CanvasViewport, Clock, CollapseNodeOptions, CombineShapeNodesOptions, CombineShapeNodesRefusal, CombineShapeNodesResult, ConnectorSnap, ConnectorSnapTarget, CssAnimationExport, CssExportOptions, CubicBezierEasing, CubicSegment, DEFAULT_ARRANGE_SHORTCUTS, DirectionalDisplacementOptions, DisplacementDirection, DistributeAxis, DistributeMode, DividePathsResult, DockStrategy, EllipseShape, ExplodeNodeOptions, ExplosionSnapshot, FanOutTrajectoryOptions, FitCubicsOptions, FitPathDataOptions, FlattenOptions, FreehandStroke, FreehandStrokeStyle, FreehandTool, GradientStop, GraphDifferences, GuideIndex, GuideLine, IncrementalLayoutOptions, KeyframeDragState, KeyframePatch, KeyframeRef, KeyframeSnap, MAX_KEYFRAME_REFS, ManualClock, MeasureGuide, MeasureSelectionOptions, MeasureSelectionResult, MultiPolygon, NodeAnimation, NodeTransition, OffsetPathOptions, OffsetShapeNodesOptions, OklabColor, OutlineShapeStrokesOptions, OutlineStrokeOptions, PathBooleanResult, PathCommand, PathOperand, PathOperandInput, PathOpsOptions, PathShape, PlaceBesideOptions, Point, PolygonBooleanOperation, PolygonBooleanOptions, PolygonFillRule, PolygonInput, PolygonOperand, PolygonPiece, PolygonRing, PolygonToPathOptions, PolygonWithHoles, Position, RESIZE_HANDLES, Rect, RectShape, ReflowDisplacementOptions, RegularPolygonShape, ResizeHandle, SHAPE_DATA_KEY, SHAPE_KINDS, SHAPE_NODE_TYPE, SHAPE_OPERATIONS, SetCanvasVariantPropertiesOptions, ShapeDescription, ShapeKind, ShapeNodePolygonOptions, ShapeOperation, ShapePaint, ShapePathEditOperation, ShapePathEditRefusal, ShapePathEditResult, ShapeRenderData, ShapeSize, Side, SizeDimension, SnapGuidesOptions, SnapNodeResizeOptions, SnapNodeResizeResult, SnapResizeOptions, SnapResizeResult, SnapResult, SpringEasing, StarShape, StrokeCap, StrokeJoin, StrokeToShapeNodeOptions, SvgGradientDef, SvgGradientStop, TOKEN_BINDINGS_DATA_KEY, TOKEN_MODES_DATA_KEY, TimelineKeyframe, TimelineRow, TrajectoryFunction, TrajectoryPoint, WebAnimationSpec, XYPosition, ZOrderOperation, addCanvasVariant, addKeyframesAtTime, alignNodes, angleToSvgLinearCoords, animateNode, applyAnimation, applyAnimationOverrides, applyConstraints, applyNodeUpdates, applyShapeCombination, applyShapeReplacement, bezierPathArea, bezierPathBounds, bezierPathLength, bezierPathPointAtLength, bezierPathSignedArea, bezierPathToSvg, bindCanvasComponentProperty, bindCanvasToken, blendLayout, boundsOf, calculateDagreReflowDisplacement, calculateDirectionalDisplacement, canCombineShapeNodes, canOffsetShapeNodes, canOutlineShapeNodeStrokes, canvasHeight, centerNodes, centre, clampAnimationValue, clampLayoutSize, combineCanvasComponentsAsVariants, combineShapeNodes, computeNodesBoundingBox, computeSnapGuides, connectedOnly, copyKeyframes, countPathSegments, createAnimationPlayer, createBezierTrajectory, createCanvasAnimationController, createCanvasAutoLayoutController, createCanvasComponent, createCanvasComponentsController, createCanvasDrawController, createCanvasInstance, createCanvasScenesStore, createDefaultStrokeStyle, createFanOutTrajectory, createGuideIndex, createNodeGuideIndex, cubicBezierAt, cubicPointAt, cubicsToPathData, dashContours, defaultEasing, deleteKeyframes, detachCanvasInstance, detachTokenBindings, distanceToBezierPath, distributeNodes, dividePaths, dividePolygons, easingFromInfluence, easingLabel, easingToCss, ensureLayout, estimateCanvasHeight, estimateNodeSize, evaluateAnimation, evaluateEasing, evaluateTrack, excludePaths, exportCssAnimation, findConnectorSnap, findStrokesAtPoint, fitCubicRun, fitCubics, fitFreehandPath, fitPathData, fitViewportToNodes, fitViewportToRect, flattenSvgPath, flowSide, formatAnimationTime, formatOklab, getAbsolutePosition, getAnimatableProperty, getAnimatedProperties, getAnimatedValue, getAnimationDuration, getAnimationTrack, getAutoLayout, getAutoLayoutGrid, getAutoLayoutInsertTarget, getBindableTokenProperties, getCanvasComponentDragId, getCanvasTokenProperty, getCenteredNodePosition, getChildLayout, getComponentSourceId, getCssPropertyAnimations, getEffectiveTokenModes, getFlowChildren, getInstanceData, getInstanceStatus, getKeyframeTimes, getLayoutParent, getLayoutSizing, getLayoutedNodes, getNextVariantValues, getNodeAnimation, getNodeOverrides, getNodeRect, getNodeShape, getNodeSize, getNodeTokenBindings, getNodeTokenModes, getResizingNodeRect, getShapeRenderData, getShapeSvg, getTimelineRows, getTimelineTicks, getTokenPropertyScope, getTokensForProperty, gradientToSvgDef, handlePoint, hasVisibleStroke, inferResizeHandle, inspectCanvasInstance, inspectNodeTokens, interpolateAnimationValue, intersectPaths, intersectPolygons, invertNodeUpdates, isAnimationEasing, isAnimationKeyframe, isAutoLayoutFrame, isCanvasComponent, isCanvasComponentSet, isCanvasGradient, isCanvasInstance, isCssExportExact, isEventFromTextInput, isKeyframeSelected, isLocked, isMeasureModifierHeld, isNodeAnimated, isShapeDescription, isShapeNode, isStraightCubic, isValidCanvasNode, isValidUrl, layoutAll, layoutBounds, layoutFrame, layoutUp, layoutUpMany, linearPositionTrajectory, linearTrajectory, listCanvasComponents, lockNodes, makeSizingCoherent, matchArrangeShortcut, matchSize, measureBetween, measureLabel, measureSelection, measureToLine, mergeNodeUpdates, mixColorsOklab, moveKeyframes, moveLayoutChild, multiPolygonArea, multiPolygonBounds, nearestHandlePositions, normalizeBezierPath, normalizeKeyframes, offsetPath, offsetShapeNodes, oklabToRgb, oppositePosition, outlineShapeNodeStrokes, outlineStroke, overlaps, parseCanvasClipboardData, parseCanvasScenes, parseCssEasing, parseCssGradient, parseKeyframeClipboard, parseOklab, parseSvgPath, pasteKeyframes, pathBoolean, placeBeside, playWebAnimations, pointInBezierPath, pointInMultiPolygon, pointInRings, polygonArea, polygonBoolean, polygonToSvgPath, positionToSide, pruneCanvasTokenModes, pushCanvasInstanceOverrides, readAnimatableValue, readNodeStyleProperty, readStyleSize, realClock, recordAnimationChanges, relayoutUpdates, remapPastedNodes, removeCanvasVariant, removeTrack, renameCanvasVariantProperty, renameCanvasVariantValue, reorderNodes, repositionNodesTo, resetCanvasInstanceOverrides, resizeHandleAxes, resolveCanvasGradient, resolveCanvasTokens, resolveEasing, resolvePadding, restoreCanvasMainComponent, revertShapeCombination, rgbToOklab, ringSignedArea, runMultiNodeTransition, sampleAnimationFrames, scaleKeyframes, serializeCanvasNodes, setCanvasComponentProperty, setCanvasInstanceProperties, setCanvasTokenMode, setCanvasVariantProperties, setKeyframe, setKeyframeEasing, setMotionPath, setTrackEnabled, shapeNodeToBezierPath, shapeNodeToPolygon, shapeToBezierPath, shapeToPolygon, sideToPosition, simplifyRing, snapKeyframeDelta, snapNodeDrag, snapNodeResize, snapResize, snapTimeToFrame, snapToGrid, springAt, streamlinePoints, strokeOutlineRings, strokePointsToPathData, strokeToShapeNode, subtractPaths, subtractPolygons, swapCanvasInstance, syncAllCanvasInstances, syncCanvasComponents, syncCanvasInstance, timeToX, toBezierPath, toWebAnimations, toggleLockNodes, transformBezierPath, unionPolygons, unitePaths, unlockNodes, updateKeyframe, withNodeAnimation, withStyleSize, wouldCreateComponentCycle, wrapAnimationTime, writeNodeStyleProperty, xToTime, xorPolygons } from '@pixerate/editor/canvas';
|
|
7
7
|
import { TokenState, TokenStore, TokenModeContext } from '@pixerate/editor/tokens';
|
|
8
|
-
import
|
|
8
|
+
import { DiagramControllerOptions, DiagramController, DiagramState, MermaidDocument, EditOp, DiagramActionResult, DiagramPlacement, PresenceClock, PresenceStore, DiagramDirector, PresenceState } from '@pixerate/editor/diagram';
|
|
9
9
|
|
|
10
10
|
interface AgentPresenceLayerProps {
|
|
11
11
|
presences: AgentPresence[];
|
|
@@ -572,7 +572,7 @@ declare function useCanvasAnimation<TNode extends CanvasNode = CanvasNode>(optio
|
|
|
572
572
|
/** The nodes evaluated at the playhead; render these. */
|
|
573
573
|
displayNodes: TNode[];
|
|
574
574
|
clipboard: _pixerate_editor_canvas.AnimationKeyframeClipboard | null;
|
|
575
|
-
player:
|
|
575
|
+
player: _pixerate_editor_canvas.AnimationPlayer;
|
|
576
576
|
getState: () => _pixerate_editor_canvas.CanvasAnimationState;
|
|
577
577
|
subscribe(listener: (state: _pixerate_editor_canvas.CanvasAnimationState) => void): () => void;
|
|
578
578
|
refresh(): void;
|
|
@@ -594,10 +594,10 @@ declare function useCanvasAnimation<TNode extends CanvasNode = CanvasNode>(optio
|
|
|
594
594
|
display: (nodes?: readonly TNode[] | undefined) => TNode[];
|
|
595
595
|
applyDisplayChanges(next: TNode[]): _pixerate_editor_canvas.KeyframeRef[];
|
|
596
596
|
addKeyframe(ids?: Iterable<string>, keys?: readonly string[], time?: number): _pixerate_editor_canvas.KeyframeRef[];
|
|
597
|
-
setKeyframe(nodeId: string, property: string, value:
|
|
597
|
+
setKeyframe(nodeId: string, property: string, value: _pixerate_editor_canvas.AnimationValue, time?: number, easing?: _pixerate_editor_canvas.AnimationEasing | string): void;
|
|
598
598
|
updateKeyframe(ref: _pixerate_editor_canvas.KeyframeRef, patch: _pixerate_editor_canvas.KeyframePatch): void;
|
|
599
599
|
deleteKeyframes(refs?: readonly _pixerate_editor_canvas.KeyframeRef[]): boolean;
|
|
600
|
-
setEasing(easing:
|
|
600
|
+
setEasing(easing: _pixerate_editor_canvas.AnimationEasing | string | null, refs?: readonly _pixerate_editor_canvas.KeyframeRef[]): boolean;
|
|
601
601
|
setTrackEnabled(nodeId: string, property: string, enabled: boolean): void;
|
|
602
602
|
removeTrack(nodeId: string, property: string): void;
|
|
603
603
|
setMotionPath(nodeId: string, motionPath: {
|
|
@@ -766,4 +766,140 @@ interface CanvasInstanceInspectorProps<TNode extends CanvasNode = CanvasNode> {
|
|
|
766
766
|
*/
|
|
767
767
|
declare function CanvasInstanceInspector<TNode extends CanvasNode = CanvasNode>({ nodes, nodeId, components, onError, className }: CanvasInstanceInspectorProps<TNode>): React__default.JSX.Element | null;
|
|
768
768
|
|
|
769
|
-
|
|
769
|
+
interface UseMermaidDiagramOptions extends DiagramControllerOptions {
|
|
770
|
+
/** Layout spacing and node measuring for new nodes (stored positions always win). */
|
|
771
|
+
layoutOptions?: DiagramLayoutOptions;
|
|
772
|
+
}
|
|
773
|
+
type Placed = {
|
|
774
|
+
id: string;
|
|
775
|
+
position: {
|
|
776
|
+
x: number;
|
|
777
|
+
y: number;
|
|
778
|
+
};
|
|
779
|
+
parentId?: string;
|
|
780
|
+
};
|
|
781
|
+
interface UseMermaidDiagramResult {
|
|
782
|
+
controller: DiagramController;
|
|
783
|
+
state: DiagramState;
|
|
784
|
+
document: MermaidDocument;
|
|
785
|
+
/** The Mermaid text (with the `%% @pixerate` layout comment). */
|
|
786
|
+
source: string;
|
|
787
|
+
/** Canvas nodes (groups first, children relative to their group) and edges. */
|
|
788
|
+
nodes: MermaidFlowNode[];
|
|
789
|
+
edges: MermaidFlowEdge[];
|
|
790
|
+
layout: DiagramLayout;
|
|
791
|
+
apply: (ops: EditOp | EditOp[], label?: string) => DiagramActionResult;
|
|
792
|
+
/** Replaces the source; `clearHistory` when opening a different diagram. */
|
|
793
|
+
load: (source: string, options?: {
|
|
794
|
+
clearHistory?: boolean;
|
|
795
|
+
}) => DiagramActionResult;
|
|
796
|
+
/** Stores where dragged nodes ended up (pass every canvas node as `all` so groups carry their contents). */
|
|
797
|
+
moveNodes: (moved: readonly Placed[], all?: readonly Placed[]) => DiagramActionResult | null;
|
|
798
|
+
connect: (source: string, target: string, label?: string) => DiagramActionResult;
|
|
799
|
+
/** Removes nodes / groups (with their edges) and edges by id, as one undo step. */
|
|
800
|
+
remove: (ids: readonly string[]) => DiagramActionResult;
|
|
801
|
+
rename: (id: string, label: string) => DiagramActionResult;
|
|
802
|
+
select: (ids: readonly string[]) => void;
|
|
803
|
+
undo: () => void;
|
|
804
|
+
redo: () => void;
|
|
805
|
+
}
|
|
806
|
+
/** The controller's state (re-renders on every change). */
|
|
807
|
+
declare function useDiagramState(controller: DiagramController): DiagramState;
|
|
808
|
+
/**
|
|
809
|
+
* A Mermaid diagram on a React Flow canvas: subscribes to a `DiagramController` (or creates
|
|
810
|
+
* one from options), lays it out and returns canvas nodes and edges with bound edits. Every
|
|
811
|
+
* edit rewrites only the statements it touches; positions go into `%% @pixerate`.
|
|
812
|
+
*/
|
|
813
|
+
declare function useMermaidDiagram(controllerOrOptions?: DiagramController | UseMermaidDiagramOptions): UseMermaidDiagramResult;
|
|
814
|
+
interface UseMermaidStreamOptions extends DiagramLayoutOptions {
|
|
815
|
+
/** True once the whole source has arrived (unconnected nodes are shown then). */
|
|
816
|
+
complete?: boolean;
|
|
817
|
+
/** Glide duration between layouts in ms (default 300; 0 jumps). */
|
|
818
|
+
duration?: number;
|
|
819
|
+
}
|
|
820
|
+
interface UseMermaidStreamResult {
|
|
821
|
+
document: MermaidDocument | null;
|
|
822
|
+
nodes: MermaidFlowNode[];
|
|
823
|
+
edges: MermaidFlowEdge[];
|
|
824
|
+
/** The layout being shown (mid-glide while `settled` is false). */
|
|
825
|
+
layout: DiagramLayout | null;
|
|
826
|
+
settled: boolean;
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* Draws Mermaid that is still being written (e.g. a model's reply): nodes appear once an
|
|
830
|
+
* edge places them and glide to their new places as the layout grows. Read-only.
|
|
831
|
+
*/
|
|
832
|
+
declare function useMermaidStream(source: string, options?: UseMermaidStreamOptions): UseMermaidStreamResult;
|
|
833
|
+
|
|
834
|
+
/** Node data as `mermaidToCanvas` produces it. */
|
|
835
|
+
interface MermaidDiagramNodeData {
|
|
836
|
+
node?: {
|
|
837
|
+
id: string;
|
|
838
|
+
label: string;
|
|
839
|
+
shape: string;
|
|
840
|
+
data?: Record<string, unknown>;
|
|
841
|
+
};
|
|
842
|
+
group?: {
|
|
843
|
+
id: string;
|
|
844
|
+
label: string;
|
|
845
|
+
};
|
|
846
|
+
resolvedStyles?: Record<string, string>;
|
|
847
|
+
[key: string]: unknown;
|
|
848
|
+
}
|
|
849
|
+
interface MermaidDiagramNodeProps {
|
|
850
|
+
id?: string;
|
|
851
|
+
data: MermaidDiagramNodeData;
|
|
852
|
+
width?: number;
|
|
853
|
+
height?: number;
|
|
854
|
+
selected?: boolean;
|
|
855
|
+
className?: string;
|
|
856
|
+
/** Rendered over the node, e.g. React Flow `<Handle>`s. */
|
|
857
|
+
children?: React__default.ReactNode;
|
|
858
|
+
[key: string]: unknown;
|
|
859
|
+
}
|
|
860
|
+
/** Mermaid `style` / `classDef` declarations as the CSS the node paints with. */
|
|
861
|
+
declare function mermaidNodeStyle(styles?: Record<string, string>, selected?: boolean): React__default.CSSProperties;
|
|
862
|
+
/**
|
|
863
|
+
* Headless Mermaid node: draws the node's shape (flowchart, state, class, ER) as SVG with
|
|
864
|
+
* its label, painted from its Mermaid styles. Register it as the `mermaid-node` React Flow
|
|
865
|
+
* node type and pass `<Handle>`s as children.
|
|
866
|
+
*/
|
|
867
|
+
declare function MermaidDiagramNode({ data, width, height, selected, className, children }: MermaidDiagramNodeProps): React__default.JSX.Element | null;
|
|
868
|
+
/** Headless Mermaid group (subgraph, composite state, namespace): a titled frame. Register as `mermaid-group`. */
|
|
869
|
+
declare function MermaidDiagramGroup({ data, selected, className, children }: MermaidDiagramNodeProps): React__default.JSX.Element | null;
|
|
870
|
+
|
|
871
|
+
interface UseDiagramDirectorOptions {
|
|
872
|
+
/** Where nodes are drawn now, e.g. `() => diagram.layout` from `useMermaidDiagram`. */
|
|
873
|
+
placement: () => DiagramPlacement;
|
|
874
|
+
/** 1 = natural speed; 2 = twice as fast. */
|
|
875
|
+
speed?: number;
|
|
876
|
+
clock?: PresenceClock;
|
|
877
|
+
/** Hide a cursor this long after its last call (ms, default 1500). */
|
|
878
|
+
linger?: number;
|
|
879
|
+
}
|
|
880
|
+
/**
|
|
881
|
+
* A `PresenceStore` and `DiagramDirector` for a diagram, created once: pass `director` to
|
|
882
|
+
* `createDiagramToolProvider` so agent edits are acted out by a cursor, and `presence` to
|
|
883
|
+
* `<DiagramPresenceLayer>` to draw it.
|
|
884
|
+
*/
|
|
885
|
+
declare function useDiagramDirector(controller: DiagramController, options: UseDiagramDirectorOptions): {
|
|
886
|
+
presence: PresenceStore;
|
|
887
|
+
director: DiagramDirector;
|
|
888
|
+
};
|
|
889
|
+
/** The presence store's state (re-renders on every cursor move). */
|
|
890
|
+
declare function usePresenceState(presence: PresenceStore): PresenceState;
|
|
891
|
+
|
|
892
|
+
interface DiagramPresenceLayerProps {
|
|
893
|
+
presence: PresenceStore;
|
|
894
|
+
/** The canvas viewport (React Flow's `useViewport()`), to place cursors given in canvas coordinates. */
|
|
895
|
+
viewport: {
|
|
896
|
+
x: number;
|
|
897
|
+
y: number;
|
|
898
|
+
zoom: number;
|
|
899
|
+
};
|
|
900
|
+
className?: string;
|
|
901
|
+
}
|
|
902
|
+
/** Agent cursors and their notes over a canvas, from a `PresenceStore` (see `DiagramDirector`). */
|
|
903
|
+
declare function DiagramPresenceLayer({ presence, viewport, className }: DiagramPresenceLayerProps): React__default.JSX.Element | null;
|
|
904
|
+
|
|
905
|
+
export { AgentPresenceLayer, type AgentPresenceLayerProps, AnimationTimeline, type AnimationTimelineProps, type CanvasAnimation, type CanvasArrange, type CanvasAutoLayout, type CanvasComponents, CanvasComponentsPanel, type CanvasComponentsPanelActions, type CanvasComponentsPanelProps, type CanvasDraw, type CanvasDrawActions, CanvasDrawLayer, type CanvasDrawLayerProps, type CanvasDrawState, type CanvasGraphTarget, CanvasGuidesLayer, type CanvasGuidesLayerProps, CanvasInstanceInspector, type CanvasInstanceInspectorActions, type CanvasInstanceInspectorProps, type CanvasMeasure, type CanvasScenes, type CanvasTokens, DiagramPresenceLayer, type DiagramPresenceLayerProps, MermaidDiagramGroup, MermaidDiagramNode, type MermaidDiagramNodeData, type MermaidDiagramNodeProps, ShapeNode, type ShapeNodeProps, TokenBindingPicker, type TokenBindingPickerProps, TokenModeSwitcher, type TokenModeSwitcherProps, type UseCanvasAnimationOptions, type UseCanvasArrangeOptions, type UseCanvasArrangeShortcutsOptions, type UseCanvasAutoLayoutOptions, type UseCanvasClipboardOptions, type UseCanvasComponentsOptions, type UseCanvasDockingOptions, type UseCanvasDrawOptions, type UseCanvasGraphOptions, type UseCanvasLayoutOptions, type UseCanvasMeasureOptions, type UseCanvasScenesOptions, type UseCanvasShortcutsOptions, type UseCanvasTokensOptions, type UseDiagramDirectorOptions, type UseMermaidDiagramOptions, type UseMermaidDiagramResult, type UseMermaidStreamOptions, type UseMermaidStreamResult, type UseStreamingCanvasOptions, mermaidNodeStyle, useCanvasAnimation, useCanvasArrange, useCanvasArrangeShortcuts, useCanvasAutoLayout, useCanvasClipboard, useCanvasComponents, useCanvasDocking, useCanvasDraw, useCanvasExplosion, useCanvasGraph, useCanvasLayout, useCanvasMeasure, useCanvasScenes, useCanvasShortcuts, useCanvasTokens, useDiagramDirector, useDiagramState, useMermaidDiagram, useMermaidStream, usePresenceState, useStreamingCanvas };
|
package/dist/canvas/index.js
CHANGED
|
@@ -2532,6 +2532,200 @@ import {
|
|
|
2532
2532
|
angleToSvgLinearCoords,
|
|
2533
2533
|
gradientToSvgDef as gradientToSvgDef2
|
|
2534
2534
|
} from "@pixerate/editor/canvas";
|
|
2535
|
+
|
|
2536
|
+
// src/canvas/useMermaidDiagram.ts
|
|
2537
|
+
import { useEffect as useEffect10, useMemo as useMemo8, useRef as useRef15, useState as useState8, useSyncExternalStore as useSyncExternalStore4 } from "react";
|
|
2538
|
+
import {
|
|
2539
|
+
DiagramController
|
|
2540
|
+
} from "@pixerate/editor/diagram";
|
|
2541
|
+
import {
|
|
2542
|
+
DiagramStream,
|
|
2543
|
+
blendDiagramLayout,
|
|
2544
|
+
easeDiagramTween,
|
|
2545
|
+
mermaidMovesFromCanvas,
|
|
2546
|
+
mermaidToCanvas
|
|
2547
|
+
} from "@pixerate/editor/canvas";
|
|
2548
|
+
function useDiagramState(controller) {
|
|
2549
|
+
return useSyncExternalStore4(controller.subscribe, controller.getState, controller.getState);
|
|
2550
|
+
}
|
|
2551
|
+
function useMermaidDiagram(controllerOrOptions = {}) {
|
|
2552
|
+
const own = useRef15(null);
|
|
2553
|
+
let controller;
|
|
2554
|
+
if (controllerOrOptions instanceof DiagramController) controller = controllerOrOptions;
|
|
2555
|
+
else {
|
|
2556
|
+
if (!own.current) own.current = new DiagramController(controllerOrOptions);
|
|
2557
|
+
controller = own.current;
|
|
2558
|
+
}
|
|
2559
|
+
const layoutOptions = controllerOrOptions instanceof DiagramController ? void 0 : controllerOrOptions.layoutOptions;
|
|
2560
|
+
const state = useDiagramState(controller);
|
|
2561
|
+
const canvas = useMemo8(
|
|
2562
|
+
() => mermaidToCanvas(state.document, { ...layoutOptions, editable: state.editable }),
|
|
2563
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2564
|
+
[state.document, state.editable]
|
|
2565
|
+
);
|
|
2566
|
+
const layoutRef = useRef15(canvas.layout);
|
|
2567
|
+
layoutRef.current = canvas.layout;
|
|
2568
|
+
const actions = useMemo8(
|
|
2569
|
+
() => ({
|
|
2570
|
+
apply: (ops, label) => controller.apply(ops, label),
|
|
2571
|
+
load: (source, options) => controller.load(source, options),
|
|
2572
|
+
moveNodes: (moved, all = moved) => {
|
|
2573
|
+
const op = mermaidMovesFromCanvas(layoutRef.current, moved, all, { stored: controller.getDocument().meta.layout ?? {} });
|
|
2574
|
+
return op ? controller.apply(op, "Move") : null;
|
|
2575
|
+
},
|
|
2576
|
+
connect: (source, target, label) => controller.apply({ type: "addEdge", edge: { source, target, ...label ? { label } : {} } }, "Connect"),
|
|
2577
|
+
remove: (ids) => {
|
|
2578
|
+
const graph = controller.getDocument().graph;
|
|
2579
|
+
const edgeIds = new Set(graph.edges.map((e) => e.id));
|
|
2580
|
+
const edges = ids.filter((id) => edgeIds.has(id));
|
|
2581
|
+
const nodes = ids.filter((id) => !edgeIds.has(id));
|
|
2582
|
+
const ops = [];
|
|
2583
|
+
if (edges.length) ops.push({ type: "removeEdges", ids: edges });
|
|
2584
|
+
if (nodes.length) ops.push({ type: "removeNodes", ids: nodes });
|
|
2585
|
+
return controller.apply(ops, "Delete");
|
|
2586
|
+
},
|
|
2587
|
+
rename: (id, label) => controller.apply(
|
|
2588
|
+
controller.getDocument().graph.groups.some((g) => g.id === id) ? { type: "renameGroup", id, label } : { type: "renameNode", id, label },
|
|
2589
|
+
"Rename"
|
|
2590
|
+
),
|
|
2591
|
+
select: (ids) => controller.select(ids),
|
|
2592
|
+
undo: () => void controller.undo(),
|
|
2593
|
+
redo: () => void controller.redo()
|
|
2594
|
+
}),
|
|
2595
|
+
[controller]
|
|
2596
|
+
);
|
|
2597
|
+
return { controller, state, document: state.document, source: state.source, ...canvas, ...actions };
|
|
2598
|
+
}
|
|
2599
|
+
function useMermaidStream(source, options = {}) {
|
|
2600
|
+
const { complete = false, duration = 300, ...layoutOptions } = options;
|
|
2601
|
+
const stream = useRef15(null);
|
|
2602
|
+
if (!stream.current) stream.current = new DiagramStream(layoutOptions);
|
|
2603
|
+
const result = useMemo8(() => stream.current.update(source, complete), [source, complete]);
|
|
2604
|
+
const [shown, setShown] = useState8({ layout: result.layout, settled: true });
|
|
2605
|
+
const shownRef = useRef15(shown.layout);
|
|
2606
|
+
shownRef.current = shown.layout;
|
|
2607
|
+
useEffect10(() => {
|
|
2608
|
+
const target = result.layout;
|
|
2609
|
+
if (!target) return setShown({ layout: null, settled: true });
|
|
2610
|
+
const from = shownRef.current;
|
|
2611
|
+
if (!from || duration <= 0 || typeof requestAnimationFrame !== "function") return setShown({ layout: target, settled: true });
|
|
2612
|
+
if (from === target) return;
|
|
2613
|
+
let frame = 0;
|
|
2614
|
+
const start = performance.now();
|
|
2615
|
+
const step = () => {
|
|
2616
|
+
const t = Math.min(1, (performance.now() - start) / duration);
|
|
2617
|
+
setShown({ layout: blendDiagramLayout(from, target, easeDiagramTween(t)), settled: t >= 1 });
|
|
2618
|
+
if (t < 1) frame = requestAnimationFrame(step);
|
|
2619
|
+
};
|
|
2620
|
+
frame = requestAnimationFrame(step);
|
|
2621
|
+
return () => cancelAnimationFrame(frame);
|
|
2622
|
+
}, [result.layout, duration]);
|
|
2623
|
+
const doc = result.document.tier === "editable" ? result.document : null;
|
|
2624
|
+
const canvas = useMemo8(() => {
|
|
2625
|
+
if (!doc || !shown.layout) return { nodes: [], edges: [] };
|
|
2626
|
+
const placed = new Set(Object.keys(shown.layout.positions));
|
|
2627
|
+
const graph = {
|
|
2628
|
+
...doc.graph,
|
|
2629
|
+
nodes: doc.graph.nodes.filter((n) => placed.has(n.id)),
|
|
2630
|
+
groups: doc.graph.groups.filter((g) => placed.has(g.id)),
|
|
2631
|
+
edges: doc.graph.edges.filter((e) => placed.has(e.source) && placed.has(e.target))
|
|
2632
|
+
};
|
|
2633
|
+
return mermaidToCanvas({ ...doc, graph }, { layout: shown.layout });
|
|
2634
|
+
}, [doc, shown.layout]);
|
|
2635
|
+
return { document: doc, ...canvas, layout: shown.layout, settled: shown.settled };
|
|
2636
|
+
}
|
|
2637
|
+
|
|
2638
|
+
// src/canvas/MermaidDiagramNode.tsx
|
|
2639
|
+
import { MERMAID_SHAPE_PAINT, mermaidLabelLines, mermaidNodeMembers, mermaidNodePaint, mermaidShapePaths } from "@pixerate/editor/canvas";
|
|
2640
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2641
|
+
function mermaidNodeStyle(styles = {}, selected = false) {
|
|
2642
|
+
const paint = mermaidNodePaint(styles, selected);
|
|
2643
|
+
const { color, "stroke-width": strokeWidth, "stroke-dasharray": strokeDasharray, ...vars } = paint;
|
|
2644
|
+
return { ...vars, color, strokeWidth, strokeDasharray };
|
|
2645
|
+
}
|
|
2646
|
+
function MermaidDiagramNode({ data, width = 160, height = 56, selected, className = "", children }) {
|
|
2647
|
+
const node = data.node;
|
|
2648
|
+
if (!node) return null;
|
|
2649
|
+
const members = mermaidNodeMembers(node.data);
|
|
2650
|
+
return /* @__PURE__ */ jsxs8(
|
|
2651
|
+
"div",
|
|
2652
|
+
{
|
|
2653
|
+
className: `pixerate-diagram-node ${className}`.trim(),
|
|
2654
|
+
"data-shape": node.shape,
|
|
2655
|
+
"data-selected": selected ? "true" : void 0,
|
|
2656
|
+
style: { position: "relative", width: "100%", height: "100%", ...mermaidNodeStyle(data.resolvedStyles, selected) },
|
|
2657
|
+
children: [
|
|
2658
|
+
/* @__PURE__ */ jsx8("svg", { viewBox: `0 0 ${width} ${height}`, preserveAspectRatio: "none", width: "100%", height: "100%", style: { position: "absolute", inset: 0, overflow: "visible" }, "aria-hidden": "true", children: mermaidShapePaths(node.shape, width, height).map((path, i) => /* @__PURE__ */ jsx8("path", { d: path.d, style: { ...MERMAID_SHAPE_PAINT[path.paint], vectorEffect: "non-scaling-stroke" } }, i)) }),
|
|
2659
|
+
/* @__PURE__ */ jsxs8(
|
|
2660
|
+
"div",
|
|
2661
|
+
{
|
|
2662
|
+
style: { position: "relative", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: members.length ? "flex-start" : "center", height: "100%", padding: "6px 10px", boxSizing: "border-box", fontSize: 13, lineHeight: 1.3, textAlign: "center", pointerEvents: "none" },
|
|
2663
|
+
children: [
|
|
2664
|
+
mermaidLabelLines(node.label).map((line, i) => /* @__PURE__ */ jsx8("span", { style: { fontWeight: members.length ? 600 : void 0 }, children: line }, i)),
|
|
2665
|
+
members.length > 0 && /* @__PURE__ */ jsx8("div", { style: { alignSelf: "stretch", marginTop: 4, paddingTop: 4, borderTop: "1px solid var(--pixerate-diagram-node-border)", textAlign: "left", fontSize: 12 }, children: members.map((m, i) => /* @__PURE__ */ jsx8("div", { children: m }, i)) })
|
|
2666
|
+
]
|
|
2667
|
+
}
|
|
2668
|
+
),
|
|
2669
|
+
children
|
|
2670
|
+
]
|
|
2671
|
+
}
|
|
2672
|
+
);
|
|
2673
|
+
}
|
|
2674
|
+
function MermaidDiagramGroup({ data, selected, className = "", children }) {
|
|
2675
|
+
const group = data.group;
|
|
2676
|
+
if (!group) return null;
|
|
2677
|
+
return /* @__PURE__ */ jsxs8(
|
|
2678
|
+
"div",
|
|
2679
|
+
{
|
|
2680
|
+
className: `pixerate-diagram-group ${className}`.trim(),
|
|
2681
|
+
"data-selected": selected ? "true" : void 0,
|
|
2682
|
+
style: {
|
|
2683
|
+
width: "100%",
|
|
2684
|
+
height: "100%",
|
|
2685
|
+
boxSizing: "border-box",
|
|
2686
|
+
borderRadius: 8,
|
|
2687
|
+
border: `1px ${selected ? "solid" : "dashed"} ${selected ? "var(--primary, #2563eb)" : data.resolvedStyles?.stroke ?? "var(--border, #cbd5e1)"}`,
|
|
2688
|
+
background: data.resolvedStyles?.fill ?? "var(--muted, rgba(148, 163, 184, 0.08))",
|
|
2689
|
+
color: data.resolvedStyles?.color ?? "var(--muted-foreground, #475569)"
|
|
2690
|
+
},
|
|
2691
|
+
children: [
|
|
2692
|
+
/* @__PURE__ */ jsx8("div", { style: { padding: "6px 10px", fontSize: 12, fontWeight: 600 }, children: mermaidLabelLines(group.label).join(" ") }),
|
|
2693
|
+
children
|
|
2694
|
+
]
|
|
2695
|
+
}
|
|
2696
|
+
);
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2699
|
+
// src/canvas/useDiagramDirector.ts
|
|
2700
|
+
import { useRef as useRef16, useSyncExternalStore as useSyncExternalStore5 } from "react";
|
|
2701
|
+
import { DiagramDirector, PresenceStore } from "@pixerate/editor/diagram";
|
|
2702
|
+
function useDiagramDirector(controller, options) {
|
|
2703
|
+
const placement = useRef16(options.placement);
|
|
2704
|
+
placement.current = options.placement;
|
|
2705
|
+
const ref = useRef16(null);
|
|
2706
|
+
if (!ref.current) {
|
|
2707
|
+
const presence = new PresenceStore();
|
|
2708
|
+
ref.current = {
|
|
2709
|
+
presence,
|
|
2710
|
+
director: new DiagramDirector(controller, presence, { placement: () => placement.current(), speed: options.speed, clock: options.clock, linger: options.linger })
|
|
2711
|
+
};
|
|
2712
|
+
}
|
|
2713
|
+
return ref.current;
|
|
2714
|
+
}
|
|
2715
|
+
function usePresenceState(presence) {
|
|
2716
|
+
return useSyncExternalStore5(presence.subscribe, presence.getState, presence.getState);
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
// src/canvas/DiagramPresenceLayer.tsx
|
|
2720
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2721
|
+
function DiagramPresenceLayer({ presence, viewport, className = "" }) {
|
|
2722
|
+
const { actors } = usePresenceState(presence);
|
|
2723
|
+
if (!actors.length) return null;
|
|
2724
|
+
return /* @__PURE__ */ jsx9("div", { className: `pixerate-diagram-presence ${className}`.trim(), "aria-hidden": "true", style: { position: "absolute", inset: 0, pointerEvents: "none", overflow: "hidden", zIndex: 50 }, children: actors.map((a) => /* @__PURE__ */ jsxs9("div", { "data-actor": a.id, style: { position: "absolute", left: 0, top: 0, transform: `translate(${a.x * viewport.zoom + viewport.x}px, ${a.y * viewport.zoom + viewport.y}px)` }, children: [
|
|
2725
|
+
/* @__PURE__ */ jsx9("svg", { width: "18", height: "20", viewBox: "0 0 12 18", style: { display: "block", transform: a.pressed ? "scale(0.85)" : void 0, transformOrigin: "0 0" }, children: /* @__PURE__ */ jsx9("path", { d: "M0,0 L0,14 L4,10.5 L7,17 L9.5,16 L6.5,9.5 L11.5,9.5 Z", style: { fill: a.color, stroke: "#ffffff", strokeWidth: 1 } }) }),
|
|
2726
|
+
/* @__PURE__ */ jsx9("span", { style: { position: "absolute", left: 14, top: 16, whiteSpace: "nowrap", borderRadius: 4, padding: "1px 6px", fontSize: 11, fontWeight: 600, color: "#ffffff", background: a.color }, children: a.message ?? a.name })
|
|
2727
|
+
] }, a.id)) });
|
|
2728
|
+
}
|
|
2535
2729
|
export {
|
|
2536
2730
|
ANIMATABLE_PROPERTIES,
|
|
2537
2731
|
ANIMATION_DATA_KEY,
|
|
@@ -2556,8 +2750,11 @@ export {
|
|
|
2556
2750
|
CanvasInstanceInspector,
|
|
2557
2751
|
CanvasScenesStore2 as CanvasScenesStore,
|
|
2558
2752
|
DEFAULT_ARRANGE_SHORTCUTS,
|
|
2753
|
+
DiagramPresenceLayer,
|
|
2559
2754
|
MAX_KEYFRAME_REFS,
|
|
2560
2755
|
ManualClock,
|
|
2756
|
+
MermaidDiagramGroup,
|
|
2757
|
+
MermaidDiagramNode,
|
|
2561
2758
|
RESIZE_HANDLES,
|
|
2562
2759
|
SHAPE_DATA_KEY,
|
|
2563
2760
|
SHAPE_KINDS,
|
|
@@ -2738,6 +2935,7 @@ export {
|
|
|
2738
2935
|
measureSelection2 as measureSelection,
|
|
2739
2936
|
measureToLine,
|
|
2740
2937
|
mergeNodeUpdates,
|
|
2938
|
+
mermaidNodeStyle,
|
|
2741
2939
|
mixColorsOklab,
|
|
2742
2940
|
moveKeyframes,
|
|
2743
2941
|
moveLayoutChild,
|
|
@@ -2855,6 +3053,11 @@ export {
|
|
|
2855
3053
|
useCanvasScenes,
|
|
2856
3054
|
useCanvasShortcuts,
|
|
2857
3055
|
useCanvasTokens,
|
|
3056
|
+
useDiagramDirector,
|
|
3057
|
+
useDiagramState,
|
|
3058
|
+
useMermaidDiagram,
|
|
3059
|
+
useMermaidStream,
|
|
3060
|
+
usePresenceState,
|
|
2858
3061
|
useStreamingCanvas,
|
|
2859
3062
|
withNodeAnimation,
|
|
2860
3063
|
withStyleSize,
|