@pixerate/editor 0.76.0 → 0.78.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 +33 -1
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +29 -1
- package/dist/canvas/index.d.ts +29 -1
- package/dist/canvas/index.js +32 -0
- package/dist/canvas/index.js.map +1 -1
- package/dist/video-editor/index.cjs +42 -27
- package/dist/video-editor/index.cjs.map +1 -1
- package/dist/video-editor/index.d.cts +19 -1
- package/dist/video-editor/index.d.ts +19 -1
- package/dist/video-editor/index.js +19 -4
- package/dist/video-editor/index.js.map +1 -1
- package/package.json +1 -1
package/dist/canvas/index.d.cts
CHANGED
|
@@ -2814,6 +2814,34 @@ declare function createCanvasDrawController<TNode extends CanvasNode = CanvasNod
|
|
|
2814
2814
|
eraseAt: (point: Point, radius?: number) => TNode[];
|
|
2815
2815
|
};
|
|
2816
2816
|
type CanvasDrawController = ReturnType<typeof createCanvasDrawController>;
|
|
2817
|
+
/** Modifier options when computing bounds while dragging/drawing. */
|
|
2818
|
+
interface CanvasDragBoundsModifiers {
|
|
2819
|
+
/** If true (e.g. Shift key held), constrain the bounding box to 1:1 aspect ratio. */
|
|
2820
|
+
constrain?: boolean;
|
|
2821
|
+
/** If true (e.g. Alt/Option key held), draw/expand outward from the initial start point as center. */
|
|
2822
|
+
fromCenter?: boolean;
|
|
2823
|
+
}
|
|
2824
|
+
interface CanvasDragBounds {
|
|
2825
|
+
x: number;
|
|
2826
|
+
y: number;
|
|
2827
|
+
width: number;
|
|
2828
|
+
height: number;
|
|
2829
|
+
}
|
|
2830
|
+
/**
|
|
2831
|
+
* Computes bounding rectangle from start and current points, supporting
|
|
2832
|
+
* `constrain` (aspect ratio 1:1, Shift key) and `fromCenter` (origin as center, Alt/Option key).
|
|
2833
|
+
*/
|
|
2834
|
+
declare function computeDragBounds(start: {
|
|
2835
|
+
x: number;
|
|
2836
|
+
y: number;
|
|
2837
|
+
}, current: {
|
|
2838
|
+
x: number;
|
|
2839
|
+
y: number;
|
|
2840
|
+
}, modifiers?: CanvasDragBoundsModifiers): CanvasDragBounds;
|
|
2841
|
+
/**
|
|
2842
|
+
* Computes bounding rectangle from start point and raw dimensions (dx, dy).
|
|
2843
|
+
*/
|
|
2844
|
+
declare function computeDragBoundsFromPoints(startX: number, startY: number, currentX: number, currentY: number, modifiers?: CanvasDragBoundsModifiers): CanvasDragBounds;
|
|
2817
2845
|
|
|
2818
2846
|
/**
|
|
2819
2847
|
|
|
@@ -3616,4 +3644,4 @@ declare function formatAgentCursorName(nameOrUsername?: string | null): string;
|
|
|
3616
3644
|
*/
|
|
3617
3645
|
declare function isAgentCursor(cursor: Partial<CanvasAgentCursor>): boolean;
|
|
3618
3646
|
|
|
3619
|
-
export { ANIMATABLE_PROPERTIES, ANIMATION_DATA_KEY, AUTO_LAYOUT_DATA_KEY, type AddCanvasVariantOptions, AlignEdge, AlignNodesOptions, type AnimatableProperty, type AnimateNodeOptions, type AnimationDocument, AnimationEasing, AnimationEditError, type AnimationEditErrorCode, type AnimationFrame, type AnimationHistoryTarget, type AnimationKeyframeClipboard, AnimationLoopMode, type AnimationMotionPath, type AnimationOverrides, AnimationPlayer, AnimationPlayerState, type AnimationPropertyOptions, type AnimationStop, AnimationTrack, AnimationValue, AnimationValueType, type ArrangeHistoryTarget, type AutoLayout, type AutoLayoutAlignContent, type AutoLayoutAlignCross, type AutoLayoutAlignMain, type AutoLayoutCellAlign, type AutoLayoutChild, type AutoLayoutConstraints, type AutoLayoutGrid, type AutoLayoutGridArea, type AutoLayoutGridCell, type AutoLayoutGridGeometry, type AutoLayoutGridTrack, type AutoLayoutHorizontalConstraint, type AutoLayoutInsertTarget, type AutoLayoutMeasure, type AutoLayoutMode, type AutoLayoutOptions, type AutoLayoutPadding, type AutoLayoutSize, type AutoLayoutSizing, type AutoLayoutSizingPair, type AutoLayoutVerticalConstraint, BUILTIN_FAMILY_SCENES, BezierPath, BezierPathInput, CANVAS_COMPONENT_DRAG_TYPE, CANVAS_TOKEN_PROPERTIES, CARD_INSPECTION_ZONES, CHILD_LAYOUT_DATA_KEY, COMPONENT_DATA_KEY, COMPONENT_OVERRIDES_DATA_KEY, COMPONENT_PROPERTY_REFS_DATA_KEY, COMPONENT_SET_DATA_KEY, COMPONENT_SOURCE_DATA_KEY, CONNECTION_LINE_TYPES, CSS_ANIMATION_PROPERTIES, CSS_VARIABLE_DIAGRAM_SCENE_THEME, type CanvasAgentCursor, type CanvasAnimationController, type CanvasAnimationControllerOptions, type CanvasAnimationState, CanvasArrangeAction, type CanvasArrangeController, type CanvasArrangeControllerOptions, type CanvasAutoLayoutController, type CanvasAutoLayoutControllerOptions, CanvasClipboardPayload, type CanvasComponentData, type CanvasComponentErrorCode, type CanvasComponentInfo, type CanvasComponentPropertyDef, type CanvasComponentPropertyField, type CanvasComponentPropertyType, type CanvasComponentPropertyValue, type CanvasComponentResult, type CanvasComponentSetData, type CanvasComponentSetInfo, type CanvasComponentSyncOptions, type CanvasComponentsController, type CanvasComponentsControllerOptions, type CanvasConnectionLineType, type CanvasDrawController, type CanvasDrawControllerOptions, CanvasEdge, CanvasGradientDef, type CanvasHeightOptions, type CanvasInstanceData, type CanvasInstanceInfo, type CanvasInstancePropertyInfo, CanvasLayoutOptions, CanvasNode, CanvasNodeStyle, CanvasNodeUpdate, type CanvasScene, type CanvasScenesOptions, type CanvasScenesState, CanvasScenesStore, type CanvasTokenBindingInfo, type CanvasTokenOptions, type CanvasTokenProperty, type CanvasViewport, type CardInspectionZone, Clock, type CombineShapeNodesOptions, type CombineShapeNodesRefusal, type CombineShapeNodesResult, type ConnectorSnap, type ConnectorSnapOptions, type ConnectorSnapTarget, type CreateCanvasComponentOptions, type CreateCanvasInstanceOptions, type CssAnimationExport, type CssExportOptions, type CssPropertyAnimation, type CubicSegment, type CurvedPathOptions, DEFAULT_CURSOR_INACTIVITY_MS, DEFAULT_DIAGRAM_NODE_HEIGHT, DEFAULT_DIAGRAM_NODE_WIDTH, DEFAULT_NODE_HEIGHT, DEFAULT_NODE_WIDTH, DEFAULT_PLACEMENT_GAP, DIAGRAM_MARKER_IDS, DIAGRAM_RASTER_MAX_SIZE, DIAGRAM_SCENE_DARK_THEME, DIAGRAM_SCENE_LIGHT_THEME, DIAGRAM_SVG_DARK_THEME, DIAGRAM_SVG_LIGHT_THEME, DIAGRAM_TITLE_TARGET, type DiagramBounds, type DiagramCanvasHeightOptions, type DiagramCircleMark, type DiagramLayout, type DiagramLayoutOptions, type DiagramLineMark, type DiagramMark, type DiagramPathMark, type DiagramRectMark, type DiagramScene, type DiagramSceneOptions, type DiagramSceneTheme, type DiagramSize, DiagramStream, type DiagramStreamResult, type DiagramSvg, type DiagramSvgOptions, type DiagramSvgTheme, type DiagramTextMark, DirectionalDisplacementOptions, DistributeAxis, DistributeMode, DistributeNodesOptions, type DownloadDiagramPngOptions, type EvaluateAnimationOptions, type FamilyScene, type FamilySceneInput, FanOutTrajectoryOptions, type FitCubicsOptions, type FitPathDataOptions, type FitViewportOptions, type FreehandDrawOptions, type FreehandStroke, type FreehandStrokeStyle, type FreehandTool, type GuideIndex, type GuideLine, type HatchOptions, INSTANCE_DATA_KEY, IncrementalLayoutOptions, type KeyframeDragState, type KeyframePatch, type KeyframeRangeOptions, type KeyframeRef, type KeyframeSnap, MAX_KEYFRAME_REFS, MERMAID_SHAPE_PAINT, MatchSizeOptions, type MeasureGuide, type MeasureSelectionOptions, type MeasureSelectionResult, type MermaidCanvas, type MermaidCanvasOptions, type MermaidEdgeData, type MermaidFlowEdge, type MermaidFlowNode, type MermaidFlowOptions, type MermaidGroupData, type MermaidMovesOptions, type MermaidNodeData, type MermaidSceneOptions, type MermaidShapePaint, type MermaidShapePath, type MoveKeyframesResult, type MultiNodeTransitionOptions, type NodeAnimation, NodeRectOptions, NodeTransition, type OffsetShapeNodesOptions, type OutlineShapeStrokesOptions, PlaceBesideOptions, Point, PolygonFillRule, PolygonRing, Position, type PositionChangeLike, RESIZE_HANDLES, type RasterImage, type RasterizeSvgOptions, type RecordAnimationOptions, Rect, ReflowDisplacementOptions, type ResizeHandle, SHAPE_DATA_KEY, SHAPE_NODE_TYPE, SHAPE_OPERATIONS, type SampleAnimationOptions, type ScaleKeyframesOptions, type SerializedCanvasScenes, type SetCanvasVariantPropertiesOptions, type SetKeyframeOptions, ShapeDescription, type ShapeNodePolygonOptions, type ShapeOperation, type ShapePathEditOperation, type ShapePathEditRefusal, type ShapePathEditResult, ShapeSize, Side, SizeDimension, type SnapGuidesOptions, type SnapNodeDragOptions, type SnapNodeDragResult, type SnapNodeResizeOptions, type SnapNodeResizeResult, type SnapResizeOptions, type SnapResizeResult, type SnapResult, StreamingLayoutManager, type StreamingLayoutManagerOptions, StrokeCap, StrokeJoin, type StrokeToShapeNodeOptions, TOKEN_BINDINGS_DATA_KEY, TOKEN_MODES_DATA_KEY, type TimelineKeyframe, type TimelineRow, type TimelineRowsOptions, TrajectoryFunction, type WebAnimationSpec, XYPosition, ZOrderOperation, addCanvasVariant, addKeyframesAtTime, animateNode, applyAnimation, applyAnimationOverrides, applyConstraints, applyShapeCombination, applyShapeReplacement, architectureScene, autoLayoutDiagram, bindCanvasComponentProperty, bindCanvasToken, blendDiagramLayout, blendLayout, boundsOf, c4Scene, calculateCursorArrowRotation, calculateCurvedPath, calculateDagreReflowDisplacement, calculateDirectionalDisplacement, canCombineShapeNodes, canOffsetShapeNodes, canOutlineShapeNodeStrokes, canvasHeight, centerNodes, centre, clampAnimationValue, clampLayoutSize, collectDescendantIds, combineCanvasComponentsAsVariants, combineShapeNodes, computeNodesBoundingBox, computeSnapGuides, connectedDiagramOnly, connectedOnly, copyKeyframes, createBezierTrajectory, createCanvasAnimationController, createCanvasArrangeController, createCanvasAutoLayoutController, createCanvasComponent, createCanvasComponentsController, createCanvasDrawController, createCanvasInstance, createCanvasScenesStore, createDefaultStrokeStyle, createFanOutTrajectory, createGuideIndex, createNodeGuideIndex, cubicPointAt, cubicsToPathData, defaultEasing, deleteKeyframes, detachCanvasInstance, detachTokenBindings, diagramCanvasHeight, diagramFileName, diagramGroupSize, diagramImageSize, diagramLayoutBounds, diagramMarksBounds, diagramMarksToSvg, diagramRenameOp, diagramTargetLabel, diagramTextBaseline, diffOverrideGroups, downloadDiagramPng, easeDiagramTween, ensureDiagramLayout, ensureLayout, estimateCanvasHeight, estimateDiagramCanvasHeight, estimateDiagramNodeSize, estimateNodeSize, estimateTextWidth, evaluateAnimation, exportCssAnimation, familySceneFromLayout, findConnectorSnap, findStrokesAtPoint, findVariant, fitCubicRun, fitCubicWithTangents, fitCubics, fitFreehandPath, fitPathData, fitViewportToNodes, fitViewportToRect, flowSide, formatAgentCursorName, formatAnimationTime, formatVariantName, ganttScene, getAgentCardAnchor, getAnimatableProperty, getAnimatedProperties, getAnimatedValue, getAnimationDuration, getAnimationTrack, getAutoLayout, getAutoLayoutGrid, getAutoLayoutInsertTarget, getBindableTokenProperties, getCanvasComponentDragId, getCanvasTokenProperty, getCenteredNodePosition, getChildLayout, getComponentData, getComponentInstances, getComponentPropertyDefs, getComponentPropertyRefs, getComponentSourceId, getCssPropertyAnimations, getCursorTransitionDuration, getDefaultVariant, getEffectiveTokenModes, getFamilyScene, getFlowChildren, getInstanceData, getInstanceProperties, getInstanceStatus, getKeyframeTimes, getLayerName, getLayoutParent, getLayoutSizing, getLayoutedNodes, getNaturalMovementTiming, getNextVariantValues, getNodeAnimation, getNodeOverrides, getNodeShape, getNodeTokenBindings, getNodeTokenModes, getOwningComponent, getOwningInstance, getResizingNodeRect, getRootInstance, getTimelineRows, getTimelineTicks, getTokenPropertyScope, getTokensForProperty, getVariantConflicts, getVariantOptions, getVariantSet, getVariantValues, gitGraphScene, handlePoint, hasFamilyScene, hasVisibleStroke, hashString, hatchPath, inferResizeHandle, inspectCanvasInstance, inspectNodeTokens, isAgentCursor, isAutoLayoutFrame, isCanvasComponent, isCanvasComponentSet, isCanvasInstance, isCssExportExact, isEventFromTextInput, isInsideInstance, isKeyframeSelected, isMeasureModifierHeld, isNodeAnimated, isShapeNode, isStraightCubic, isValidCanvasEdge, isValidCanvasNode, isValidCanvasScene, isValidUrl, journeyScene, layoutAll, layoutBounds, layoutFrame, layoutUp, layoutUpMany, linearPositionTrajectory, linearTrajectory, listCanvasComponents, makeSizingCoherent, measureBetween, measureLabel, measureSelection, measureToLine, mergeNodeUpdates, mermaidEdgeDash, mermaidEdgeMarker, mermaidEdgeWidth, mermaidFlowEdges, mermaidFlowNodes, mermaidLabelLines, mermaidMarkerId, mermaidMovesFromCanvas, mermaidNodeMembers, mermaidNodePaint, mermaidShapePaths, mermaidThumbnailSvg, mermaidToCanvas, mermaidToScene, mermaidToSvg, mindmapScene, moveKeyframes, moveLayoutChild, nearestHandlePositions, offsetShapeNodes, oppositePosition, outlineShapeNodeStrokes, overlaps, parseCanvasClipboardData, parseCanvasScenes, parseKeyframeClipboard, parseMermaidStyles, parseNodeStyleDeclarations, parseVariantName, pasteKeyframes, pieScene, placeBeside, playWebAnimations, positionToSide, pruneCanvasTokenModes, pushCanvasInstanceOverrides, quadrantScene, radarChartSpec, radarScene, rasterSize, rasterizeSvg, readAnimatableValue, readNodeStyleProperty, readOverrideGroup, recordAnimationChanges, registerFamilyScene, relayoutUpdates, remapPastedNodes, removeCanvasVariant, removeTrack, renameCanvasVariantProperty, renameCanvasVariantValue, repositionNodesTo, resetCanvasInstanceOverrides, resizeHandleAxes, resolveCanvasTokens, resolveMermaidStyles, resolvePadding, restoreCanvasMainComponent, revertShapeCombination, runMultiNodeTransition, sampleAnimationFrames, scaleKeyframes, sceneColor, sequenceScene, serializeCanvasNodes, setCanvasComponentProperty, setCanvasInstanceProperties, setCanvasTokenMode, setCanvasVariantProperties, setKeyframe, setKeyframeEasing, setMotionPath, setTrackEnabled, shapeNodeToBezierPath, shapeNodeToPolygon, shapeToBezierPath, sideToPosition, snapKeyframeDelta, snapNodeDrag, snapNodeResize, snapResize, snapTimeToFrame, snapToGrid, streamedDiagramText, streamlinePoints, strokeBoundingBox, strokePointsToPathData, strokeToShapeNode, swapCanvasInstance, syncAllCanvasInstances, syncCanvasComponents, syncCanvasInstance, timeToX, timelineScene, toWebAnimations, updateKeyframe, withNodeAnimation, withStyleOpacity, wouldCreateComponentCycle, writeNodeStyleProperty, writeOverrideGroup, xToTime, xyChartScene, xyChartSpec };
|
|
3647
|
+
export { ANIMATABLE_PROPERTIES, ANIMATION_DATA_KEY, AUTO_LAYOUT_DATA_KEY, type AddCanvasVariantOptions, AlignEdge, AlignNodesOptions, type AnimatableProperty, type AnimateNodeOptions, type AnimationDocument, AnimationEasing, AnimationEditError, type AnimationEditErrorCode, type AnimationFrame, type AnimationHistoryTarget, type AnimationKeyframeClipboard, AnimationLoopMode, type AnimationMotionPath, type AnimationOverrides, AnimationPlayer, AnimationPlayerState, type AnimationPropertyOptions, type AnimationStop, AnimationTrack, AnimationValue, AnimationValueType, type ArrangeHistoryTarget, type AutoLayout, type AutoLayoutAlignContent, type AutoLayoutAlignCross, type AutoLayoutAlignMain, type AutoLayoutCellAlign, type AutoLayoutChild, type AutoLayoutConstraints, type AutoLayoutGrid, type AutoLayoutGridArea, type AutoLayoutGridCell, type AutoLayoutGridGeometry, type AutoLayoutGridTrack, type AutoLayoutHorizontalConstraint, type AutoLayoutInsertTarget, type AutoLayoutMeasure, type AutoLayoutMode, type AutoLayoutOptions, type AutoLayoutPadding, type AutoLayoutSize, type AutoLayoutSizing, type AutoLayoutSizingPair, type AutoLayoutVerticalConstraint, BUILTIN_FAMILY_SCENES, BezierPath, BezierPathInput, CANVAS_COMPONENT_DRAG_TYPE, CANVAS_TOKEN_PROPERTIES, CARD_INSPECTION_ZONES, CHILD_LAYOUT_DATA_KEY, COMPONENT_DATA_KEY, COMPONENT_OVERRIDES_DATA_KEY, COMPONENT_PROPERTY_REFS_DATA_KEY, COMPONENT_SET_DATA_KEY, COMPONENT_SOURCE_DATA_KEY, CONNECTION_LINE_TYPES, CSS_ANIMATION_PROPERTIES, CSS_VARIABLE_DIAGRAM_SCENE_THEME, type CanvasAgentCursor, type CanvasAnimationController, type CanvasAnimationControllerOptions, type CanvasAnimationState, CanvasArrangeAction, type CanvasArrangeController, type CanvasArrangeControllerOptions, type CanvasAutoLayoutController, type CanvasAutoLayoutControllerOptions, CanvasClipboardPayload, type CanvasComponentData, type CanvasComponentErrorCode, type CanvasComponentInfo, type CanvasComponentPropertyDef, type CanvasComponentPropertyField, type CanvasComponentPropertyType, type CanvasComponentPropertyValue, type CanvasComponentResult, type CanvasComponentSetData, type CanvasComponentSetInfo, type CanvasComponentSyncOptions, type CanvasComponentsController, type CanvasComponentsControllerOptions, type CanvasConnectionLineType, type CanvasDragBounds, type CanvasDragBoundsModifiers, type CanvasDrawController, type CanvasDrawControllerOptions, CanvasEdge, CanvasGradientDef, type CanvasHeightOptions, type CanvasInstanceData, type CanvasInstanceInfo, type CanvasInstancePropertyInfo, CanvasLayoutOptions, CanvasNode, CanvasNodeStyle, CanvasNodeUpdate, type CanvasScene, type CanvasScenesOptions, type CanvasScenesState, CanvasScenesStore, type CanvasTokenBindingInfo, type CanvasTokenOptions, type CanvasTokenProperty, type CanvasViewport, type CardInspectionZone, Clock, type CombineShapeNodesOptions, type CombineShapeNodesRefusal, type CombineShapeNodesResult, type ConnectorSnap, type ConnectorSnapOptions, type ConnectorSnapTarget, type CreateCanvasComponentOptions, type CreateCanvasInstanceOptions, type CssAnimationExport, type CssExportOptions, type CssPropertyAnimation, type CubicSegment, type CurvedPathOptions, DEFAULT_CURSOR_INACTIVITY_MS, DEFAULT_DIAGRAM_NODE_HEIGHT, DEFAULT_DIAGRAM_NODE_WIDTH, DEFAULT_NODE_HEIGHT, DEFAULT_NODE_WIDTH, DEFAULT_PLACEMENT_GAP, DIAGRAM_MARKER_IDS, DIAGRAM_RASTER_MAX_SIZE, DIAGRAM_SCENE_DARK_THEME, DIAGRAM_SCENE_LIGHT_THEME, DIAGRAM_SVG_DARK_THEME, DIAGRAM_SVG_LIGHT_THEME, DIAGRAM_TITLE_TARGET, type DiagramBounds, type DiagramCanvasHeightOptions, type DiagramCircleMark, type DiagramLayout, type DiagramLayoutOptions, type DiagramLineMark, type DiagramMark, type DiagramPathMark, type DiagramRectMark, type DiagramScene, type DiagramSceneOptions, type DiagramSceneTheme, type DiagramSize, DiagramStream, type DiagramStreamResult, type DiagramSvg, type DiagramSvgOptions, type DiagramSvgTheme, type DiagramTextMark, DirectionalDisplacementOptions, DistributeAxis, DistributeMode, DistributeNodesOptions, type DownloadDiagramPngOptions, type EvaluateAnimationOptions, type FamilyScene, type FamilySceneInput, FanOutTrajectoryOptions, type FitCubicsOptions, type FitPathDataOptions, type FitViewportOptions, type FreehandDrawOptions, type FreehandStroke, type FreehandStrokeStyle, type FreehandTool, type GuideIndex, type GuideLine, type HatchOptions, INSTANCE_DATA_KEY, IncrementalLayoutOptions, type KeyframeDragState, type KeyframePatch, type KeyframeRangeOptions, type KeyframeRef, type KeyframeSnap, MAX_KEYFRAME_REFS, MERMAID_SHAPE_PAINT, MatchSizeOptions, type MeasureGuide, type MeasureSelectionOptions, type MeasureSelectionResult, type MermaidCanvas, type MermaidCanvasOptions, type MermaidEdgeData, type MermaidFlowEdge, type MermaidFlowNode, type MermaidFlowOptions, type MermaidGroupData, type MermaidMovesOptions, type MermaidNodeData, type MermaidSceneOptions, type MermaidShapePaint, type MermaidShapePath, type MoveKeyframesResult, type MultiNodeTransitionOptions, type NodeAnimation, NodeRectOptions, NodeTransition, type OffsetShapeNodesOptions, type OutlineShapeStrokesOptions, PlaceBesideOptions, Point, PolygonFillRule, PolygonRing, Position, type PositionChangeLike, RESIZE_HANDLES, type RasterImage, type RasterizeSvgOptions, type RecordAnimationOptions, Rect, ReflowDisplacementOptions, type ResizeHandle, SHAPE_DATA_KEY, SHAPE_NODE_TYPE, SHAPE_OPERATIONS, type SampleAnimationOptions, type ScaleKeyframesOptions, type SerializedCanvasScenes, type SetCanvasVariantPropertiesOptions, type SetKeyframeOptions, ShapeDescription, type ShapeNodePolygonOptions, type ShapeOperation, type ShapePathEditOperation, type ShapePathEditRefusal, type ShapePathEditResult, ShapeSize, Side, SizeDimension, type SnapGuidesOptions, type SnapNodeDragOptions, type SnapNodeDragResult, type SnapNodeResizeOptions, type SnapNodeResizeResult, type SnapResizeOptions, type SnapResizeResult, type SnapResult, StreamingLayoutManager, type StreamingLayoutManagerOptions, StrokeCap, StrokeJoin, type StrokeToShapeNodeOptions, TOKEN_BINDINGS_DATA_KEY, TOKEN_MODES_DATA_KEY, type TimelineKeyframe, type TimelineRow, type TimelineRowsOptions, TrajectoryFunction, type WebAnimationSpec, XYPosition, ZOrderOperation, addCanvasVariant, addKeyframesAtTime, animateNode, applyAnimation, applyAnimationOverrides, applyConstraints, applyShapeCombination, applyShapeReplacement, architectureScene, autoLayoutDiagram, bindCanvasComponentProperty, bindCanvasToken, blendDiagramLayout, blendLayout, boundsOf, c4Scene, calculateCursorArrowRotation, calculateCurvedPath, calculateDagreReflowDisplacement, calculateDirectionalDisplacement, canCombineShapeNodes, canOffsetShapeNodes, canOutlineShapeNodeStrokes, canvasHeight, centerNodes, centre, clampAnimationValue, clampLayoutSize, collectDescendantIds, combineCanvasComponentsAsVariants, combineShapeNodes, computeDragBounds, computeDragBoundsFromPoints, computeNodesBoundingBox, computeSnapGuides, connectedDiagramOnly, connectedOnly, copyKeyframes, createBezierTrajectory, createCanvasAnimationController, createCanvasArrangeController, createCanvasAutoLayoutController, createCanvasComponent, createCanvasComponentsController, createCanvasDrawController, createCanvasInstance, createCanvasScenesStore, createDefaultStrokeStyle, createFanOutTrajectory, createGuideIndex, createNodeGuideIndex, cubicPointAt, cubicsToPathData, defaultEasing, deleteKeyframes, detachCanvasInstance, detachTokenBindings, diagramCanvasHeight, diagramFileName, diagramGroupSize, diagramImageSize, diagramLayoutBounds, diagramMarksBounds, diagramMarksToSvg, diagramRenameOp, diagramTargetLabel, diagramTextBaseline, diffOverrideGroups, downloadDiagramPng, easeDiagramTween, ensureDiagramLayout, ensureLayout, estimateCanvasHeight, estimateDiagramCanvasHeight, estimateDiagramNodeSize, estimateNodeSize, estimateTextWidth, evaluateAnimation, exportCssAnimation, familySceneFromLayout, findConnectorSnap, findStrokesAtPoint, findVariant, fitCubicRun, fitCubicWithTangents, fitCubics, fitFreehandPath, fitPathData, fitViewportToNodes, fitViewportToRect, flowSide, formatAgentCursorName, formatAnimationTime, formatVariantName, ganttScene, getAgentCardAnchor, getAnimatableProperty, getAnimatedProperties, getAnimatedValue, getAnimationDuration, getAnimationTrack, getAutoLayout, getAutoLayoutGrid, getAutoLayoutInsertTarget, getBindableTokenProperties, getCanvasComponentDragId, getCanvasTokenProperty, getCenteredNodePosition, getChildLayout, getComponentData, getComponentInstances, getComponentPropertyDefs, getComponentPropertyRefs, getComponentSourceId, getCssPropertyAnimations, getCursorTransitionDuration, getDefaultVariant, getEffectiveTokenModes, getFamilyScene, getFlowChildren, getInstanceData, getInstanceProperties, getInstanceStatus, getKeyframeTimes, getLayerName, getLayoutParent, getLayoutSizing, getLayoutedNodes, getNaturalMovementTiming, getNextVariantValues, getNodeAnimation, getNodeOverrides, getNodeShape, getNodeTokenBindings, getNodeTokenModes, getOwningComponent, getOwningInstance, getResizingNodeRect, getRootInstance, getTimelineRows, getTimelineTicks, getTokenPropertyScope, getTokensForProperty, getVariantConflicts, getVariantOptions, getVariantSet, getVariantValues, gitGraphScene, handlePoint, hasFamilyScene, hasVisibleStroke, hashString, hatchPath, inferResizeHandle, inspectCanvasInstance, inspectNodeTokens, isAgentCursor, isAutoLayoutFrame, isCanvasComponent, isCanvasComponentSet, isCanvasInstance, isCssExportExact, isEventFromTextInput, isInsideInstance, isKeyframeSelected, isMeasureModifierHeld, isNodeAnimated, isShapeNode, isStraightCubic, isValidCanvasEdge, isValidCanvasNode, isValidCanvasScene, isValidUrl, journeyScene, layoutAll, layoutBounds, layoutFrame, layoutUp, layoutUpMany, linearPositionTrajectory, linearTrajectory, listCanvasComponents, makeSizingCoherent, measureBetween, measureLabel, measureSelection, measureToLine, mergeNodeUpdates, mermaidEdgeDash, mermaidEdgeMarker, mermaidEdgeWidth, mermaidFlowEdges, mermaidFlowNodes, mermaidLabelLines, mermaidMarkerId, mermaidMovesFromCanvas, mermaidNodeMembers, mermaidNodePaint, mermaidShapePaths, mermaidThumbnailSvg, mermaidToCanvas, mermaidToScene, mermaidToSvg, mindmapScene, moveKeyframes, moveLayoutChild, nearestHandlePositions, offsetShapeNodes, oppositePosition, outlineShapeNodeStrokes, overlaps, parseCanvasClipboardData, parseCanvasScenes, parseKeyframeClipboard, parseMermaidStyles, parseNodeStyleDeclarations, parseVariantName, pasteKeyframes, pieScene, placeBeside, playWebAnimations, positionToSide, pruneCanvasTokenModes, pushCanvasInstanceOverrides, quadrantScene, radarChartSpec, radarScene, rasterSize, rasterizeSvg, readAnimatableValue, readNodeStyleProperty, readOverrideGroup, recordAnimationChanges, registerFamilyScene, relayoutUpdates, remapPastedNodes, removeCanvasVariant, removeTrack, renameCanvasVariantProperty, renameCanvasVariantValue, repositionNodesTo, resetCanvasInstanceOverrides, resizeHandleAxes, resolveCanvasTokens, resolveMermaidStyles, resolvePadding, restoreCanvasMainComponent, revertShapeCombination, runMultiNodeTransition, sampleAnimationFrames, scaleKeyframes, sceneColor, sequenceScene, serializeCanvasNodes, setCanvasComponentProperty, setCanvasInstanceProperties, setCanvasTokenMode, setCanvasVariantProperties, setKeyframe, setKeyframeEasing, setMotionPath, setTrackEnabled, shapeNodeToBezierPath, shapeNodeToPolygon, shapeToBezierPath, sideToPosition, snapKeyframeDelta, snapNodeDrag, snapNodeResize, snapResize, snapTimeToFrame, snapToGrid, streamedDiagramText, streamlinePoints, strokeBoundingBox, strokePointsToPathData, strokeToShapeNode, swapCanvasInstance, syncAllCanvasInstances, syncCanvasComponents, syncCanvasInstance, timeToX, timelineScene, toWebAnimations, updateKeyframe, withNodeAnimation, withStyleOpacity, wouldCreateComponentCycle, writeNodeStyleProperty, writeOverrideGroup, xToTime, xyChartScene, xyChartSpec };
|
package/dist/canvas/index.d.ts
CHANGED
|
@@ -2814,6 +2814,34 @@ declare function createCanvasDrawController<TNode extends CanvasNode = CanvasNod
|
|
|
2814
2814
|
eraseAt: (point: Point, radius?: number) => TNode[];
|
|
2815
2815
|
};
|
|
2816
2816
|
type CanvasDrawController = ReturnType<typeof createCanvasDrawController>;
|
|
2817
|
+
/** Modifier options when computing bounds while dragging/drawing. */
|
|
2818
|
+
interface CanvasDragBoundsModifiers {
|
|
2819
|
+
/** If true (e.g. Shift key held), constrain the bounding box to 1:1 aspect ratio. */
|
|
2820
|
+
constrain?: boolean;
|
|
2821
|
+
/** If true (e.g. Alt/Option key held), draw/expand outward from the initial start point as center. */
|
|
2822
|
+
fromCenter?: boolean;
|
|
2823
|
+
}
|
|
2824
|
+
interface CanvasDragBounds {
|
|
2825
|
+
x: number;
|
|
2826
|
+
y: number;
|
|
2827
|
+
width: number;
|
|
2828
|
+
height: number;
|
|
2829
|
+
}
|
|
2830
|
+
/**
|
|
2831
|
+
* Computes bounding rectangle from start and current points, supporting
|
|
2832
|
+
* `constrain` (aspect ratio 1:1, Shift key) and `fromCenter` (origin as center, Alt/Option key).
|
|
2833
|
+
*/
|
|
2834
|
+
declare function computeDragBounds(start: {
|
|
2835
|
+
x: number;
|
|
2836
|
+
y: number;
|
|
2837
|
+
}, current: {
|
|
2838
|
+
x: number;
|
|
2839
|
+
y: number;
|
|
2840
|
+
}, modifiers?: CanvasDragBoundsModifiers): CanvasDragBounds;
|
|
2841
|
+
/**
|
|
2842
|
+
* Computes bounding rectangle from start point and raw dimensions (dx, dy).
|
|
2843
|
+
*/
|
|
2844
|
+
declare function computeDragBoundsFromPoints(startX: number, startY: number, currentX: number, currentY: number, modifiers?: CanvasDragBoundsModifiers): CanvasDragBounds;
|
|
2817
2845
|
|
|
2818
2846
|
/**
|
|
2819
2847
|
|
|
@@ -3616,4 +3644,4 @@ declare function formatAgentCursorName(nameOrUsername?: string | null): string;
|
|
|
3616
3644
|
*/
|
|
3617
3645
|
declare function isAgentCursor(cursor: Partial<CanvasAgentCursor>): boolean;
|
|
3618
3646
|
|
|
3619
|
-
export { ANIMATABLE_PROPERTIES, ANIMATION_DATA_KEY, AUTO_LAYOUT_DATA_KEY, type AddCanvasVariantOptions, AlignEdge, AlignNodesOptions, type AnimatableProperty, type AnimateNodeOptions, type AnimationDocument, AnimationEasing, AnimationEditError, type AnimationEditErrorCode, type AnimationFrame, type AnimationHistoryTarget, type AnimationKeyframeClipboard, AnimationLoopMode, type AnimationMotionPath, type AnimationOverrides, AnimationPlayer, AnimationPlayerState, type AnimationPropertyOptions, type AnimationStop, AnimationTrack, AnimationValue, AnimationValueType, type ArrangeHistoryTarget, type AutoLayout, type AutoLayoutAlignContent, type AutoLayoutAlignCross, type AutoLayoutAlignMain, type AutoLayoutCellAlign, type AutoLayoutChild, type AutoLayoutConstraints, type AutoLayoutGrid, type AutoLayoutGridArea, type AutoLayoutGridCell, type AutoLayoutGridGeometry, type AutoLayoutGridTrack, type AutoLayoutHorizontalConstraint, type AutoLayoutInsertTarget, type AutoLayoutMeasure, type AutoLayoutMode, type AutoLayoutOptions, type AutoLayoutPadding, type AutoLayoutSize, type AutoLayoutSizing, type AutoLayoutSizingPair, type AutoLayoutVerticalConstraint, BUILTIN_FAMILY_SCENES, BezierPath, BezierPathInput, CANVAS_COMPONENT_DRAG_TYPE, CANVAS_TOKEN_PROPERTIES, CARD_INSPECTION_ZONES, CHILD_LAYOUT_DATA_KEY, COMPONENT_DATA_KEY, COMPONENT_OVERRIDES_DATA_KEY, COMPONENT_PROPERTY_REFS_DATA_KEY, COMPONENT_SET_DATA_KEY, COMPONENT_SOURCE_DATA_KEY, CONNECTION_LINE_TYPES, CSS_ANIMATION_PROPERTIES, CSS_VARIABLE_DIAGRAM_SCENE_THEME, type CanvasAgentCursor, type CanvasAnimationController, type CanvasAnimationControllerOptions, type CanvasAnimationState, CanvasArrangeAction, type CanvasArrangeController, type CanvasArrangeControllerOptions, type CanvasAutoLayoutController, type CanvasAutoLayoutControllerOptions, CanvasClipboardPayload, type CanvasComponentData, type CanvasComponentErrorCode, type CanvasComponentInfo, type CanvasComponentPropertyDef, type CanvasComponentPropertyField, type CanvasComponentPropertyType, type CanvasComponentPropertyValue, type CanvasComponentResult, type CanvasComponentSetData, type CanvasComponentSetInfo, type CanvasComponentSyncOptions, type CanvasComponentsController, type CanvasComponentsControllerOptions, type CanvasConnectionLineType, type CanvasDrawController, type CanvasDrawControllerOptions, CanvasEdge, CanvasGradientDef, type CanvasHeightOptions, type CanvasInstanceData, type CanvasInstanceInfo, type CanvasInstancePropertyInfo, CanvasLayoutOptions, CanvasNode, CanvasNodeStyle, CanvasNodeUpdate, type CanvasScene, type CanvasScenesOptions, type CanvasScenesState, CanvasScenesStore, type CanvasTokenBindingInfo, type CanvasTokenOptions, type CanvasTokenProperty, type CanvasViewport, type CardInspectionZone, Clock, type CombineShapeNodesOptions, type CombineShapeNodesRefusal, type CombineShapeNodesResult, type ConnectorSnap, type ConnectorSnapOptions, type ConnectorSnapTarget, type CreateCanvasComponentOptions, type CreateCanvasInstanceOptions, type CssAnimationExport, type CssExportOptions, type CssPropertyAnimation, type CubicSegment, type CurvedPathOptions, DEFAULT_CURSOR_INACTIVITY_MS, DEFAULT_DIAGRAM_NODE_HEIGHT, DEFAULT_DIAGRAM_NODE_WIDTH, DEFAULT_NODE_HEIGHT, DEFAULT_NODE_WIDTH, DEFAULT_PLACEMENT_GAP, DIAGRAM_MARKER_IDS, DIAGRAM_RASTER_MAX_SIZE, DIAGRAM_SCENE_DARK_THEME, DIAGRAM_SCENE_LIGHT_THEME, DIAGRAM_SVG_DARK_THEME, DIAGRAM_SVG_LIGHT_THEME, DIAGRAM_TITLE_TARGET, type DiagramBounds, type DiagramCanvasHeightOptions, type DiagramCircleMark, type DiagramLayout, type DiagramLayoutOptions, type DiagramLineMark, type DiagramMark, type DiagramPathMark, type DiagramRectMark, type DiagramScene, type DiagramSceneOptions, type DiagramSceneTheme, type DiagramSize, DiagramStream, type DiagramStreamResult, type DiagramSvg, type DiagramSvgOptions, type DiagramSvgTheme, type DiagramTextMark, DirectionalDisplacementOptions, DistributeAxis, DistributeMode, DistributeNodesOptions, type DownloadDiagramPngOptions, type EvaluateAnimationOptions, type FamilyScene, type FamilySceneInput, FanOutTrajectoryOptions, type FitCubicsOptions, type FitPathDataOptions, type FitViewportOptions, type FreehandDrawOptions, type FreehandStroke, type FreehandStrokeStyle, type FreehandTool, type GuideIndex, type GuideLine, type HatchOptions, INSTANCE_DATA_KEY, IncrementalLayoutOptions, type KeyframeDragState, type KeyframePatch, type KeyframeRangeOptions, type KeyframeRef, type KeyframeSnap, MAX_KEYFRAME_REFS, MERMAID_SHAPE_PAINT, MatchSizeOptions, type MeasureGuide, type MeasureSelectionOptions, type MeasureSelectionResult, type MermaidCanvas, type MermaidCanvasOptions, type MermaidEdgeData, type MermaidFlowEdge, type MermaidFlowNode, type MermaidFlowOptions, type MermaidGroupData, type MermaidMovesOptions, type MermaidNodeData, type MermaidSceneOptions, type MermaidShapePaint, type MermaidShapePath, type MoveKeyframesResult, type MultiNodeTransitionOptions, type NodeAnimation, NodeRectOptions, NodeTransition, type OffsetShapeNodesOptions, type OutlineShapeStrokesOptions, PlaceBesideOptions, Point, PolygonFillRule, PolygonRing, Position, type PositionChangeLike, RESIZE_HANDLES, type RasterImage, type RasterizeSvgOptions, type RecordAnimationOptions, Rect, ReflowDisplacementOptions, type ResizeHandle, SHAPE_DATA_KEY, SHAPE_NODE_TYPE, SHAPE_OPERATIONS, type SampleAnimationOptions, type ScaleKeyframesOptions, type SerializedCanvasScenes, type SetCanvasVariantPropertiesOptions, type SetKeyframeOptions, ShapeDescription, type ShapeNodePolygonOptions, type ShapeOperation, type ShapePathEditOperation, type ShapePathEditRefusal, type ShapePathEditResult, ShapeSize, Side, SizeDimension, type SnapGuidesOptions, type SnapNodeDragOptions, type SnapNodeDragResult, type SnapNodeResizeOptions, type SnapNodeResizeResult, type SnapResizeOptions, type SnapResizeResult, type SnapResult, StreamingLayoutManager, type StreamingLayoutManagerOptions, StrokeCap, StrokeJoin, type StrokeToShapeNodeOptions, TOKEN_BINDINGS_DATA_KEY, TOKEN_MODES_DATA_KEY, type TimelineKeyframe, type TimelineRow, type TimelineRowsOptions, TrajectoryFunction, type WebAnimationSpec, XYPosition, ZOrderOperation, addCanvasVariant, addKeyframesAtTime, animateNode, applyAnimation, applyAnimationOverrides, applyConstraints, applyShapeCombination, applyShapeReplacement, architectureScene, autoLayoutDiagram, bindCanvasComponentProperty, bindCanvasToken, blendDiagramLayout, blendLayout, boundsOf, c4Scene, calculateCursorArrowRotation, calculateCurvedPath, calculateDagreReflowDisplacement, calculateDirectionalDisplacement, canCombineShapeNodes, canOffsetShapeNodes, canOutlineShapeNodeStrokes, canvasHeight, centerNodes, centre, clampAnimationValue, clampLayoutSize, collectDescendantIds, combineCanvasComponentsAsVariants, combineShapeNodes, computeNodesBoundingBox, computeSnapGuides, connectedDiagramOnly, connectedOnly, copyKeyframes, createBezierTrajectory, createCanvasAnimationController, createCanvasArrangeController, createCanvasAutoLayoutController, createCanvasComponent, createCanvasComponentsController, createCanvasDrawController, createCanvasInstance, createCanvasScenesStore, createDefaultStrokeStyle, createFanOutTrajectory, createGuideIndex, createNodeGuideIndex, cubicPointAt, cubicsToPathData, defaultEasing, deleteKeyframes, detachCanvasInstance, detachTokenBindings, diagramCanvasHeight, diagramFileName, diagramGroupSize, diagramImageSize, diagramLayoutBounds, diagramMarksBounds, diagramMarksToSvg, diagramRenameOp, diagramTargetLabel, diagramTextBaseline, diffOverrideGroups, downloadDiagramPng, easeDiagramTween, ensureDiagramLayout, ensureLayout, estimateCanvasHeight, estimateDiagramCanvasHeight, estimateDiagramNodeSize, estimateNodeSize, estimateTextWidth, evaluateAnimation, exportCssAnimation, familySceneFromLayout, findConnectorSnap, findStrokesAtPoint, findVariant, fitCubicRun, fitCubicWithTangents, fitCubics, fitFreehandPath, fitPathData, fitViewportToNodes, fitViewportToRect, flowSide, formatAgentCursorName, formatAnimationTime, formatVariantName, ganttScene, getAgentCardAnchor, getAnimatableProperty, getAnimatedProperties, getAnimatedValue, getAnimationDuration, getAnimationTrack, getAutoLayout, getAutoLayoutGrid, getAutoLayoutInsertTarget, getBindableTokenProperties, getCanvasComponentDragId, getCanvasTokenProperty, getCenteredNodePosition, getChildLayout, getComponentData, getComponentInstances, getComponentPropertyDefs, getComponentPropertyRefs, getComponentSourceId, getCssPropertyAnimations, getCursorTransitionDuration, getDefaultVariant, getEffectiveTokenModes, getFamilyScene, getFlowChildren, getInstanceData, getInstanceProperties, getInstanceStatus, getKeyframeTimes, getLayerName, getLayoutParent, getLayoutSizing, getLayoutedNodes, getNaturalMovementTiming, getNextVariantValues, getNodeAnimation, getNodeOverrides, getNodeShape, getNodeTokenBindings, getNodeTokenModes, getOwningComponent, getOwningInstance, getResizingNodeRect, getRootInstance, getTimelineRows, getTimelineTicks, getTokenPropertyScope, getTokensForProperty, getVariantConflicts, getVariantOptions, getVariantSet, getVariantValues, gitGraphScene, handlePoint, hasFamilyScene, hasVisibleStroke, hashString, hatchPath, inferResizeHandle, inspectCanvasInstance, inspectNodeTokens, isAgentCursor, isAutoLayoutFrame, isCanvasComponent, isCanvasComponentSet, isCanvasInstance, isCssExportExact, isEventFromTextInput, isInsideInstance, isKeyframeSelected, isMeasureModifierHeld, isNodeAnimated, isShapeNode, isStraightCubic, isValidCanvasEdge, isValidCanvasNode, isValidCanvasScene, isValidUrl, journeyScene, layoutAll, layoutBounds, layoutFrame, layoutUp, layoutUpMany, linearPositionTrajectory, linearTrajectory, listCanvasComponents, makeSizingCoherent, measureBetween, measureLabel, measureSelection, measureToLine, mergeNodeUpdates, mermaidEdgeDash, mermaidEdgeMarker, mermaidEdgeWidth, mermaidFlowEdges, mermaidFlowNodes, mermaidLabelLines, mermaidMarkerId, mermaidMovesFromCanvas, mermaidNodeMembers, mermaidNodePaint, mermaidShapePaths, mermaidThumbnailSvg, mermaidToCanvas, mermaidToScene, mermaidToSvg, mindmapScene, moveKeyframes, moveLayoutChild, nearestHandlePositions, offsetShapeNodes, oppositePosition, outlineShapeNodeStrokes, overlaps, parseCanvasClipboardData, parseCanvasScenes, parseKeyframeClipboard, parseMermaidStyles, parseNodeStyleDeclarations, parseVariantName, pasteKeyframes, pieScene, placeBeside, playWebAnimations, positionToSide, pruneCanvasTokenModes, pushCanvasInstanceOverrides, quadrantScene, radarChartSpec, radarScene, rasterSize, rasterizeSvg, readAnimatableValue, readNodeStyleProperty, readOverrideGroup, recordAnimationChanges, registerFamilyScene, relayoutUpdates, remapPastedNodes, removeCanvasVariant, removeTrack, renameCanvasVariantProperty, renameCanvasVariantValue, repositionNodesTo, resetCanvasInstanceOverrides, resizeHandleAxes, resolveCanvasTokens, resolveMermaidStyles, resolvePadding, restoreCanvasMainComponent, revertShapeCombination, runMultiNodeTransition, sampleAnimationFrames, scaleKeyframes, sceneColor, sequenceScene, serializeCanvasNodes, setCanvasComponentProperty, setCanvasInstanceProperties, setCanvasTokenMode, setCanvasVariantProperties, setKeyframe, setKeyframeEasing, setMotionPath, setTrackEnabled, shapeNodeToBezierPath, shapeNodeToPolygon, shapeToBezierPath, sideToPosition, snapKeyframeDelta, snapNodeDrag, snapNodeResize, snapResize, snapTimeToFrame, snapToGrid, streamedDiagramText, streamlinePoints, strokeBoundingBox, strokePointsToPathData, strokeToShapeNode, swapCanvasInstance, syncAllCanvasInstances, syncCanvasComponents, syncCanvasInstance, timeToX, timelineScene, toWebAnimations, updateKeyframe, withNodeAnimation, withStyleOpacity, wouldCreateComponentCycle, writeNodeStyleProperty, writeOverrideGroup, xToTime, xyChartScene, xyChartSpec };
|
|
3647
|
+
export { ANIMATABLE_PROPERTIES, ANIMATION_DATA_KEY, AUTO_LAYOUT_DATA_KEY, type AddCanvasVariantOptions, AlignEdge, AlignNodesOptions, type AnimatableProperty, type AnimateNodeOptions, type AnimationDocument, AnimationEasing, AnimationEditError, type AnimationEditErrorCode, type AnimationFrame, type AnimationHistoryTarget, type AnimationKeyframeClipboard, AnimationLoopMode, type AnimationMotionPath, type AnimationOverrides, AnimationPlayer, AnimationPlayerState, type AnimationPropertyOptions, type AnimationStop, AnimationTrack, AnimationValue, AnimationValueType, type ArrangeHistoryTarget, type AutoLayout, type AutoLayoutAlignContent, type AutoLayoutAlignCross, type AutoLayoutAlignMain, type AutoLayoutCellAlign, type AutoLayoutChild, type AutoLayoutConstraints, type AutoLayoutGrid, type AutoLayoutGridArea, type AutoLayoutGridCell, type AutoLayoutGridGeometry, type AutoLayoutGridTrack, type AutoLayoutHorizontalConstraint, type AutoLayoutInsertTarget, type AutoLayoutMeasure, type AutoLayoutMode, type AutoLayoutOptions, type AutoLayoutPadding, type AutoLayoutSize, type AutoLayoutSizing, type AutoLayoutSizingPair, type AutoLayoutVerticalConstraint, BUILTIN_FAMILY_SCENES, BezierPath, BezierPathInput, CANVAS_COMPONENT_DRAG_TYPE, CANVAS_TOKEN_PROPERTIES, CARD_INSPECTION_ZONES, CHILD_LAYOUT_DATA_KEY, COMPONENT_DATA_KEY, COMPONENT_OVERRIDES_DATA_KEY, COMPONENT_PROPERTY_REFS_DATA_KEY, COMPONENT_SET_DATA_KEY, COMPONENT_SOURCE_DATA_KEY, CONNECTION_LINE_TYPES, CSS_ANIMATION_PROPERTIES, CSS_VARIABLE_DIAGRAM_SCENE_THEME, type CanvasAgentCursor, type CanvasAnimationController, type CanvasAnimationControllerOptions, type CanvasAnimationState, CanvasArrangeAction, type CanvasArrangeController, type CanvasArrangeControllerOptions, type CanvasAutoLayoutController, type CanvasAutoLayoutControllerOptions, CanvasClipboardPayload, type CanvasComponentData, type CanvasComponentErrorCode, type CanvasComponentInfo, type CanvasComponentPropertyDef, type CanvasComponentPropertyField, type CanvasComponentPropertyType, type CanvasComponentPropertyValue, type CanvasComponentResult, type CanvasComponentSetData, type CanvasComponentSetInfo, type CanvasComponentSyncOptions, type CanvasComponentsController, type CanvasComponentsControllerOptions, type CanvasConnectionLineType, type CanvasDragBounds, type CanvasDragBoundsModifiers, type CanvasDrawController, type CanvasDrawControllerOptions, CanvasEdge, CanvasGradientDef, type CanvasHeightOptions, type CanvasInstanceData, type CanvasInstanceInfo, type CanvasInstancePropertyInfo, CanvasLayoutOptions, CanvasNode, CanvasNodeStyle, CanvasNodeUpdate, type CanvasScene, type CanvasScenesOptions, type CanvasScenesState, CanvasScenesStore, type CanvasTokenBindingInfo, type CanvasTokenOptions, type CanvasTokenProperty, type CanvasViewport, type CardInspectionZone, Clock, type CombineShapeNodesOptions, type CombineShapeNodesRefusal, type CombineShapeNodesResult, type ConnectorSnap, type ConnectorSnapOptions, type ConnectorSnapTarget, type CreateCanvasComponentOptions, type CreateCanvasInstanceOptions, type CssAnimationExport, type CssExportOptions, type CssPropertyAnimation, type CubicSegment, type CurvedPathOptions, DEFAULT_CURSOR_INACTIVITY_MS, DEFAULT_DIAGRAM_NODE_HEIGHT, DEFAULT_DIAGRAM_NODE_WIDTH, DEFAULT_NODE_HEIGHT, DEFAULT_NODE_WIDTH, DEFAULT_PLACEMENT_GAP, DIAGRAM_MARKER_IDS, DIAGRAM_RASTER_MAX_SIZE, DIAGRAM_SCENE_DARK_THEME, DIAGRAM_SCENE_LIGHT_THEME, DIAGRAM_SVG_DARK_THEME, DIAGRAM_SVG_LIGHT_THEME, DIAGRAM_TITLE_TARGET, type DiagramBounds, type DiagramCanvasHeightOptions, type DiagramCircleMark, type DiagramLayout, type DiagramLayoutOptions, type DiagramLineMark, type DiagramMark, type DiagramPathMark, type DiagramRectMark, type DiagramScene, type DiagramSceneOptions, type DiagramSceneTheme, type DiagramSize, DiagramStream, type DiagramStreamResult, type DiagramSvg, type DiagramSvgOptions, type DiagramSvgTheme, type DiagramTextMark, DirectionalDisplacementOptions, DistributeAxis, DistributeMode, DistributeNodesOptions, type DownloadDiagramPngOptions, type EvaluateAnimationOptions, type FamilyScene, type FamilySceneInput, FanOutTrajectoryOptions, type FitCubicsOptions, type FitPathDataOptions, type FitViewportOptions, type FreehandDrawOptions, type FreehandStroke, type FreehandStrokeStyle, type FreehandTool, type GuideIndex, type GuideLine, type HatchOptions, INSTANCE_DATA_KEY, IncrementalLayoutOptions, type KeyframeDragState, type KeyframePatch, type KeyframeRangeOptions, type KeyframeRef, type KeyframeSnap, MAX_KEYFRAME_REFS, MERMAID_SHAPE_PAINT, MatchSizeOptions, type MeasureGuide, type MeasureSelectionOptions, type MeasureSelectionResult, type MermaidCanvas, type MermaidCanvasOptions, type MermaidEdgeData, type MermaidFlowEdge, type MermaidFlowNode, type MermaidFlowOptions, type MermaidGroupData, type MermaidMovesOptions, type MermaidNodeData, type MermaidSceneOptions, type MermaidShapePaint, type MermaidShapePath, type MoveKeyframesResult, type MultiNodeTransitionOptions, type NodeAnimation, NodeRectOptions, NodeTransition, type OffsetShapeNodesOptions, type OutlineShapeStrokesOptions, PlaceBesideOptions, Point, PolygonFillRule, PolygonRing, Position, type PositionChangeLike, RESIZE_HANDLES, type RasterImage, type RasterizeSvgOptions, type RecordAnimationOptions, Rect, ReflowDisplacementOptions, type ResizeHandle, SHAPE_DATA_KEY, SHAPE_NODE_TYPE, SHAPE_OPERATIONS, type SampleAnimationOptions, type ScaleKeyframesOptions, type SerializedCanvasScenes, type SetCanvasVariantPropertiesOptions, type SetKeyframeOptions, ShapeDescription, type ShapeNodePolygonOptions, type ShapeOperation, type ShapePathEditOperation, type ShapePathEditRefusal, type ShapePathEditResult, ShapeSize, Side, SizeDimension, type SnapGuidesOptions, type SnapNodeDragOptions, type SnapNodeDragResult, type SnapNodeResizeOptions, type SnapNodeResizeResult, type SnapResizeOptions, type SnapResizeResult, type SnapResult, StreamingLayoutManager, type StreamingLayoutManagerOptions, StrokeCap, StrokeJoin, type StrokeToShapeNodeOptions, TOKEN_BINDINGS_DATA_KEY, TOKEN_MODES_DATA_KEY, type TimelineKeyframe, type TimelineRow, type TimelineRowsOptions, TrajectoryFunction, type WebAnimationSpec, XYPosition, ZOrderOperation, addCanvasVariant, addKeyframesAtTime, animateNode, applyAnimation, applyAnimationOverrides, applyConstraints, applyShapeCombination, applyShapeReplacement, architectureScene, autoLayoutDiagram, bindCanvasComponentProperty, bindCanvasToken, blendDiagramLayout, blendLayout, boundsOf, c4Scene, calculateCursorArrowRotation, calculateCurvedPath, calculateDagreReflowDisplacement, calculateDirectionalDisplacement, canCombineShapeNodes, canOffsetShapeNodes, canOutlineShapeNodeStrokes, canvasHeight, centerNodes, centre, clampAnimationValue, clampLayoutSize, collectDescendantIds, combineCanvasComponentsAsVariants, combineShapeNodes, computeDragBounds, computeDragBoundsFromPoints, computeNodesBoundingBox, computeSnapGuides, connectedDiagramOnly, connectedOnly, copyKeyframes, createBezierTrajectory, createCanvasAnimationController, createCanvasArrangeController, createCanvasAutoLayoutController, createCanvasComponent, createCanvasComponentsController, createCanvasDrawController, createCanvasInstance, createCanvasScenesStore, createDefaultStrokeStyle, createFanOutTrajectory, createGuideIndex, createNodeGuideIndex, cubicPointAt, cubicsToPathData, defaultEasing, deleteKeyframes, detachCanvasInstance, detachTokenBindings, diagramCanvasHeight, diagramFileName, diagramGroupSize, diagramImageSize, diagramLayoutBounds, diagramMarksBounds, diagramMarksToSvg, diagramRenameOp, diagramTargetLabel, diagramTextBaseline, diffOverrideGroups, downloadDiagramPng, easeDiagramTween, ensureDiagramLayout, ensureLayout, estimateCanvasHeight, estimateDiagramCanvasHeight, estimateDiagramNodeSize, estimateNodeSize, estimateTextWidth, evaluateAnimation, exportCssAnimation, familySceneFromLayout, findConnectorSnap, findStrokesAtPoint, findVariant, fitCubicRun, fitCubicWithTangents, fitCubics, fitFreehandPath, fitPathData, fitViewportToNodes, fitViewportToRect, flowSide, formatAgentCursorName, formatAnimationTime, formatVariantName, ganttScene, getAgentCardAnchor, getAnimatableProperty, getAnimatedProperties, getAnimatedValue, getAnimationDuration, getAnimationTrack, getAutoLayout, getAutoLayoutGrid, getAutoLayoutInsertTarget, getBindableTokenProperties, getCanvasComponentDragId, getCanvasTokenProperty, getCenteredNodePosition, getChildLayout, getComponentData, getComponentInstances, getComponentPropertyDefs, getComponentPropertyRefs, getComponentSourceId, getCssPropertyAnimations, getCursorTransitionDuration, getDefaultVariant, getEffectiveTokenModes, getFamilyScene, getFlowChildren, getInstanceData, getInstanceProperties, getInstanceStatus, getKeyframeTimes, getLayerName, getLayoutParent, getLayoutSizing, getLayoutedNodes, getNaturalMovementTiming, getNextVariantValues, getNodeAnimation, getNodeOverrides, getNodeShape, getNodeTokenBindings, getNodeTokenModes, getOwningComponent, getOwningInstance, getResizingNodeRect, getRootInstance, getTimelineRows, getTimelineTicks, getTokenPropertyScope, getTokensForProperty, getVariantConflicts, getVariantOptions, getVariantSet, getVariantValues, gitGraphScene, handlePoint, hasFamilyScene, hasVisibleStroke, hashString, hatchPath, inferResizeHandle, inspectCanvasInstance, inspectNodeTokens, isAgentCursor, isAutoLayoutFrame, isCanvasComponent, isCanvasComponentSet, isCanvasInstance, isCssExportExact, isEventFromTextInput, isInsideInstance, isKeyframeSelected, isMeasureModifierHeld, isNodeAnimated, isShapeNode, isStraightCubic, isValidCanvasEdge, isValidCanvasNode, isValidCanvasScene, isValidUrl, journeyScene, layoutAll, layoutBounds, layoutFrame, layoutUp, layoutUpMany, linearPositionTrajectory, linearTrajectory, listCanvasComponents, makeSizingCoherent, measureBetween, measureLabel, measureSelection, measureToLine, mergeNodeUpdates, mermaidEdgeDash, mermaidEdgeMarker, mermaidEdgeWidth, mermaidFlowEdges, mermaidFlowNodes, mermaidLabelLines, mermaidMarkerId, mermaidMovesFromCanvas, mermaidNodeMembers, mermaidNodePaint, mermaidShapePaths, mermaidThumbnailSvg, mermaidToCanvas, mermaidToScene, mermaidToSvg, mindmapScene, moveKeyframes, moveLayoutChild, nearestHandlePositions, offsetShapeNodes, oppositePosition, outlineShapeNodeStrokes, overlaps, parseCanvasClipboardData, parseCanvasScenes, parseKeyframeClipboard, parseMermaidStyles, parseNodeStyleDeclarations, parseVariantName, pasteKeyframes, pieScene, placeBeside, playWebAnimations, positionToSide, pruneCanvasTokenModes, pushCanvasInstanceOverrides, quadrantScene, radarChartSpec, radarScene, rasterSize, rasterizeSvg, readAnimatableValue, readNodeStyleProperty, readOverrideGroup, recordAnimationChanges, registerFamilyScene, relayoutUpdates, remapPastedNodes, removeCanvasVariant, removeTrack, renameCanvasVariantProperty, renameCanvasVariantValue, repositionNodesTo, resetCanvasInstanceOverrides, resizeHandleAxes, resolveCanvasTokens, resolveMermaidStyles, resolvePadding, restoreCanvasMainComponent, revertShapeCombination, runMultiNodeTransition, sampleAnimationFrames, scaleKeyframes, sceneColor, sequenceScene, serializeCanvasNodes, setCanvasComponentProperty, setCanvasInstanceProperties, setCanvasTokenMode, setCanvasVariantProperties, setKeyframe, setKeyframeEasing, setMotionPath, setTrackEnabled, shapeNodeToBezierPath, shapeNodeToPolygon, shapeToBezierPath, sideToPosition, snapKeyframeDelta, snapNodeDrag, snapNodeResize, snapResize, snapTimeToFrame, snapToGrid, streamedDiagramText, streamlinePoints, strokeBoundingBox, strokePointsToPathData, strokeToShapeNode, swapCanvasInstance, syncAllCanvasInstances, syncCanvasComponents, syncCanvasInstance, timeToX, timelineScene, toWebAnimations, updateKeyframe, withNodeAnimation, withStyleOpacity, wouldCreateComponentCycle, writeNodeStyleProperty, writeOverrideGroup, xToTime, xyChartScene, xyChartSpec };
|
package/dist/canvas/index.js
CHANGED
|
@@ -8415,6 +8415,36 @@ function createCanvasDrawController(options) {
|
|
|
8415
8415
|
eraseAt
|
|
8416
8416
|
};
|
|
8417
8417
|
}
|
|
8418
|
+
function computeDragBounds(start, current, modifiers = {}) {
|
|
8419
|
+
let dx = current.x - start.x;
|
|
8420
|
+
let dy = current.y - start.y;
|
|
8421
|
+
if (modifiers.constrain) {
|
|
8422
|
+
const absDx = Math.abs(dx);
|
|
8423
|
+
const absDy = Math.abs(dy);
|
|
8424
|
+
const maxDim = Math.max(absDx, absDy);
|
|
8425
|
+
dx = (dx < 0 ? -1 : 1) * maxDim;
|
|
8426
|
+
dy = (dy < 0 ? -1 : 1) * maxDim;
|
|
8427
|
+
}
|
|
8428
|
+
if (modifiers.fromCenter) {
|
|
8429
|
+
const halfW = Math.abs(dx);
|
|
8430
|
+
const halfH = Math.abs(dy);
|
|
8431
|
+
return {
|
|
8432
|
+
x: start.x - halfW,
|
|
8433
|
+
y: start.y - halfH,
|
|
8434
|
+
width: halfW * 2,
|
|
8435
|
+
height: halfH * 2
|
|
8436
|
+
};
|
|
8437
|
+
}
|
|
8438
|
+
return {
|
|
8439
|
+
x: Math.min(start.x, start.x + dx),
|
|
8440
|
+
y: Math.min(start.y, start.y + dy),
|
|
8441
|
+
width: Math.abs(dx),
|
|
8442
|
+
height: Math.abs(dy)
|
|
8443
|
+
};
|
|
8444
|
+
}
|
|
8445
|
+
function computeDragBoundsFromPoints(startX, startY, currentX, currentY, modifiers = {}) {
|
|
8446
|
+
return computeDragBounds({ x: startX, y: startY }, { x: currentX, y: currentY }, modifiers);
|
|
8447
|
+
}
|
|
8418
8448
|
|
|
8419
8449
|
// src/canvas/mermaid/layout.ts
|
|
8420
8450
|
import dagre2 from "@dagrejs/dagre";
|
|
@@ -11456,6 +11486,8 @@ export {
|
|
|
11456
11486
|
collectDescendantIds,
|
|
11457
11487
|
combineCanvasComponentsAsVariants,
|
|
11458
11488
|
combineShapeNodes,
|
|
11489
|
+
computeDragBounds,
|
|
11490
|
+
computeDragBoundsFromPoints,
|
|
11459
11491
|
computeNodesBoundingBox,
|
|
11460
11492
|
computeSnapGuides,
|
|
11461
11493
|
connectedDiagramOnly,
|