@weasel-js/core 1.5.0 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +501 -0
  2. package/dist/autoPoseDescriptor-Dr6CwNZK.d.ts +26 -0
  3. package/dist/{chunk-BDWAA634.js → chunk-44EWMJV2.js} +3 -3
  4. package/dist/{chunk-BDWAA634.js.map → chunk-44EWMJV2.js.map} +1 -1
  5. package/dist/{chunk-MQI4PIX3.js → chunk-H6N2JSZ3.js} +3 -3
  6. package/dist/{chunk-MQI4PIX3.js.map → chunk-H6N2JSZ3.js.map} +1 -1
  7. package/dist/chunk-HPFJUUTF.js +167 -0
  8. package/dist/chunk-HPFJUUTF.js.map +1 -0
  9. package/dist/{chunk-UCPV7JXC.js → chunk-L5YNZYEG.js} +9 -169
  10. package/dist/chunk-L5YNZYEG.js.map +1 -0
  11. package/dist/chunk-PNNZSYRD.js +318 -0
  12. package/dist/chunk-PNNZSYRD.js.map +1 -0
  13. package/dist/{chunk-MG7OXCAI.js → chunk-QEZL53V6.js} +2493 -1580
  14. package/dist/chunk-QEZL53V6.js.map +1 -0
  15. package/dist/clipboard.d.ts +1 -1
  16. package/dist/clone.d.ts +2 -2
  17. package/dist/{depSchema-nMqj_qTM.d.ts → depSchema-FKQBEfg7.d.ts} +116 -125
  18. package/dist/{grid-BrIa38gG.d.ts → grid-CuxXjaQV.d.ts} +22 -6
  19. package/dist/index.d.ts +780 -408
  20. package/dist/index.js +6 -4
  21. package/dist/insert.d.ts +3 -3
  22. package/dist/insert.js +2 -1
  23. package/dist/insert.js.map +1 -1
  24. package/dist/math-CeGmGPy8.d.ts +267 -0
  25. package/dist/math.d.ts +5 -0
  26. package/dist/math.js +4 -0
  27. package/dist/math.js.map +1 -0
  28. package/dist/move.d.ts +4 -4
  29. package/dist/move.js +3 -2
  30. package/dist/move.js.map +1 -1
  31. package/dist/{options-BDyCnrp8.d.ts → options-BPcmwYk7.d.ts} +1 -1
  32. package/dist/{autoPoseDescriptor-CvjflWJK.d.ts → pointSnapToGrid-CgcK2R_I.d.ts} +2 -26
  33. package/dist/{poseDescriptor-CGOgIgf8.d.ts → poseDescriptor-PgfVKfa0.d.ts} +1 -1
  34. package/dist/renderer.d.ts +7 -8
  35. package/dist/renderer.js +6 -4
  36. package/dist/resize.d.ts +5 -4
  37. package/dist/resize.js +3 -2
  38. package/dist/{types-DMyo7dnM.d.ts → types-BHGdrOcu.d.ts} +1 -1
  39. package/dist/{types-DtjCJA5r.d.ts → types-BdaK9PcP.d.ts} +1 -1
  40. package/package.json +14 -10
  41. package/dist/chunk-MG7OXCAI.js.map +0 -1
  42. package/dist/chunk-UCPV7JXC.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,7 +1,9 @@
1
- export { ALWAYS, ANCHOR_HIT_BASE_PX, ActionDisabledReason, ActionsProvider, ActionsProviderIfRoot, ActionsScope, ActiveToolContextProvider, ActiveToolContextProviderIfRoot, ArrowIcon, BUILTIN_MARKERS, BUNDLE_TOOLS, COARSE_TARGET_SCALE, CURVE_REPS, CanvasView, ColorOverrideRegistry, CropIcon, CursorCoordsHud, DEFAULT_ALLOWED_CAPABILITIES, DEFAULT_ALPHA_DECAY, DEFAULT_ALPHA_MIN, DEFAULT_DEBUG_STROKES, DEFAULT_DEBUG_THEME, DEFAULT_DEVICE_PROFILE, DEFAULT_FILL_COLOR, DEFAULT_HANDLE_SIZE, DEFAULT_MAX_ZOOM, DEFAULT_MIN_ZOOM, DEFAULT_PALETTE, DEFAULT_ROTATION_HANDLE_DISTANCE, DEFAULT_SHAPE_FILL, DEFAULT_STROKE_COLOR, DEFAULT_TEXT_STYLE, DEFAULT_VELOCITY_DECAY, DepRegistryProvider, DepRegistryProviderIfRoot, DeviceProfileProvider, DivideIcon, EASINGS, EllipseIcon, ExcludeIcon, EyedropperIcon, FALLBACK_FIT_VIEW, GHOST_STROKE, HANDLE_BASE_PX, HandIcon, IDENTITY_JOINT, IDENTITY_POSE_COMPOSITION, ImageIcon, IntersectIcon, KIT_SHAPE_KINDS, KIT_STANDARD_ACTION_IDS, LassoIcon, LineIcon, MARKDOWN_RUN_GRAMMAR, MIXED, MOVE_ANCHORS, MinimapCanvas, NEVER, PAINTED_CURSOR_LAYER_ID, PATH_ANCHOR_CHROME_ID, PenIcon, PencilIcon, PickHud, PointerProviderIfRoot, PolygonIcon, RECT_POSE_COMPOSITION, RIGID_POSE_COMPOSITION, ROTATION_HANDLE_BASE_PX, RectIcon, SCRIPT_METRICS, SPRING_PRESETS, SPRITE_STRIDE, STROKE_DASH_RATIOS, SceneCanvas, SceneViewCanvas, SelectIcon, SelectionContextProvider, SelectionContextProviderIfRoot, StarIcon, SubtractIcon, TOOL_PREF_KINDS, TextIcon, UNION_OF_CHILDREN, UnionIcon, UnknownIcon, VERSION, VIEW_ANIMATION_KEY, WHEEL_ZOOM_STEP, WeaselProvider, ZOOM_FLOOR, _resetMarkersForTests, _resetPaintKindsForTests, aabbCenter, actionBindings, actionIs, actionShortcuts, alignDeltaFor, alignInsertBehavior, alignMoveBehavior, alignResizeBehavior, alignedStrokeRect, always, and, animateLifecycle, animateOnSetPose, annulusSemiAxes, applyBooleanOp, applyStyleToRange, areaSelectAction, arrayAdapter, asNodeId, asPaint, bakeCursor, bezierCubic, bezierQuadratic, blendPoses, blur, buildChromeCtx, buildRuleCtx, buildSceneViewCommands, cachedLayoutRuns, canBringForward, canHover, canQueryLocalFonts2 as canQueryLocalFonts, canSendBackward, capabilityAll, capabilityIn, capabilityIs, capabilityNot, caretIndexAt, cellAt, charOffsetToDomPosition, clampView, clearSelectionAction, clientToCanvas, clipboardCopyAction, clipboardCutAction, cloneAction, coarsePointer, composeAffordanceLayer, composePath, composeRectPose, composeRigidPose, composeSelectionPose, composeWorldPose, computeFitView, computeFitViewport, computeIndicatorCommand, computeWheelAction, cond, constrainTo45, containedThenNearest, countPathAnchors, createCellHighlightLayer, createChildrenLayer, createCornerResizeAffordance, createDebugOverlayLayer, createDebugSink, createDispatcher, createGridLayer, createGuidesLayer, createHistory, createMarkdownRenderer, createMoveToIndexOp, createNodeProperties, createNodeRouting, createPaintedCursorLayer, createPaintedCursorState, createParallaxLayer, createPathAnchorAffordances, createPathEditingOverlayLayer, createPathLayer, createPenPreviewLayer, createPoseFeed, createPoseOverrides, createReorderOp, createRotationAffordance, createScene, createSelectionHandlesLayer, createSelectionOutlineLayer, createSelectionOverlayLayer, createSetDataOp, createSetLayerOp, createSetPathOp, createSetTextOp, createSimulation, createTextLayer, createVelocityTracker, createViewResolver, createViewportLayer, cubicBezierEasing, cursorFor, cycleVertexColors, dashForStrokeStyle, decomposePath, decomposeRectPose, decomposeRigidPose, defaultCommitAdapter, defaultDrawOne, defaultLabelTextRenderer, defaultNodeProperties, defaultNodeRouting, defaultVisibilityRules, defineTool, defineViewportTool, deleteScratch, deriveAlignmentGuides, deriveParallaxView, derivedDepOf, derivedPose, describeRule, documentPose, domPositionToCharOffset, domToRuns, drawLayers, drawOneLayer, easeIn, easeInBack, easeInBounce, easeInCirc, easeInCubic, easeInElastic, easeInExpo, easeInOut, easeInOutBack, easeInOutBounce, easeInOutCirc, easeInOutCubic, easeInOutElastic, easeInOutExpo, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInOutSine, easeInQuad, easeInQuart, easeInQuint, easeInSine, easeOut, easeOutBack, easeOutBounce, easeOutCirc, easeOutCubic, easeOutElastic, easeOutExpo, easeOutQuad, easeOutQuart, easeOutQuint, easeOutSine, editAnchorsAction, effectivePose, enableLocalFontOutlines2 as enableLocalFontOutlines, enterTextEditAction, enumerateAnchors, evaluate, evaluateEnabled, fillInPoseFrame, fillToBoundsFrame, findNodeShape, findShapeInk, findShapeSilhouette, fitTextPose, fitToBounds, fitViewToBounds, fitZoom, flattenPreviews, focused, fontString, forEachCoalesced, frameRect, freeform, gateLayer, gesturing, getAlpha01, getImageBitmap, getMarker, getNodeShapes, getPaintKind, getScratch, getStylusData, gradientForBounds, gradientGeometry, hasFontOutlines2 as hasFontOutlines, hexToRgba, hitAffordanceRegions, hitAnchor, hitRotationHandle, hostAnchorCss, hostAnchorRect, hovering, hoveringSelected, imageStatus, inferredNodeProperties, inferredNodeRouting, insertAction, insertPreviewExtent, interpolateView, isBuiltinToolPref, isCanvasFont2 as isCanvasFont, isEditableTarget, isGradientFill, isLayerPainted, isLayerVisible, isPatternSpec, keySpecShortcut, lassoSelectAction, layoutMarkdown, layoutRuns, layoutTextPose, lerpColorArray, lerpOklab, lerpOklch, linear, listFontOutlines2 as listFontOutlines, listMarkers, listPaintKinds, liveScope, makePinchZoomAction, makeViewportWheelPanAction, makeViewportZoomAction, markdownToRuns, markerDrawCommands, markerInset, markerKeyOf, markerSites, mat3, matchAlignment, matchesKeyBinding, meanScale, measureText, measureTextBounds, measuredWidth, mergeAlphaFromPrev, mergeContributions, modeIn, modeIs, modeNot, modifierHeld, momentum, moveAction, multiActive, nearest, nearestWithin, nestedHitTester, never, nodeHasFlag, none, normalizeHex, normalizeView, normalizeZoom, not, nurbs, oklabToOklch, oklabToSrgbU8, oklchToOklab, openFilePicker, openPointerSession, or, outlineStatus2 as outlineStatus, paintAlpha, paintKindOf, paintWithAlpha, paintWithColor, parseColor, parseColorToRgba255, parseDebugFlags, pathContainsPoint, pathContainsPolygon, pathContainsRect, pathDistanceToPoint, pathDivide, pathExclude, pathFromD, pathInPoseFrame, pathInWorld, pathIntersect, pathIntersectsPolygon, pathIntersectsRect, pathOriginProjection, pathSubtract, pathToAnchors, pathUnion, pickTopMostHit, pinchZoomAction, planPixelRender, pointAlongPath, pointInRotatedRect, pointInTextPose, poseRotationOf, prefUnit, pressureToWidth, rainbowVertexColors, rebaseLocalPose, rectCorners, registerCanvasFont2 as registerCanvasFont, registerContentHandler, registerEffect, registerFont2 as registerFont, registerFontOutlines2 as registerFontOutlines, registerMarker, registerNodeShape, registerPaintKind, renderLabel, renderSceneToCanvas, renderSceneToPixels, resizeAction, resolveAlign, resolveColor, resolveCursor, resolveCursorTier, resolveDeviceProfile, resolveEasing, resolveFillPattern, resolveMarkerSize, resolveOverlays, resolveParams, resolvePatternSpec, resolvePreviews, resolveRuns, resolveSkeleton, resolveStrokeWidth, resolveTextStyle, resolveVisibility, rgbaToHex, rotateAction, rotateAroundAABBCenter, rotatePathAround, rotatePoint, rotatedRectCorners, rotationDegreesUnit, rotationHandle, roundToCell, runsToDom, runsToMarkdown, runsToPlainText, sampleGradientStops, sampleTrack, sceneFromJSON, sceneNodeClientRect, sceneSelectionStore, sceneToAdapter, scopeBindings, scratchKey, screenToWorld, selectFromLasso, selectionAtLeast, selectionEmpty, selectionIs, setFlagOverRange, setScratch, shapeCoversPoint, sliceAction, snapPoint, solid, solidVertexColors, specificity, spiro, splitPathByLine, splitSubpaths, springPose, springVertexColors, srgbU8ToOklab, staggerVertexColors, startThresholdDrag, strokeDashStyleOf, strokeInsets, strokeOf, strokeWith, styleAtRange, subscribeGlyphReady2 as subscribeGlyphReady, subscribeImageReady, textCommand, textCommandFromPose, textCommandFromRuns, textLineBoxes, textPoseLayoutInput, tileGrid, toHex8, toRuns, translateRectPose, trimPolyline, tweenPose, tweenVertexColors, unionBoundsPath, unionOfChildren, unionOfChildrenVia, unregisterCanvasFont2 as unregisterCanvasFont, unregisterFontOutlines2 as unregisterFontOutlines, useAction, useActionsRegistry, useActiveToolContext, useAlign, useAnimator, useArrayAdapter, useAutoCenter, useBooleans, useBooleansAdapter, useCanvasFocus, useCanvasSize, useDecayLoop, useDepRegistry, useDepSource, useDeviceProfile, useDistribute, useDragGesture, useDragHandle, useDragRadial, useDragRect, useDropZone, useEllipseTool, useEyedropperTool, useGestureDispatcher, useGridCellHover, useGuides, useHandTool, useHandleDrag, useHostAnchor, useHoverTracking, useImageTool, useKeybindings, useLassoTool, useLineTool, useNodeOverlayFrame, useOptionalActiveToolContext, useOptionalDepRegistry, usePenTool, usePencilTool, usePinchGesture, usePointerStylus, usePolygonTool, usePoseCompositionDepSource, usePoseDescriptorDepSource, usePoseRun, usePublishSelection, useRectTool, useResizePolicy, useRotateTool, useScene, useSceneAdapter, useSceneTextEdit, useSelectTool, useSelection, useSelectionContext, useSimulation, useSliceDep, useStandardActions, useStarTool, useTextEdit, useTextTool, useTools, useVelocityTracker, useViewAnimation, useVisibleRaf, verticalAlignOffset, viewToMat3, viewToTransform, viewZoom, viewportDragPanAction, viewportWheelPanAction, viewportZoomAction, viewportsAt, vignette, wheelPan, wheelZoom, wheelZoomFactor, when, withAlpha01, withCoord, withGradientKind, worldEditToStorage, worldPoseLookup, worldToScreen, zoomAt, zoomAtLeast } from './chunk-MG7OXCAI.js';
2
- export { createReparentOp, createTransformOp, snap } from './chunk-BDWAA634.js';
3
- export { CORNER_ANCHORS, cornerPoint, cornerResizeHandles, hitCornerHandle, pointSnapToGrid } from './chunk-MQI4PIX3.js';
4
- export { ANGLE_RADIANS, AUTO_POSE_DESCRIPTOR, DEFAULT_FLATTEN_TOLERANCE, DEFAULT_GUIDE_TOLERANCE_PX, IMPERIAL_INCHES, METRIC_MM, PATH_C, PATH_CMD_LENGTHS, PATH_L, PATH_M, PATH_Q, PATH_Z, PIXELS, PathBuilder, RECT_ORIGIN_PROJECTION, RECT_POSE_DESCRIPTOR, ROTATED_POSE_DESCRIPTOR, axisAlignedBounds, boundsOfPath, ellipsePath, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, formatUnit, gridSnapStrategy, guideSnapStrategy, isPathLike, isRectPose, linePath, pathCommandCoordCount, pathPoseDescriptor, pointInPath, pointToGridCell, polygonFromPoints, polylineFromPoints, poseDescriptorForNode, pxExtent, rectPath, regularPolygonPath, resolveUnit, scaleDelta, scalePathToBounds, starPath, transformPath, translatePath, translatePolygonInPlace, translatePoseViaDescriptor, unionAABB, unionBounds, visualBoundsViaDescriptor, withinPxBox, withinPxRadius } from './chunk-UCPV7JXC.js';
1
+ export { ALWAYS, ANCHOR_HIT_BASE_PX, ActionDisabledReason, ActionsProvider, ActionsProviderIfRoot, ActionsScope, ActiveToolContextProvider, ActiveToolContextProviderIfRoot, ArrowIcon, BUILTIN_MARKERS, BUNDLE_TOOLS, COARSE_TARGET_SCALE, CURVE_REPS, CanvasView, ColorOverrideRegistry, CropIcon, CursorCoordsHud, DEFAULT_ALLOWED_CAPABILITIES, DEFAULT_DEBUG_STROKES, DEFAULT_DEBUG_THEME, DEFAULT_DEVICE_PROFILE, DEFAULT_FILL_COLOR, DEFAULT_HANDLE_SIZE, DEFAULT_MAX_ZOOM, DEFAULT_MIN_ZOOM, DEFAULT_PALETTE, DEFAULT_ROTATION_HANDLE_DISTANCE, DEFAULT_SHAPE_FILL, DEFAULT_STROKE_COLOR, DEFAULT_TEXT_STYLE, DepRegistryProvider, DepRegistryProviderIfRoot, DeviceProfileProvider, DivideIcon, EASINGS, EllipseIcon, ExcludeIcon, EyedropperIcon, FALLBACK_FIT_VIEW, GHOST_STROKE, HANDLE_BASE_PX, HandIcon, IDENTITY_JOINT, IDENTITY_POSE_COMPOSITION, ImageIcon, IntersectIcon, KIT_SHAPE_KINDS, KIT_STANDARD_ACTION_IDS, LassoIcon, LineIcon, MARKDOWN_RUN_GRAMMAR, MESH_BAKE_SIZE, MESH_GRADIENT_KIND, MIXED, MOVE_ANCHORS, MinimapCanvas, NEVER, PAINTED_CURSOR_LAYER_ID, PATH_ANCHOR_CHROME_ID, PenIcon, PencilIcon, PickHud, PointerProviderIfRoot, PolygonIcon, RECT_POSE_COMPOSITION, RIGID_POSE_COMPOSITION, ROTATION_HANDLE_BASE_PX, RectIcon, SCRIPT_METRICS, SPRING_PRESETS, SPRITE_STRIDE, STROKE_DASH_RATIOS, SceneCanvas, SceneViewCanvas, SelectIcon, SelectionContextProvider, SelectionContextProviderIfRoot, StarIcon, SubtractIcon, TOOL_PREF_KINDS, TextIcon, UNION_OF_CHILDREN, UnionIcon, UnknownIcon, VERSION, VIEW_ANIMATION_KEY, WHEEL_ZOOM_STEP, WeaselProvider, ZOOM_FLOOR, _resetMarkersForTests, _resetPaintKindsForTests, actionBindings, actionIs, actionShortcuts, alignDeltaFor, alignInsertBehavior, alignMoveBehavior, alignResizeBehavior, alignedStrokeRect, always, and, animateLifecycle, animateOnSetPose, annulusSemiAxes, applyBooleanOp, applyStyleToRange, areaSelectAction, arrayAdapter, asNodeId, asPaint, bakeCursor, bakeMesh, bezierCubic, bezierQuadratic, bindRig, blendPoses, blur, buildChromeCtx, buildRuleCtx, buildSceneViewCommands, cachedLayoutRuns, canBringForward, canHover, canQueryLocalFonts2 as canQueryLocalFonts, canSendBackward, capabilityAll, capabilityIn, capabilityIs, capabilityNot, caretIndexAt, cellAt, charOffsetToDomPosition, circlePath, clampView, clearSelectionAction, clientToCanvas, clipboardCopyAction, clipboardCutAction, cloneAction, coarsePointer, composeAffordanceLayer, composePath, composeRectPose, composeRigidPose, composeSelectionPose, composeWorldPose, computeFitView, computeFitViewport, computeIndicatorCommand, computeWheelAction, cond, constrainTo45, containedThenNearest, cornerWeights, countPathAnchors, createCellHighlightLayer, createChildrenLayer, createCornerResizeAffordance, createDebugOverlayLayer, createDebugSink, createDispatcher, createGridLayer, createGuidesLayer, createHistory, createKeyState, createMarkdownRenderer, createMoveToIndexOp, createNodeProperties, createNodeRouting, createPaintedCursorLayer, createPaintedCursorState, createParallaxLayer, createPathAnchorAffordances, createPathEditingOverlayLayer, createPathLayer, createPenPreviewLayer, createPoseFeed, createPoseOverrides, createReorderOp, createRotationAffordance, createScene, createSelectionHandlesLayer, createSelectionOutlineLayer, createSelectionOverlayLayer, createSetDataOp, createSetLayerOp, createSetPathOp, createSetTextOp, createSlew, createTextLayer, createTiledLayer, createVelocityTracker, createViewResolver, createViewportLayer, cubicBezierEasing, cullDrawCommands, cursorFor, cycleVertexColors, dashForStrokeStyle, decomposePath, decomposeRectPose, decomposeRigidPose, defaultCommitAdapter, defaultDrawOne, defaultLabelTextRenderer, defaultNodeProperties, defaultNodeRouting, defaultVisibilityRules, defineTool, defineViewportTool, deleteScratch, deriveAlignmentGuides, deriveParallaxView, derivedDepOf, derivedPose, describeRule, documentPose, domPositionToCharOffset, domToRuns, drawLayers, drawOneLayer, easeIn, easeInBack, easeInBounce, easeInCirc, easeInCubic, easeInElastic, easeInExpo, easeInOut, easeInOutBack, easeInOutBounce, easeInOutCirc, easeInOutCubic, easeInOutElastic, easeInOutExpo, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInOutSine, easeInQuad, easeInQuart, easeInQuint, easeInSine, easeOut, easeOutBack, easeOutBounce, easeOutCirc, easeOutCubic, easeOutElastic, easeOutExpo, easeOutQuad, easeOutQuart, easeOutQuint, easeOutSine, editAnchorsAction, effectivePose, effectiveRangeStyle, enableLocalFontOutlines2 as enableLocalFontOutlines, enterTextEditAction, enumerateAnchors, evalPatch, evaluate, evaluateEnabled, fillInPoseFrame, fillToBoundsFrame, findNodeShape, findShapeInk, findShapeSilhouette, fitTextPose, fitToBounds, fitViewToBounds, fitZoom, flattenPreviews, focused, fontString, forEachCoalesced, frameRect, freeform, gateLayer, gesturing, getAlpha01, getImageBitmap, getMarker, getNodeShapes, getPaintKind, getScratch, getStylusData, gradientForBounds, gradientGeometry, hasFontOutlines2 as hasFontOutlines, hexToOklchDeg, hexToRgba, hitAffordanceRegions, hitAnchor, hitRotationHandle, hostAnchorCss, hostAnchorRect, hovering, hoveringSelected, imageStatus, inferredNodeProperties, inferredNodeRouting, insertAction, insertPreviewExtent, interpolateView, isBuiltinToolPref, isCanvasFont2 as isCanvasFont, isEditableTarget, isGradientFill, isLayerPainted, isLayerVisible, isMeshGradientFill, isPatternSpec, isTensorPatch, isValidPatch, keySpecShortcut, lassoSelectAction, layoutMarkdown, layoutRuns, layoutTextPose, lerpColorArray, lerpOklab, lerpOklch, linear, listFontOutlines2 as listFontOutlines, listMarkers, listPaintKinds, liveScope, makePinchZoomAction, makeViewportWheelPanAction, makeViewportZoomAction, markdownToRuns, markerDrawCommands, markerInset, markerKeyOf, markerSites, mat3, matchAlignment, matchesKeyBinding, meanScale, measureText, measureTextBounds, measuredWidth, mergeAlphaFromPrev, mergeContributions, meshBounds, meshGradientXml, modeIn, modeIs, modeNot, modifierHeld, momentum, moveAction, multiActive, nearest, nearestWithin, nestedHitTester, never, nodeHasFlag, none, normalizeHex, normalizeView, normalizeZoom, not, nurbs, oklabToOklch, oklabToSrgbU8, oklchDegToHex, oklchToOklab, openFilePicker, openPointerSession, or, outlineStatus2 as outlineStatus, paintAlpha, paintKindOf, paintWithAlpha, paintWithColor, parseColor, parseColorToRgba255, parseDebugFlags, patchBounds, patchCorner, pathContainsPoint, pathContainsPolygon, pathContainsRect, pathDistanceToPoint, pathDivide, pathExclude, pathFromD, pathInPoseFrame, pathInWorld, pathIntersect, pathIntersectsPolygon, pathIntersectsRect, pathOriginProjection, pathSubtract, pathToAnchors, pathUnion, pickTopMostHit, pinchZoomAction, planPixelRender, pointInTextPose, poseRotationOf, prefUnit, pressureToWidth, rainbowVertexColors, rebaseLocalPose, rectMarkerPath, registerCanvasFont2 as registerCanvasFont, registerContentHandler, registerEffect, registerFont2 as registerFont, registerFontOutlines2 as registerFontOutlines, registerMarker, registerNodeShape, registerPaintKind, renderLabel, renderSceneToCanvas, renderSceneToPixels, resizeAction, resolveAlign, resolveColor, resolveCursor, resolveCursorTier, resolveDeviceProfile, resolveEasing, resolveFillPattern, resolveMarkerSize, resolveOverlays, resolveParams, resolvePatternSpec, resolvePreviews, resolveRuns, resolveScreenLength, resolveSkeleton, resolveStrokeWidth, resolveTextStyle, resolveVisibility, rgbaToHex, rigidRigApply, rotateAction, rotateAroundAABBCenter, rotatePathAround, rotationDegreesUnit, rotationHandle, roundRectPath, roundToCell, runsToDom, runsToMarkdown, runsToPlainText, sampleGradientStops, sampleTrack, sceneFromJSON, sceneNodeClientRect, sceneSelectionStore, sceneToAdapter, scopeBindings, scratchKey, screenToWorld, seedMeshPatch, selectFromLasso, selectionAtLeast, selectionEmpty, selectionIs, setFlagOverRange, setScratch, shapeCoversPoint, slewToward, sliceAction, snapPoint, solid, solidVertexColors, specificity, spiro, splitPathByLine, splitSubpaths, springPose, springVertexColors, squarePath, srgbFloatToOklab, srgbU8ToOklab, staggerVertexColors, startThresholdDrag, strokeDashStyleOf, strokeInsets, strokeOf, strokeWith, styleAtRange, subscribeGlyphReady2 as subscribeGlyphReady, subscribeImageReady, textCommand, textCommandFromPose, textCommandFromRuns, textLineBoxes, textPoseLayoutInput, tileGrid, tiledProject, toHex8, toRuns, translateRectPose, trimPolyline, tweenPose, tweenVertexColors, unionBoundsPath, unionOfChildren, unionOfChildrenVia, unregisterCanvasFont2 as unregisterCanvasFont, unregisterFontOutlines2 as unregisterFontOutlines, useAction, useActionsRegistry, useActiveToolContext, useAlign, useAnimator, useArrayAdapter, useAutoCenter, useBooleans, useBooleansAdapter, useCanvasFocus, useCanvasSize, useDecayLoop, useDepRegistry, useDepSource, useDeviceProfile, useDistribute, useDragGesture, useDragHandle, useDragRadial, useDragRect, useDropZone, useEllipseTool, useEyedropperTool, useGestureDispatcher, useGridCellHover, useGuides, useHandTool, useHandleDrag, useHostAnchor, useHoverTracking, useImageTool, useKeyState, useKeybindings, useLassoTool, useLineTool, useNodeOverlayFrame, useOptionalActiveToolContext, useOptionalDepRegistry, usePenTool, usePencilTool, usePinchGesture, usePointerStylus, usePolygonTool, usePoseCompositionDepSource, usePoseDescriptorDepSource, usePoseRun, usePublishSelection, useRectTool, useResizePolicy, useRig, useScene, useSceneAdapter, useSceneTextEdit, useSelectTool, useSelection, useSelectionContext, useSimulation, useSliceDep, useStandardActions, useStarTool, useTextEdit, useTextTool, useTools, useVelocityTracker, useViewAnimation, useViewAnimationOn, useVisibleRaf, verticalAlignOffset, viewToMat3, viewToTransform, viewZoom, viewportDragPanAction, viewportWheelPanAction, viewportZoomAction, viewportsAt, vignette, wheelPan, wheelZoom, wheelZoomFactor, when, withAlpha01, withCoord, withGradientKind, worldEditToStorage, worldPoseLookup, worldToScreen, zoomAt, zoomAtLeast } from './chunk-QEZL53V6.js';
2
+ export { DEFAULT_ALPHA_DECAY, DEFAULT_ALPHA_MIN, DEFAULT_VELOCITY_DECAY, aabbCenter, createSimulation, pointAlongPath, pointInRotatedRect, rectCorners, rotatePoint, rotatedRectCorners } from './chunk-PNNZSYRD.js';
3
+ export { createReparentOp, createTransformOp, snap } from './chunk-44EWMJV2.js';
4
+ export { CORNER_ANCHORS, cornerPoint, cornerResizeHandles, hitCornerHandle, pointSnapToGrid } from './chunk-H6N2JSZ3.js';
5
+ export { ANGLE_RADIANS, DEFAULT_GUIDE_TOLERANCE_PX, IMPERIAL_INCHES, METRIC_MM, PIXELS, RECT_ORIGIN_PROJECTION, formatUnit, gridSnapStrategy, guideSnapStrategy, pointToGridCell, pxExtent, resolveUnit, scaleDelta, unitScale, withinPxBox, withinPxRadius } from './chunk-HPFJUUTF.js';
6
+ export { AUTO_POSE_DESCRIPTOR, DEFAULT_FLATTEN_TOLERANCE, PATH_C, PATH_CMD_LENGTHS, PATH_L, PATH_M, PATH_Q, PATH_Z, PathBuilder, RECT_POSE_DESCRIPTOR, ROTATED_POSE_DESCRIPTOR, axisAlignedBounds, boundsOfPath, ellipsePath, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, isPathLike, isRectPose, linePath, pathCommandCoordCount, pathPoseDescriptor, pointInPath, polygonFromPoints, polylineFromPoints, poseDescriptorForNode, rectPath, regularPolygonPath, scalePathToBounds, starPath, transformPath, translatePath, translatePoseViaDescriptor, unionAABB, unionBounds, visualBoundsViaDescriptor } from './chunk-L5YNZYEG.js';
5
7
  export { PointerContextProvider, WEASEL_CLIPBOARD_MIME, WEASEL_CLIPBOARD_MIME_WEB, applyOpsTo, buildWeaselClipboardText, dispatchApplyBatch, dlog, dwarn, embedWeaselMetadataInSvg, extractWeaselClipboardFromSvg, isDebugEnabled, parseWeaselClipboardText, sniffWeaselClipboardText, useClipboardOps, usePointerContext } from './chunk-T3UQ3F6R.js';
6
8
  export { cloneByAltDrag } from './chunk-D4AAWR64.js';
7
9
  export { createSetSelectionOp } from './chunk-DOBSZOPR.js';
package/dist/insert.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export { U as UseInsertOptions } from './options-BDyCnrp8.js';
2
- import { I as InsertBehavior } from './types-DMyo7dnM.js';
1
+ export { U as UseInsertOptions } from './options-BPcmwYk7.js';
2
+ import { I as InsertBehavior } from './types-BHGdrOcu.js';
3
3
  import { ModifierState, View } from '@weasel-js/routing';
4
4
  import { G as Guide } from './types-D2tTKEU0.js';
5
5
  import '@weasel-js/history';
6
- import './types-DtjCJA5r.js';
6
+ import './types-BdaK9PcP.js';
7
7
 
8
8
  type ModKey$1 = keyof ModifierState;
9
9
  /** Insert behavior that rounds the insertion point to a grid, so a shape
package/dist/insert.js CHANGED
@@ -1,4 +1,5 @@
1
- import { DEFAULT_GUIDE_TOLERANCE_PX, pxExtent } from './chunk-UCPV7JXC.js';
1
+ import { DEFAULT_GUIDE_TOLERANCE_PX, pxExtent } from './chunk-HPFJUUTF.js';
2
+ import './chunk-L5YNZYEG.js';
2
3
 
3
4
  // src/interactions/actions/insert/behaviors/snapToGrid.ts
4
5
  function snapToGrid(args) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interactions/actions/insert/behaviors/snapToGrid.ts","../src/interactions/actions/insert/behaviors/snapToGuides.ts"],"names":[],"mappings":";;;AAWO,SAAS,WAAkB,IAAA,EAGR;AACxB,EAAA,MAAM,EAAE,OAAA,EAAS,SAAA,EAAU,GAAI,IAAA;AAC/B,EAAA,MAAM,QAAQ,CAAC,CAAA,KAAc,KAAK,KAAA,CAAM,CAAA,GAAI,OAAO,CAAA,GAAI,OAAA;AACvD,EAAA,OAAO;AAAA,IACL,QAAQ,GAAA,EAAK;AACX,MAAA,IAAI,SAAA,IAAa,GAAA,CAAI,SAAA,CAAU,SAAS,CAAA,EAAG;AAC3C,MAAA,MAAM,EAAA,GAAK,GAAA,CAAI,UAAA,CAAW,CAAC,CAAA;AAC3B,MAAA,MAAM,CAAA,GAAI,GAAA,CAAI,MAAA,C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GAAA,CAAI,UAAA,CAAW,CAAC,CAAA;AAC3B,MAAA,MAAM,CAAA,GAAI,GAAA,CAAI,MAAA,CAAO,GAAA,CAAI,EAAE,CAAA;AAC3B,MAAA,IAAI,CAAC,CAAA,EAAG;AACR,MAAA,MAAM,OAAA,GAAU,SAAA,CAAU,CAAA,EAAG,MAAA,EAAQ,iBAAiB,CAAA;AACtD,MAAA,IAAI,OAAA,EAAS,GAAA,CAAI,MAAA,CAAO,GAAA,CAAI,IAAI,OAA2B,CAAA;AAAA,IAC7D,CAAA;AAAA,IACA,MAAA,CAAO,GAAA,EAAK,EAAE,OAAA,EAAQ,EAAG;AACvB,MAAA,IAAI,SAAA,IAAa,GAAA,CAAI,SAAA,CAAU,SAAS,CAAA,EAAG;AAC3C,MAAA,MAAM,MAAA,GAAS,KAAK,SAAA,EAAU;AAC9B,MAAA,IAAI,MAAA,CAAO,WAAW,CAAA,EAAG;AACzB,MAAA,MAAM,OAAA,GAAU,SAAA,CAAU,OAAA,EAAS,MAAA,EAAQ,iBAAiB,CAAA;AAC5D,MAAA,IAAI,CAAC,OAAA,EAAS;AACd,MAAA,OAAO,EAAE,SAAS,OAAA,EAAQ;AAAA,IAC5B;AAAA,GACF;AACF","file":"insert.js","sourcesContent":["import type {\n InsertBehavior,\n InsertPoint,\n ModifierState,\n} from '../../../gestures/types';\n\ntype ModKey = keyof ModifierState;\n\n/** Insert behavior that rounds the insertion point to a grid, so a shape\n * drawn freehand lands on grid intersections. Hold `bypassKey` to place\n * freely. */\nexport function snapToGrid<TPose>(args: {\n spacing: number;\n bypassKey?: ModKey;\n}): InsertBehavior<TPose> {\n const { spacing, bypassKey } = args;\n const round = (v: number) => Math.round(v / spacing) * spacing;\n return {\n onStart(ctx) {\n if (bypassKey && ctx.modifiers[bypassKey]) return;\n const id = ctx.draggedIds[0];\n const o = ctx.origin.get(id) as unknown as InsertPoint | undefined;\n if (!o) return;\n ctx.origin.set(id, { x: round(o.x), y: round(o.y) } as unknown as TPose);\n },\n onMove(ctx, { current }) {\n if (bypassKey && ctx.modifiers[bypassKey]) return;\n return { current: { x: round(current.x), y: round(current.y) } };\n },\n };\n}\n","import type {\n InsertBehavior,\n InsertPoint,\n ModifierState,\n} from '../../../gestures/types';\nimport type { Guide } from 'features/guides/types';\nimport type { View } from 'core/viewport/view';\nimport { pxExtent } from 'core/viewport/pxExtent';\nimport { DEFAULT_GUIDE_TOLERANCE_PX } from '../../../gestures/shared/strategies/guides';\n\ntype ModKey = keyof ModifierState;\n\n/** Options for the insert-flavored `snapToGuides`. */\nexport interface SnapToGuidesInsertArgs {\n /** Stable getter into the live guide list (typically from `useGuides`). */\n getGuides: () => readonly Guide[];\n /** Snap tolerance (screen px when `getView` is set, world units otherwise). */\n tolerance?: number;\n /** Read the active view; required for screen-pixel tolerance. */\n getView?: () => View;\n /** Modifier key that bypasses snapping while held. */\n bypassKey?: ModKey;\n}\n\nfunction snapPoint(\n p: InsertPoint,\n guides: readonly Guide[],\n tol: { x: number; y: number },\n): InsertPoint | null {\n let bestDx = 0;\n let bestAbsDx = Infinity;\n let bestDy = 0;\n let bestAbsDy = Infinity;\n for (const g of guides) {\n if (g.axis === 'x') {\n const d = g.offset - p.x;\n const ad = Math.abs(d);\n if (ad <= tol.x && ad < bestAbsDx) {\n bestAbsDx = ad;\n bestDx = d;\n }\n } else {\n const d = g.offset - p.y;\n const ad = Math.abs(d);\n if (ad <= tol.y && ad < bestAbsDy) {\n bestAbsDy = ad;\n bestDy = d;\n }\n }\n }\n if (bestAbsDx === Infinity && bestAbsDy === Infinity) return null;\n const dx = bestAbsDx === Infinity ? 0 : bestDx;\n const dy = bestAbsDy === Infinity ? 0 : bestDy;\n if (dx === 0 && dy === 0) return null;\n return { x: p.x + dx, y: p.y + dy };\n}\n\n/**\n * Insert behavior that snaps the start anchor (on gesture start) and the\n * live current point (during drag) to the nearest guide on each axis when\n * within `tolerance`. Pair with `useGuides` and `createGuidesLayer`.\n */\nexport function snapToGuides<TPose>(\n args: SnapToGuidesInsertArgs,\n): InsertBehavior<TPose> {\n const tolerance = args.tolerance ?? DEFAULT_GUIDE_TOLERANCE_PX;\n const getView = args.getView;\n const bypassKey = args.bypassKey;\n\n // Per axis: a vertical guide is matched by a horizontal distance, so it\n // answers to `scale.x` alone.\n const computeWorldTol = (): { x: number; y: number } =>\n getView ? pxExtent(tolerance, getView().scale) : { x: tolerance, y: tolerance };\n\n return {\n onStart(ctx) {\n if (bypassKey && ctx.modifiers[bypassKey]) return;\n const guides = args.getGuides();\n if (guides.length === 0) return;\n const id = ctx.draggedIds[0];\n const o = ctx.origin.get(id) as unknown as InsertPoint | undefined;\n if (!o) return;\n const snapped = snapPoint(o, guides, computeWorldTol());\n if (snapped) ctx.origin.set(id, snapped as unknown as TPose);\n },\n onMove(ctx, { current }) {\n if (bypassKey && ctx.modifiers[bypassKey]) return;\n const guides = args.getGuides();\n if (guides.length === 0) return;\n const snapped = snapPoint(current, guides, computeWorldTol());\n if (!snapped) return;\n return { current: snapped };\n },\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/interactions/actions/insert/behaviors/snapToGrid.ts","../src/interactions/actions/insert/behaviors/snapToGuides.ts"],"names":[],"mappings":";;;;AAWO,SAAS,WAAkB,IAAA,EAGR;AACxB,EAAA,MAAM,EAAE,OAAA,EAAS,SAAA,EAAU,GAAI,IAAA;AAC/B,EAAA,MAAM,QAAQ,CAAC,CAAA,KAAc,KAAK,KAAA,CAAM,CAAA,GAAI,OAAO,CAAA,GAAI,OAAA;AACvD,EAAA,OAAO;AAAA,IACL,QAAQ,GAAA,EAAK;AACX,MAAA,IAAI,SAAA,IAAa,GAAA,CAAI,SAAA,CAAU,SAAS,CAAA,EAAG;AAC3C,MAAA,MAAM,EAAA,GAAK,GAAA,CAAI,UAAA,CAAW,CAAC,CAAA;AAC3B,MAAA,MAAM,CAAA,GAAI,GAAA,CAAI,MAAA,CAAO,GAAA,CAAI,EAAE,CAAA;AAC3B,MAAA,IAAI,CAAC,CAAA,EAAG;AAC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AAA,CAAI,MAAA,CAAO,GAAA,CAAI,EAAE,CAAA;AAC3B,MAAA,IAAI,CAAC,CAAA,EAAG;AACR,MAAA,MAAM,OAAA,GAAU,SAAA,CAAU,CAAA,EAAG,MAAA,EAAQ,iBAAiB,CAAA;AACtD,MAAA,IAAI,OAAA,EAAS,GAAA,CAAI,MAAA,CAAO,GAAA,CAAI,IAAI,OAA2B,CAAA;AAAA,IAC7D,CAAA;AAAA,IACA,MAAA,CAAO,GAAA,EAAK,EAAE,OAAA,EAAQ,EAAG;AACvB,MAAA,IAAI,SAAA,IAAa,GAAA,CAAI,SAAA,CAAU,SAAS,CAAA,EAAG;AAC3C,MAAA,MAAM,MAAA,GAAS,KAAK,SAAA,EAAU;AAC9B,MAAA,IAAI,MAAA,CAAO,WAAW,CAAA,EAAG;AACzB,MAAA,MAAM,OAAA,GAAU,SAAA,CAAU,OAAA,EAAS,MAAA,EAAQ,iBAAiB,CAAA;AAC5D,MAAA,IAAI,CAAC,OAAA,EAAS;AACd,MAAA,OAAO,EAAE,SAAS,OAAA,EAAQ;AAAA,IAC5B;AAAA,GACF;AACF","file":"insert.js","sourcesContent":["import type {\n InsertBehavior,\n InsertPoint,\n ModifierState,\n} from '../../../gestures/types';\n\ntype ModKey = keyof ModifierState;\n\n/** Insert behavior that rounds the insertion point to a grid, so a shape\n * drawn freehand lands on grid intersections. Hold `bypassKey` to place\n * freely. */\nexport function snapToGrid<TPose>(args: {\n spacing: number;\n bypassKey?: ModKey;\n}): InsertBehavior<TPose> {\n const { spacing, bypassKey } = args;\n const round = (v: number) => Math.round(v / spacing) * spacing;\n return {\n onStart(ctx) {\n if (bypassKey && ctx.modifiers[bypassKey]) return;\n const id = ctx.draggedIds[0];\n const o = ctx.origin.get(id) as unknown as InsertPoint | undefined;\n if (!o) return;\n ctx.origin.set(id, { x: round(o.x), y: round(o.y) } as unknown as TPose);\n },\n onMove(ctx, { current }) {\n if (bypassKey && ctx.modifiers[bypassKey]) return;\n return { current: { x: round(current.x), y: round(current.y) } };\n },\n };\n}\n","import type {\n InsertBehavior,\n InsertPoint,\n ModifierState,\n} from '../../../gestures/types';\nimport type { Guide } from 'features/guides/types';\nimport type { View } from 'core/viewport/view';\nimport { pxExtent } from 'core/viewport/pxExtent';\nimport { DEFAULT_GUIDE_TOLERANCE_PX } from '../../../gestures/shared/strategies/guides';\n\ntype ModKey = keyof ModifierState;\n\n/** Options for the insert-flavored `snapToGuides`. */\nexport interface SnapToGuidesInsertArgs {\n /** Stable getter into the live guide list (typically from `useGuides`). */\n getGuides: () => readonly Guide[];\n /** Snap tolerance (screen px when `getView` is set, world units otherwise). */\n tolerance?: number;\n /** Read the active view; required for screen-pixel tolerance. */\n getView?: () => View;\n /** Modifier key that bypasses snapping while held. */\n bypassKey?: ModKey;\n}\n\nfunction snapPoint(\n p: InsertPoint,\n guides: readonly Guide[],\n tol: { x: number; y: number },\n): InsertPoint | null {\n let bestDx = 0;\n let bestAbsDx = Infinity;\n let bestDy = 0;\n let bestAbsDy = Infinity;\n for (const g of guides) {\n if (g.axis === 'x') {\n const d = g.offset - p.x;\n const ad = Math.abs(d);\n if (ad <= tol.x && ad < bestAbsDx) {\n bestAbsDx = ad;\n bestDx = d;\n }\n } else {\n const d = g.offset - p.y;\n const ad = Math.abs(d);\n if (ad <= tol.y && ad < bestAbsDy) {\n bestAbsDy = ad;\n bestDy = d;\n }\n }\n }\n if (bestAbsDx === Infinity && bestAbsDy === Infinity) return null;\n const dx = bestAbsDx === Infinity ? 0 : bestDx;\n const dy = bestAbsDy === Infinity ? 0 : bestDy;\n if (dx === 0 && dy === 0) return null;\n return { x: p.x + dx, y: p.y + dy };\n}\n\n/**\n * Insert behavior that snaps the start anchor (on gesture start) and the\n * live current point (during drag) to the nearest guide on each axis when\n * within `tolerance`. Pair with `useGuides` and `createGuidesLayer`.\n */\nexport function snapToGuides<TPose>(\n args: SnapToGuidesInsertArgs,\n): InsertBehavior<TPose> {\n const tolerance = args.tolerance ?? DEFAULT_GUIDE_TOLERANCE_PX;\n const getView = args.getView;\n const bypassKey = args.bypassKey;\n\n // Per axis: a vertical guide is matched by a horizontal distance, so it\n // answers to `scale.x` alone.\n const computeWorldTol = (): { x: number; y: number } =>\n getView ? pxExtent(tolerance, getView().scale) : { x: tolerance, y: tolerance };\n\n return {\n onStart(ctx) {\n if (bypassKey && ctx.modifiers[bypassKey]) return;\n const guides = args.getGuides();\n if (guides.length === 0) return;\n const id = ctx.draggedIds[0];\n const o = ctx.origin.get(id) as unknown as InsertPoint | undefined;\n if (!o) return;\n const snapped = snapPoint(o, guides, computeWorldTol());\n if (snapped) ctx.origin.set(id, snapped as unknown as TPose);\n },\n onMove(ctx, { current }) {\n if (bypassKey && ctx.modifiers[bypassKey]) return;\n const guides = args.getGuides();\n if (guides.length === 0) return;\n const snapped = snapPoint(current, guides, computeWorldTol());\n if (!snapped) return;\n return { current: snapped };\n },\n };\n}\n"]}
@@ -0,0 +1,267 @@
1
+ import { c as PolygonPath, f as PathFillRule, e as RectPath, a as Path, d as RotatedPose } from './poseDescriptor-PgfVKfa0.js';
2
+ import { Point2, Bounds } from '@weasel-js/routing';
3
+ import '@weasel-js/geom';
4
+ import './autoPoseDescriptor-Dr6CwNZK.js';
5
+
6
+ /**
7
+ * Minimal node interface for the simulation primitive. Matches d3-force's
8
+ * node shape exactly so d3-force's bundled forces work without translation.
9
+ *
10
+ * Consumers extend this with arbitrary additional fields (id, label, etc.).
11
+ */
12
+ interface SimulationNode {
13
+ x: number;
14
+ y: number;
15
+ vx?: number;
16
+ vy?: number;
17
+ /** Pin x to this value when non-null. The integrator skips x/vx for the node. */
18
+ fx?: number | null;
19
+ fy?: number | null;
20
+ /** Array index, written by `initialize`. Some forces (e.g. forceLink) rely on it. */
21
+ index?: number;
22
+ }
23
+ /**
24
+ * Force protocol — contract-compatible with d3-force. A force is a function
25
+ * called once per tick with the current alpha; it mutates `vx`/`vy` on nodes.
26
+ * Optional `initialize` lets the force compute setup (link indices, etc.).
27
+ */
28
+ interface SimulationForce<TNode extends SimulationNode = SimulationNode> {
29
+ (alpha: number): void;
30
+ initialize?(nodes: TNode[], random?: () => number): void;
31
+ }
32
+ /** Options for `useSimulation`: everything {@link SimulationOptions} carries,
33
+ * plus the loop's own callbacks and clock. */
34
+ interface UseSimulationOptions<TNode extends SimulationNode> extends SimulationOptions<TNode> {
35
+ /** Fired after each integration step. */
36
+ onTick?: (nodes: TNode[]) => void;
37
+ /** Fired once when the sim settles (alpha < alphaMin && alphaTarget === 0). */
38
+ onEnd?: () => void;
39
+ /** Optional rAF injection. Defaults to window.requestAnimationFrame. */
40
+ requestFrame?: (cb: (t: number) => void) => number;
41
+ cancelFrame?: (handle: number) => void;
42
+ }
43
+ /**
44
+ * A force simulation over a set of nodes, with no clock of its own.
45
+ *
46
+ * Each tick applies every force and then integrates velocities, scaled by
47
+ * `alpha` — a temperature that decays toward `alphaTarget` so the layout
48
+ * settles instead of jittering forever. Raise `alphaTarget` to reheat it,
49
+ * which is what a drag does.
50
+ *
51
+ * Nodes are mutated in place; the simulation holds the array, not a copy.
52
+ *
53
+ * Nothing here advances time. {@link Simulation} adds the frame loop; a caller
54
+ * that wants the whole relaxation at once — a layout pass, a pre-warm, a test
55
+ * — drives {@link SimulationCore.tick} itself.
56
+ */
57
+ interface SimulationCore<TNode extends SimulationNode> {
58
+ readonly nodes: TNode[];
59
+ setNodes(nodes: TNode[]): this;
60
+ setForces(forces: SimulationForce<TNode>[]): this;
61
+ alpha(): number;
62
+ alpha(value: number): this;
63
+ alphaTarget(): number;
64
+ alphaTarget(value: number): this;
65
+ alphaDecay(): number;
66
+ alphaDecay(value: number): this;
67
+ alphaMin(): number;
68
+ alphaMin(value: number): this;
69
+ velocityDecay(): number;
70
+ velocityDecay(value: number): this;
71
+ /**
72
+ * Run the tick body synchronously `iterations` times. Does NOT fire
73
+ * onTick or onEnd (matches d3-force). Used for offscreen pre-warm and tests.
74
+ */
75
+ tick(iterations?: number): this;
76
+ isSettled(): boolean;
77
+ }
78
+ /** A {@link SimulationCore} running on a frame loop. */
79
+ interface Simulation<TNode extends SimulationNode> extends SimulationCore<TNode> {
80
+ /** Resume the RAF loop. If alpha < alphaMin, reset alpha to 1. */
81
+ restart(): this;
82
+ /** Cancel the RAF loop. Does not change alpha. */
83
+ stop(): this;
84
+ }
85
+ /** What {@link SimulationCore} needs: the nodes, the forces acting on them,
86
+ * and the cooling schedule. {@link UseSimulationOptions} adds the loop's. */
87
+ interface SimulationOptions<TNode extends SimulationNode> {
88
+ /** Mutable array of nodes. Kit + forces mutate vx/vy/x/y in place. */
89
+ nodes: TNode[];
90
+ /** Forces applied per tick. Each may implement `initialize` for setup. */
91
+ forces?: SimulationForce<TNode>[];
92
+ /** Initial alpha. Default 1. */
93
+ alpha?: number;
94
+ /** Settle threshold. When alpha drops below and alphaTarget is 0, onEnd fires. Default 0.001. */
95
+ alphaMin?: number;
96
+ /** Per-tick decay rate toward alphaTarget. Default 1 - 0.001^(1/300) ≈ 0.0228. */
97
+ alphaDecay?: number;
98
+ /** Target alpha. Set above alphaMin to keep sim warm (e.g. during drag). Default 0. */
99
+ alphaTarget?: number;
100
+ /** Friction multiplier on velocity per tick: vx *= (1 - velocityDecay). Default 0.4. */
101
+ velocityDecay?: number;
102
+ /** Handed to each force's `initialize`. Default `Math.random`; pass a seeded
103
+ * source to make a run reproducible. */
104
+ random?: () => number;
105
+ }
106
+ /** Default alpha decay: such that alpha drops from 1 to alphaMin (0.001) in 300 ticks. */
107
+ declare const DEFAULT_ALPHA_DECAY: number;
108
+ /** Alpha below which a cooling simulation is considered settled. */
109
+ declare const DEFAULT_ALPHA_MIN = 0.001;
110
+ /** Fraction of velocity shed each tick — friction. Higher settles sooner and
111
+ * overshoots less. */
112
+ declare const DEFAULT_VELOCITY_DECAY = 0.4;
113
+
114
+ /**
115
+ * The integrator, with no clock attached.
116
+ *
117
+ * Velocity-Verlet over a pluggable force list, contract-compatible with
118
+ * d3-force so d3's own bundled forces drop in untranslated. Nothing here
119
+ * advances time: `tick()` is the only thing that moves a node, and the caller
120
+ * decides how often to call it. `useSimulation` calls it once a frame; a
121
+ * layout pass calls it a few hundred times in one go and reads the result.
122
+ *
123
+ * Splitting it out is what lets a *pure* function run a relaxation — a React
124
+ * hook cannot, and the alternative was a second integrator drifting away from
125
+ * this one.
126
+ */
127
+
128
+ declare function createSimulation<TNode extends SimulationNode>(opts: SimulationOptions<TNode>): SimulationCore<TNode>;
129
+
130
+ /**
131
+ * Fluent builder for `PolygonPath`. Hides the `Uint8Array` / `Float32Array`
132
+ * encoding behind move/line/curve/close calls and a final `build()`. Use
133
+ * this to construct paths in tests and demos; production callers that need
134
+ * to mutate large paths in place should reach for the raw arrays directly.
135
+ *
136
+ * Numeric capacity grows by doubling — typical for amortized O(1) push.
137
+ *
138
+ * Also exposes `rectPath` / `polygonFromPoints` shortcuts for the common
139
+ * cases. `rectPath` returns the lighter `RectPath` subtype, not a polygon.
140
+ */
141
+
142
+ /** Fluent builder for `PolygonPath`; hides the `Uint8Array`/`Float32Array` encoding behind move/line/curve/close calls. */
143
+ declare class PathBuilder {
144
+ private cmds;
145
+ private xs;
146
+ private fillRule;
147
+ /** Seed a builder with an existing `PolygonPath`. Useful for extending
148
+ * an in-flight path with another segment (e.g. appending a cubic to
149
+ * the end of a curve in response to a user action) without hand-
150
+ * reaching into the `commands` / `coords` typed arrays.
151
+ *
152
+ * ```ts
153
+ * const next = PathBuilder.fromPath(current).curveTo(...).build();
154
+ * ```
155
+ */
156
+ static fromPath(path: PolygonPath): PathBuilder;
157
+ setFillRule(rule: PathFillRule): this;
158
+ moveTo(x: number, y: number): this;
159
+ lineTo(x: number, y: number): this;
160
+ /** Cubic bezier to (x, y) with control points (x1, y1) and (x2, y2). */
161
+ curveTo(x1: number, y1: number, x2: number, y2: number, x: number, y: number): this;
162
+ /** Quadratic bezier to (x, y) with control point (x1, y1). */
163
+ quadTo(x1: number, y1: number, x: number, y: number): this;
164
+ close(): this;
165
+ build(): PolygonPath;
166
+ }
167
+ /** Construct a `RectPath` (the fast-path subtype). */
168
+ declare function rectPath(x: number, y: number, width: number, height: number): RectPath;
169
+ /** Build an open polyline from a flat list of points — the same geometry as
170
+ * {@link polygonFromPoints} without the closing edge. A freehand stroke and a
171
+ * measurement line want this; a region wants the closed one. */
172
+ declare function polylineFromPoints(points: readonly {
173
+ x: number;
174
+ y: number;
175
+ }[]): PolygonPath | RectPath;
176
+ /** Build a closed polygon from a flat list of points. */
177
+ declare function polygonFromPoints(points: readonly {
178
+ x: number;
179
+ y: number;
180
+ }[], opts?: {
181
+ fillRule?: PathFillRule;
182
+ }): PolygonPath;
183
+ /** Closed ellipse inscribed in `bounds`, as a 4-cubic-Bezier `PolygonPath`.
184
+ * Matches the geometry `useEllipseTool`'s overlay paints. */
185
+ declare function ellipsePath(bounds: {
186
+ x: number;
187
+ y: number;
188
+ width: number;
189
+ height: number;
190
+ }): PolygonPath;
191
+ /** Closed regular n-gon centered at `center`, circumscribed by `radius`.
192
+ * `rotation` is in radians; default 0 puts the first vertex on the +x axis. */
193
+ declare function regularPolygonPath(center: {
194
+ x: number;
195
+ y: number;
196
+ }, radius: number, sides: number, rotation?: number): PolygonPath;
197
+ /** Closed n-pointed star centered at `center`, alternating `outerRadius` and
198
+ * `innerRadius` (default `outerRadius / 2`). `rotation` is in radians. */
199
+ declare function starPath(center: {
200
+ x: number;
201
+ y: number;
202
+ }, outerRadius: number, points?: number, innerRadius?: number, rotation?: number): PolygonPath;
203
+ /** Open 2-vertex polyline from `a` to `b` — strokeable, not fillable. */
204
+ declare function linePath(a: {
205
+ x: number;
206
+ y: number;
207
+ }, b: {
208
+ x: number;
209
+ y: number;
210
+ }): PolygonPath;
211
+
212
+ /**
213
+ * A station along a path: where it is at a fraction of its length, and which
214
+ * way it is heading there.
215
+ *
216
+ * For anything positioned *along* geometry rather than beside it — a label on a
217
+ * routed edge, a tick on a curve, a badge near an arrowhead. Curves are
218
+ * flattened first, so the fraction is arc length along the drawn shape rather
219
+ * than a curve parameter, which is what makes 0.5 look like the middle.
220
+ */
221
+
222
+ interface PathStation {
223
+ point: Point2;
224
+ /** Unit vector along the path at `point`, pointing toward the end. */
225
+ tangent: Point2;
226
+ }
227
+ interface PointAlongPathOptions {
228
+ /** Curve flattening tolerance, in world units. Default 0.5. */
229
+ flattenTolerance?: number;
230
+ }
231
+ /**
232
+ * Where `path` is at `t` of its total length, and its heading there.
233
+ *
234
+ * `t` is clamped to 0..1. Subpaths are measured in order and treated as one
235
+ * run, the way a browser measures a whole `<path>`. Returns `null` for a path
236
+ * with no points at all; a path of zero length answers at its single point,
237
+ * heading along +X.
238
+ */
239
+ declare function pointAlongPath(path: Path, t: number, opts?: PointAlongPathOptions): PathStation | null;
240
+
241
+ /** AABB center of an unrotated rect — the canonical rotation pivot. */
242
+ declare function aabbCenter(bounds: Bounds): {
243
+ x: number;
244
+ y: number;
245
+ };
246
+ /** Rotate `(px, py)` by `angle` (radians) around `(cx, cy)`. */
247
+ declare function rotatePoint(px: number, py: number, cx: number, cy: number, angle: number): {
248
+ x: number;
249
+ y: number;
250
+ };
251
+ /** Four corners of an unrotated rect, in TL/TR/BR/BL order. */
252
+ declare function rectCorners(bounds: Bounds): {
253
+ x: number;
254
+ y: number;
255
+ }[];
256
+ /** Four corners of a rotated rect (rotation around AABB center), in
257
+ * TL/TR/BR/BL order. Useful for selection-overlay rendering. */
258
+ declare function rotatedRectCorners(pose: RotatedPose): {
259
+ x: number;
260
+ y: number;
261
+ }[];
262
+ /** Hit-test a world point against a rotated rect (rotation around AABB
263
+ * center). Standard pattern: invert the rotation and AABB-test in the
264
+ * rect's local frame. */
265
+ declare function pointInRotatedRect(pose: RotatedPose, worldX: number, worldY: number): boolean;
266
+
267
+ export { DEFAULT_ALPHA_DECAY as D, PathBuilder as P, type SimulationNode as S, type UseSimulationOptions as U, type Simulation as a, DEFAULT_ALPHA_MIN as b, DEFAULT_VELOCITY_DECAY as c, type PathStation as d, type PointAlongPathOptions as e, type SimulationCore as f, type SimulationForce as g, type SimulationOptions as h, aabbCenter as i, createSimulation as j, ellipsePath as k, linePath as l, pointInRotatedRect as m, polygonFromPoints as n, polylineFromPoints as o, pointAlongPath as p, rectPath as q, rectCorners as r, regularPolygonPath as s, rotatePoint as t, rotatedRectCorners as u, starPath as v };
package/dist/math.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export { a as Path, f as PathFillRule, c as PolygonPath, P as PoseDescriptor, e as RectPath, t as translatePoseViaDescriptor } from './poseDescriptor-PgfVKfa0.js';
2
+ export { Point2 as Vec2 } from '@weasel-js/routing';
3
+ export { P as PathBuilder, a as Simulation, f as SimulationCore, g as SimulationForce, S as SimulationNode, h as SimulationOptions, j as createSimulation, p as pointAlongPath, n as polygonFromPoints, o as polylineFromPoints, q as rectPath, t as rotatePoint } from './math-CeGmGPy8.js';
4
+ export { DEFAULT_FLATTEN_TOLERANCE, PATH_C, PATH_CMD_LENGTHS, PATH_L, PATH_M, PATH_Q, PATH_Z, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, pathCommandCoordCount } from '@weasel-js/geom';
5
+ export { A as AUTO_POSE_DESCRIPTOR } from './autoPoseDescriptor-Dr6CwNZK.js';
package/dist/math.js ADDED
@@ -0,0 +1,4 @@
1
+ export { createSimulation, pointAlongPath, rotatePoint } from './chunk-PNNZSYRD.js';
2
+ export { AUTO_POSE_DESCRIPTOR, DEFAULT_FLATTEN_TOLERANCE, PATH_C, PATH_CMD_LENGTHS, PATH_L, PATH_M, PATH_Q, PATH_Z, PathBuilder, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, pathCommandCoordCount, polygonFromPoints, polylineFromPoints, rectPath, translatePoseViaDescriptor } from './chunk-L5YNZYEG.js';
3
+ //# sourceMappingURL=math.js.map
4
+ //# sourceMappingURL=math.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"math.js"}
package/dist/move.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { O as OriginProjection } from './grid-BrIa38gG.js';
2
- export { U as UseMoveOptions } from './grid-BrIa38gG.js';
3
- import { M as MoveBehavior } from './types-DMyo7dnM.js';
1
+ import { O as OriginProjection } from './grid-CuxXjaQV.js';
2
+ export { U as UseMoveOptions } from './grid-CuxXjaQV.js';
3
+ import { M as MoveBehavior } from './types-BHGdrOcu.js';
4
4
  import { ModifierState, View } from '@weasel-js/routing';
5
- import { S as SnapTarget } from './types-DtjCJA5r.js';
5
+ import { S as SnapTarget } from './types-BdaK9PcP.js';
6
6
  import { G as Guide } from './types-D2tTKEU0.js';
7
7
  import '@weasel-js/history';
8
8
 
package/dist/move.js CHANGED
@@ -1,5 +1,6 @@
1
- import { snap, createTransformOp, createReparentOp } from './chunk-BDWAA634.js';
2
- import { gridSnapStrategy, RECT_ORIGIN_PROJECTION, guideSnapStrategy } from './chunk-UCPV7JXC.js';
1
+ import { snap, createTransformOp, createReparentOp } from './chunk-44EWMJV2.js';
2
+ import { gridSnapStrategy, RECT_ORIGIN_PROJECTION, guideSnapStrategy } from './chunk-HPFJUUTF.js';
3
+ import './chunk-L5YNZYEG.js';
3
4
  import { createDeleteOp } from './chunk-4RJP2N2L.js';
4
5
  import { scratchKey, getScratch, setScratch } from '@weasel-js/routing';
5
6
 
package/dist/move.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interactions/actions/move/behaviors/snapToGrid.ts","../src/interactions/actions/move/behaviors/snapToContainer.ts","../src/interactions/actions/move/behaviors/snapBackOrDelete.ts","../src/interactions/actions/move/behaviors/snapToGuides.ts"],"names":["snap","scratchKey","setScratch","getScratch"],"mappings":";;;;;;AAQO,SAAS,WAAmD,IAAA,EAG3C;AACtB,EAAA,OAAO,IAAA,CAAK,iBAAwB,IAAA,CAAK,OAAO,GAAG,EAAE,SAAA,EAAW,IAAA,CAAK,SAAA,EAAW,CAAA;AAClF;ACIA,IAAM,KAAA,GAAQ,WAA+B,iBAAiB,CAAA;AAE9D,SAAS,SAAgB,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AAA,MAAM,GAAA,GAAY,CAAC,cAAA,CAAe,EAAE,IAAA,EAAM,KAAK,KAAA,EAAO,WAAA,EAAa,KAAA,EAAO,CAAC,CAAA;AAC3E,QAAA,OAAO,GAAA;AAAA,MACT;AAIA,MAAA,OAAO,IAAA;AAAA,IACT;AAAA,GACF;AACF;;;ACjDO,SAAS,aACd,IAAA,EACqB;AACrB,EAAA,MAAM,QAAA,GAAW,iBAAA,CAAyB,IAAA,CAAK,SAAA,EAAW;AAAA,IACxD,WAAW,IAAA,CAAK,SAAA;AAAA,IAChB,SAAS,IAAA,CAAK,OAAA;AAAA,IACd,QAAQ,IAAA,CAAK;AAAA,GACd,CAAA;AACD,EAAA,OAAO,KAAK,QAAA,EAAU,EAAE,SAAA,EAAW,IAAA,CAAK,WAAW,CAAA;AACrD","file":"move.js","sourcesContent":["import type { ModifierState, MoveBehavior } from '../../../gestures/types';\nimport { snap } from '../../../gestures/shared/snap';\nimport { gridSnapStrategy } from '../../../gestures/shared/strategies/grid';\n\ntype ModKey = keyof ModifierState;\n\n/** Move behavior that snaps the dragged pose's origin to a grid. Hold\n * `bypassKey` to drag freely. */\nexport function snapToGrid<TPose extends { x: number; y: number }>(args: {\n spacing: number;\n bypassKey?: ModKey;\n}): MoveBehavior<TPose> {\n return snap(gridSnapStrategy<TPose>(args.spacing), { bypassKey: args.bypassKey });\n}\n","import { createTransformOp } from 'core/ops/transform';\nimport { createReparentOp } from 'core/ops/reparent';\nimport type { Op } from 'core/ops/types';\nimport type { SnapTarget } from 'core/adapters/types';\nimport type { MoveBehavior, GestureContext } from '../../../gestures/types';\nimport { scratchKey, getScratch, setScratch } from '@weasel-js/routing';\n\ninterface SnapState<TPose> {\n pendingTargetId: string | null;\n pendingTimer: ReturnType<typeof setTimeout> | null;\n committedSnap: SnapTarget<TPose> | null;\n}\n\n// The slot is generic over TPose; we keep the unknown-pose key at module\n// scope and project it through `as` at the read site (each consumer call\n// of `snapToContainer<TPose>` is the only writer of its own SnapState\n// instance, so the cast is safe at runtime).\nconst STATE = scratchKey<SnapState<unknown>>('snapToContainer');\n\nfunction getState<TPose>(ctx: GestureContext<TPose>): SnapState<TPose> {\n let s = getScratch(ctx.scratch, STATE) as SnapState<TPose> | undefined;\n if (!s) {\n s = { pendingTargetId: null, pendingTimer: null, committedSnap: null };\n setScratch(ctx.scratch, STATE, s as SnapState<unknown>);\n }\n return s;\n}\n\nfunction clearTimer<TPose>(s: SnapState<TPose>) {\n if (s.pendingTimer !== null) {\n clearTimeout(s.pendingTimer);\n s.pendingTimer = null;\n }\n s.pendingTargetId = null;\n}\n\n/**\n * Move behavior that drops the dragged node into a container it hovers over\n * for `dwellMs`, reparenting it and taking the pose the container's layout\n * assigns.\n *\n * The dwell is what keeps a drag that merely passes over a container from\n * being captured by it.\n */\nexport function snapToContainer<TPose>(args: {\n dwellMs: number;\n findTarget: (\n draggedId: string,\n worldX: number,\n worldY: number,\n ) => SnapTarget<TPose> | null;\n isInstant?: (target: SnapTarget<TPose>) => boolean;\n moveLabel?: string;\n reparentLabel?: string;\n}): MoveBehavior<TPose> {\n const { dwellMs, findTarget, isInstant, moveLabel = 'Move', reparentLabel = 'Move and reparent' } = args;\n\n return {\n onMove(ctx, _proposed) {\n const s = getState<TPose>(ctx);\n const target = findTarget(ctx.draggedIds[0], ctx.pointer.worldX, ctx.pointer.worldY);\n\n if (s.committedSnap) {\n if (target && target.parentId === s.committedSnap.parentId) {\n return { pose: s.committedSnap.slotPose, snap: s.committedSnap };\n }\n s.committedSnap = null;\n }\n\n if (!target) {\n clearTimer(s);\n return;\n }\n\n if (isInstant?.(target)) {\n clearTimer(s);\n s.committedSnap = target;\n return { pose: target.slotPose, snap: target };\n }\n\n if (s.pendingTargetId === target.parentId) {\n return;\n }\n clearTimer(s);\n s.pendingTargetId = target.parentId;\n s.pendingTimer = setTimeout(() => {\n s.committedSnap = target;\n s.pendingTimer = null;\n }, dwellMs);\n return;\n },\n\n onEnd(ctx) {\n const s = getState<TPose>(ctx);\n clearTimer(s);\n const snap = s.committedSnap ?? ctx.snap;\n if (!snap) return;\n const draggedId = ctx.draggedIds[0];\n const oldParent = ctx.adapter.getParent?.(draggedId) ?? null;\n const fromPose = ctx.origin.get(draggedId)!;\n const ops: Op[] = [\n createTransformOp<TPose>({\n id: draggedId,\n from: fromPose,\n to: snap.slotPose,\n label: moveLabel,\n }),\n ];\n if (oldParent !== snap.parentId) {\n ops.push(createReparentOp({\n id: draggedId,\n fromParentId: oldParent,\n toParentId: snap.parentId,\n label: reparentLabel,\n }));\n }\n return ops;\n },\n };\n}\n","import { createDeleteOp } from 'core/ops/delete';\nimport type { Op } from 'core/ops/types';\nimport type { MoveBehavior } from '../../../gestures/types';\nimport {\n RECT_ORIGIN_PROJECTION,\n type OriginProjection,\n} from '../../../gestures/shared/strategies';\nimport { scratchKey, getScratch, setScratch } from '@weasel-js/routing';\n\nconst SNAPSHOTS = scratchKey<Map<string, { id: string }>>('snapBackOrDelete.snapshots');\nconst INDEXES = scratchKey<Map<string, number>>('snapBackOrDelete.indexes');\n\n/**\n * Move behavior for a drag that is only meaningful near where it started:\n * release inside `radius` and the node returns to its original pose; release\n * outside it and the node either springs back anyway or is deleted, per\n * `onFreeRelease`. A deletion is recorded as an undoable op with paint order\n * preserved.\n */\nexport function snapBackOrDelete<TPose extends { x: number; y: number }>(args: {\n radius: number;\n onFreeRelease: 'snap-back' | 'delete';\n deleteLabel?: string;\n}): MoveBehavior<TPose>;\n/** As above, for a `TPose` that is not a rect: `origin` tells the behavior how\n * to read and write the pose's origin. */\nexport function snapBackOrDelete<TPose>(args: {\n radius: number;\n onFreeRelease: 'snap-back' | 'delete';\n deleteLabel?: string;\n origin: OriginProjection<TPose>;\n}): MoveBehavior<TPose>;\n/** Snap back to the origin pose, or delete, depending on where the drag is\n * released. */\nexport function snapBackOrDelete<TPose>(args: {\n radius: number;\n onFreeRelease: 'snap-back' | 'delete';\n deleteLabel?: string;\n origin?: OriginProjection<TPose>;\n}): MoveBehavior<TPose> {\n const { radius, onFreeRelease, deleteLabel = 'Delete' } = args;\n const proj: OriginProjection<TPose> =\n args.origin ?? (RECT_ORIGIN_PROJECTION as unknown as OriginProjection<TPose>);\n const r2 = radius * radius;\n\n return {\n onStart(ctx) {\n // Snapshot the dragged objects + their z-indexes at gesture start so\n // delete can undo with paint order intact.\n const snapshots = new Map<string, { id: string }>();\n const indexes = new Map<string, number>();\n const nodes = ctx.adapter.getNodes();\n for (const id of ctx.draggedIds) {\n const obj = ctx.adapter.getNode(id) ?? { id };\n snapshots.set(id, obj);\n indexes.set(id, nodes.findIndex((n) => n.id === id));\n }\n setScratch(ctx.scratch, SNAPSHOTS, snapshots);\n setScratch(ctx.scratch, INDEXES, indexes);\n },\n\n onEnd(ctx) {\n if (ctx.snap) return;\n const id = ctx.draggedIds[0];\n const o0 = proj.getOrigin(ctx.origin.get(id)!);\n const o1 = proj.getOrigin(ctx.current.get(id)!);\n const dx = o1.x - o0.x;\n const dy = o1.y - o0.y;\n const within = dx * dx + dy * dy <= r2;\n if (within) {\n return null;\n }\n if (onFreeRelease === 'delete') {\n const snapshots = getScratch(ctx.scratch, SNAPSHOTS);\n const indexes = getScratch(ctx.scratch, INDEXES);\n const obj = snapshots?.get(id) ?? { id };\n const index = indexes?.get(id) ?? -1;\n const ops: Op[] = [createDeleteOp({ node: obj, label: deleteLabel, index })];\n return ops;\n }\n // `'snap-back'` — abort, same as a release inside the radius. Returning\n // `undefined` would defer to the default translate and leave the node\n // where it was dropped, which is the one thing this policy rules out.\n return null;\n },\n };\n}\n","import type { ModifierState, MoveBehavior } from '../../../gestures/types';\nimport type { Guide } from 'features/guides/types';\nimport type { View } from 'core/viewport/view';\nimport type { OriginProjection } from '../../../gestures/shared/strategies/grid';\nimport { snap } from '../../../gestures/shared/snap';\nimport { guideSnapStrategy } from '../../../gestures/shared/strategies/guides';\n\ntype ModKey = keyof ModifierState;\n\n/** Options for the move-flavored `snapToGuides`. */\nexport interface SnapToGuidesMoveArgs<TPose> {\n /** Stable getter into the live guide list (typically from `useGuides`). */\n getGuides: () => readonly Guide[];\n /** Snap tolerance (screen px when `getView` is set, world units otherwise). */\n tolerance?: number;\n /** Read the active view; required for screen-pixel tolerance. */\n getView?: () => View;\n /** Modifier key that bypasses snapping while held. */\n bypassKey?: ModKey;\n /** Origin projection for non-rect TPose (e.g. Path). */\n origin?: OriginProjection<TPose>;\n}\n\n/**\n * Move behavior that snaps the dragged pose's origin to the nearest world-space\n * guide line within `tolerance`. Closest-guide-per-axis wins; the two axes are\n * considered independently. Pair with `useGuides` and `createGuidesLayer`.\n */\nexport function snapToGuides<TPose extends { x: number; y: number }>(\n args: Omit<SnapToGuidesMoveArgs<TPose>, 'origin'>,\n): MoveBehavior<TPose>;\n/** As above, for a `TPose` that is not a rect: `origin` tells the behavior how\n * to read and write the pose's origin. */\nexport function snapToGuides<TPose>(\n args: SnapToGuidesMoveArgs<TPose> & { origin: OriginProjection<TPose> },\n): MoveBehavior<TPose>;\n/** Snap the dragged pose's origin to the nearest guide line, per axis. */\nexport function snapToGuides<TPose>(\n args: SnapToGuidesMoveArgs<TPose>,\n): MoveBehavior<TPose> {\n const strategy = guideSnapStrategy<TPose>(args.getGuides, {\n tolerance: args.tolerance,\n getView: args.getView,\n origin: args.origin as OriginProjection<TPose>,\n });\n return snap(strategy, { bypassKey: args.bypassKey });\n}\n"]}
1
+ {"version":3,"sources":["../src/interactions/actions/move/behaviors/snapToGrid.ts","../src/interactions/actions/move/behaviors/snapToContainer.ts","../src/interactions/actions/move/behaviors/snapBackOrDelete.ts","../src/interactions/actions/move/behaviors/snapToGuides.ts"],"names":["snap","scratchKey","setScratch","getScratch"],"mappings":";;;;;;;AAQO,SAAS,WAAmD,IAAA,EAG3C;AACtB,EAAA,OAAO,IAAA,CAAK,iBAAwB,IAAA,CAAK,OAAO,GAAG,EAAE,SAAA,EAAW,IAAA,CAAK,SAAA,EAAW,CAAA;AAClF;ACIA,IAAM,KAAA,GAAQ,WAA+B,iBAAiB,CAAA;AAE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AK,EAAA;AAClC,QAAA,MAAM,GAAA,GAAY,CAAC,cAAA,CAAe,EAAE,IAAA,EAAM,KAAK,KAAA,EAAO,WAAA,EAAa,KAAA,EAAO,CAAC,CAAA;AAC3E,QAAA,OAAO,GAAA;AAAA,MACT;AAIA,MAAA,OAAO,IAAA;AAAA,IACT;AAAA,GACF;AACF;;;ACjDO,SAAS,aACd,IAAA,EACqB;AACrB,EAAA,MAAM,QAAA,GAAW,iBAAA,CAAyB,IAAA,CAAK,SAAA,EAAW;AAAA,IACxD,WAAW,IAAA,CAAK,SAAA;AAAA,IAChB,SAAS,IAAA,CAAK,OAAA;AAAA,IACd,QAAQ,IAAA,CAAK;AAAA,GACd,CAAA;AACD,EAAA,OAAO,KAAK,QAAA,EAAU,EAAE,SAAA,EAAW,IAAA,CAAK,WAAW,CAAA;AACrD","file":"move.js","sourcesContent":["import type { ModifierState, MoveBehavior } from '../../../gestures/types';\nimport { snap } from '../../../gestures/shared/snap';\nimport { gridSnapStrategy } from '../../../gestures/shared/strategies/grid';\n\ntype ModKey = keyof ModifierState;\n\n/** Move behavior that snaps the dragged pose's origin to a grid. Hold\n * `bypassKey` to drag freely. */\nexport function snapToGrid<TPose extends { x: number; y: number }>(args: {\n spacing: number;\n bypassKey?: ModKey;\n}): MoveBehavior<TPose> {\n return snap(gridSnapStrategy<TPose>(args.spacing), { bypassKey: args.bypassKey });\n}\n","import { createTransformOp } from 'core/ops/transform';\nimport { createReparentOp } from 'core/ops/reparent';\nimport type { Op } from 'core/ops/types';\nimport type { SnapTarget } from 'core/adapters/types';\nimport type { MoveBehavior, GestureContext } from '../../../gestures/types';\nimport { scratchKey, getScratch, setScratch } from '@weasel-js/routing';\n\ninterface SnapState<TPose> {\n pendingTargetId: string | null;\n pendingTimer: ReturnType<typeof setTimeout> | null;\n committedSnap: SnapTarget<TPose> | null;\n}\n\n// The slot is generic over TPose; we keep the unknown-pose key at module\n// scope and project it through `as` at the read site (each consumer call\n// of `snapToContainer<TPose>` is the only writer of its own SnapState\n// instance, so the cast is safe at runtime).\nconst STATE = scratchKey<SnapState<unknown>>('snapToContainer');\n\nfunction getState<TPose>(ctx: GestureContext<TPose>): SnapState<TPose> {\n let s = getScratch(ctx.scratch, STATE) as SnapState<TPose> | undefined;\n if (!s) {\n s = { pendingTargetId: null, pendingTimer: null, committedSnap: null };\n setScratch(ctx.scratch, STATE, s as SnapState<unknown>);\n }\n return s;\n}\n\nfunction clearTimer<TPose>(s: SnapState<TPose>) {\n if (s.pendingTimer !== null) {\n clearTimeout(s.pendingTimer);\n s.pendingTimer = null;\n }\n s.pendingTargetId = null;\n}\n\n/**\n * Move behavior that drops the dragged node into a container it hovers over\n * for `dwellMs`, reparenting it and taking the pose the container's layout\n * assigns.\n *\n * The dwell is what keeps a drag that merely passes over a container from\n * being captured by it.\n */\nexport function snapToContainer<TPose>(args: {\n dwellMs: number;\n findTarget: (\n draggedId: string,\n worldX: number,\n worldY: number,\n ) => SnapTarget<TPose> | null;\n isInstant?: (target: SnapTarget<TPose>) => boolean;\n moveLabel?: string;\n reparentLabel?: string;\n}): MoveBehavior<TPose> {\n const { dwellMs, findTarget, isInstant, moveLabel = 'Move', reparentLabel = 'Move and reparent' } = args;\n\n return {\n onMove(ctx, _proposed) {\n const s = getState<TPose>(ctx);\n const target = findTarget(ctx.draggedIds[0], ctx.pointer.worldX, ctx.pointer.worldY);\n\n if (s.committedSnap) {\n if (target && target.parentId === s.committedSnap.parentId) {\n return { pose: s.committedSnap.slotPose, snap: s.committedSnap };\n }\n s.committedSnap = null;\n }\n\n if (!target) {\n clearTimer(s);\n return;\n }\n\n if (isInstant?.(target)) {\n clearTimer(s);\n s.committedSnap = target;\n return { pose: target.slotPose, snap: target };\n }\n\n if (s.pendingTargetId === target.parentId) {\n return;\n }\n clearTimer(s);\n s.pendingTargetId = target.parentId;\n s.pendingTimer = setTimeout(() => {\n s.committedSnap = target;\n s.pendingTimer = null;\n }, dwellMs);\n return;\n },\n\n onEnd(ctx) {\n const s = getState<TPose>(ctx);\n clearTimer(s);\n const snap = s.committedSnap ?? ctx.snap;\n if (!snap) return;\n const draggedId = ctx.draggedIds[0];\n const oldParent = ctx.adapter.getParent?.(draggedId) ?? null;\n const fromPose = ctx.origin.get(draggedId)!;\n const ops: Op[] = [\n createTransformOp<TPose>({\n id: draggedId,\n from: fromPose,\n to: snap.slotPose,\n label: moveLabel,\n }),\n ];\n if (oldParent !== snap.parentId) {\n ops.push(createReparentOp({\n id: draggedId,\n fromParentId: oldParent,\n toParentId: snap.parentId,\n label: reparentLabel,\n }));\n }\n return ops;\n },\n };\n}\n","import { createDeleteOp } from 'core/ops/delete';\nimport type { Op } from 'core/ops/types';\nimport type { MoveBehavior } from '../../../gestures/types';\nimport {\n RECT_ORIGIN_PROJECTION,\n type OriginProjection,\n} from '../../../gestures/shared/strategies';\nimport { scratchKey, getScratch, setScratch } from '@weasel-js/routing';\n\nconst SNAPSHOTS = scratchKey<Map<string, { id: string }>>('snapBackOrDelete.snapshots');\nconst INDEXES = scratchKey<Map<string, number>>('snapBackOrDelete.indexes');\n\n/**\n * Move behavior for a drag that is only meaningful near where it started:\n * release inside `radius` and the node returns to its original pose; release\n * outside it and the node either springs back anyway or is deleted, per\n * `onFreeRelease`. A deletion is recorded as an undoable op with paint order\n * preserved.\n */\nexport function snapBackOrDelete<TPose extends { x: number; y: number }>(args: {\n radius: number;\n onFreeRelease: 'snap-back' | 'delete';\n deleteLabel?: string;\n}): MoveBehavior<TPose>;\n/** As above, for a `TPose` that is not a rect: `origin` tells the behavior how\n * to read and write the pose's origin. */\nexport function snapBackOrDelete<TPose>(args: {\n radius: number;\n onFreeRelease: 'snap-back' | 'delete';\n deleteLabel?: string;\n origin: OriginProjection<TPose>;\n}): MoveBehavior<TPose>;\n/** Snap back to the origin pose, or delete, depending on where the drag is\n * released. */\nexport function snapBackOrDelete<TPose>(args: {\n radius: number;\n onFreeRelease: 'snap-back' | 'delete';\n deleteLabel?: string;\n origin?: OriginProjection<TPose>;\n}): MoveBehavior<TPose> {\n const { radius, onFreeRelease, deleteLabel = 'Delete' } = args;\n const proj: OriginProjection<TPose> =\n args.origin ?? (RECT_ORIGIN_PROJECTION as unknown as OriginProjection<TPose>);\n const r2 = radius * radius;\n\n return {\n onStart(ctx) {\n // Snapshot the dragged objects + their z-indexes at gesture start so\n // delete can undo with paint order intact.\n const snapshots = new Map<string, { id: string }>();\n const indexes = new Map<string, number>();\n const nodes = ctx.adapter.getNodes();\n for (const id of ctx.draggedIds) {\n const obj = ctx.adapter.getNode(id) ?? { id };\n snapshots.set(id, obj);\n indexes.set(id, nodes.findIndex((n) => n.id === id));\n }\n setScratch(ctx.scratch, SNAPSHOTS, snapshots);\n setScratch(ctx.scratch, INDEXES, indexes);\n },\n\n onEnd(ctx) {\n if (ctx.snap) return;\n const id = ctx.draggedIds[0];\n const o0 = proj.getOrigin(ctx.origin.get(id)!);\n const o1 = proj.getOrigin(ctx.current.get(id)!);\n const dx = o1.x - o0.x;\n const dy = o1.y - o0.y;\n const within = dx * dx + dy * dy <= r2;\n if (within) {\n return null;\n }\n if (onFreeRelease === 'delete') {\n const snapshots = getScratch(ctx.scratch, SNAPSHOTS);\n const indexes = getScratch(ctx.scratch, INDEXES);\n const obj = snapshots?.get(id) ?? { id };\n const index = indexes?.get(id) ?? -1;\n const ops: Op[] = [createDeleteOp({ node: obj, label: deleteLabel, index })];\n return ops;\n }\n // `'snap-back'` — abort, same as a release inside the radius. Returning\n // `undefined` would defer to the default translate and leave the node\n // where it was dropped, which is the one thing this policy rules out.\n return null;\n },\n };\n}\n","import type { ModifierState, MoveBehavior } from '../../../gestures/types';\nimport type { Guide } from 'features/guides/types';\nimport type { View } from 'core/viewport/view';\nimport type { OriginProjection } from '../../../gestures/shared/strategies/grid';\nimport { snap } from '../../../gestures/shared/snap';\nimport { guideSnapStrategy } from '../../../gestures/shared/strategies/guides';\n\ntype ModKey = keyof ModifierState;\n\n/** Options for the move-flavored `snapToGuides`. */\nexport interface SnapToGuidesMoveArgs<TPose> {\n /** Stable getter into the live guide list (typically from `useGuides`). */\n getGuides: () => readonly Guide[];\n /** Snap tolerance (screen px when `getView` is set, world units otherwise). */\n tolerance?: number;\n /** Read the active view; required for screen-pixel tolerance. */\n getView?: () => View;\n /** Modifier key that bypasses snapping while held. */\n bypassKey?: ModKey;\n /** Origin projection for non-rect TPose (e.g. Path). */\n origin?: OriginProjection<TPose>;\n}\n\n/**\n * Move behavior that snaps the dragged pose's origin to the nearest world-space\n * guide line within `tolerance`. Closest-guide-per-axis wins; the two axes are\n * considered independently. Pair with `useGuides` and `createGuidesLayer`.\n */\nexport function snapToGuides<TPose extends { x: number; y: number }>(\n args: Omit<SnapToGuidesMoveArgs<TPose>, 'origin'>,\n): MoveBehavior<TPose>;\n/** As above, for a `TPose` that is not a rect: `origin` tells the behavior how\n * to read and write the pose's origin. */\nexport function snapToGuides<TPose>(\n args: SnapToGuidesMoveArgs<TPose> & { origin: OriginProjection<TPose> },\n): MoveBehavior<TPose>;\n/** Snap the dragged pose's origin to the nearest guide line, per axis. */\nexport function snapToGuides<TPose>(\n args: SnapToGuidesMoveArgs<TPose>,\n): MoveBehavior<TPose> {\n const strategy = guideSnapStrategy<TPose>(args.getGuides, {\n tolerance: args.tolerance,\n getView: args.getView,\n origin: args.origin as OriginProjection<TPose>,\n });\n return snap(strategy, { bypassKey: args.bypassKey });\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { Op } from '@weasel-js/history';
2
- import { I as InsertBehavior } from './types-DMyo7dnM.js';
2
+ import { I as InsertBehavior } from './types-BHGdrOcu.js';
3
3
  import { Bounds } from '@weasel-js/routing';
4
4
 
5
5
  /** Option surface for the `insert` action.
@@ -1,6 +1,5 @@
1
1
  import { ResizeAnchor, Bounds, DebugSink, ModifierState } from '@weasel-js/routing';
2
- import { B as BoundsConstraint, P as PointSnapBehavior, a as PointSnapFrame } from './types-DMyo7dnM.js';
3
- import { P as PoseDescriptor, a as Path } from './poseDescriptor-CGOgIgf8.js';
2
+ import { B as BoundsConstraint, P as PointSnapBehavior, a as PointSnapFrame } from './types-BHGdrOcu.js';
4
3
 
5
4
  /** Corner resize-handle: world-space center plus the anchor that pins the opposite corner during resize. */
6
5
  interface CornerHandle {
@@ -132,27 +131,4 @@ declare function pointSnapToGrid<TPose extends Bounds>(args: {
132
131
  bypassKey?: keyof ModifierState;
133
132
  }): PointSnapBehavior<TPose>;
134
133
 
135
- /** True for Path-shaped poses (`{kind: 'polygon' | 'rect'}`). Useful for
136
- * callers that need to fork between `pathPoseDescriptor` and
137
- * `RECT_POSE_DESCRIPTOR` without forcing the consumer to wire
138
- * `poseDescriptor` explicitly. */
139
- declare function isPathLike(p: unknown): p is Path;
140
- /** True for a pose with numeric top-level `x`/`y`/`width`/`height` — the only
141
- * shape the rect descriptor and the kit's built-in painters can read. */
142
- declare function isRectPose(p: unknown): p is {
143
- x: number;
144
- y: number;
145
- width: number;
146
- height: number;
147
- rotation?: number;
148
- };
149
- /** Per-call dispatch: if the pose looks like a Path, route to
150
- * `pathPoseDescriptor`; otherwise treat as a plain rect pose. Avoids forcing
151
- * demos with Path TPose to wire `poseDescriptor={pathPoseDescriptor}`
152
- * explicitly. `getRotation` surfaces a `pose.rotation` field on non-Path poses
153
- * so demos using rect-with-rotation shapes (e.g. `RotatedPose`) don't have to
154
- * wire `poseDescriptor={ROTATED_POSE_DESCRIPTOR}` just to get rotated
155
- * selection chrome and rotation-aware corner hit-tests. */
156
- declare const AUTO_POSE_DESCRIPTOR: PoseDescriptor<unknown>;
157
-
158
- export { AUTO_POSE_DESCRIPTOR as A, CORNER_ANCHORS as C, type UseResizeOptions as U, type CornerAnchor as a, type CornerHandle as b, cornerPoint as c, cornerResizeHandles as d, isRectPose as e, fixedCornerOf as f, type CornerEdge as g, hitCornerHandle as h, isPathLike as i, pointSnapToGrid as p };
134
+ export { CORNER_ANCHORS as C, type UseResizeOptions as U, type CornerAnchor as a, type CornerHandle as b, cornerPoint as c, cornerResizeHandles as d, type CornerEdge as e, fixedCornerOf as f, hitCornerHandle as h, pointSnapToGrid as p };
@@ -131,4 +131,4 @@ declare function visualBoundsViaDescriptor<TPose>(pose: TPose, geometry: PoseDes
131
131
  * copy of the pose's own bounds when the descriptor has none. */
132
132
  declare function translatePoseViaDescriptor<TPose>(pose: TPose, dx: number, dy: number, geometry: PoseDescriptor<TPose>): TPose;
133
133
 
134
- export { type PoseDescriptor as P, RECT_POSE_DESCRIPTOR as R, type Path as a, ROTATED_POSE_DESCRIPTOR as b, type PolygonPath as c, type RotatedPose as d, type PathFillRule as e, type RectPath as f, poseDescriptorForNode as p, translatePoseViaDescriptor as t, visualBoundsViaDescriptor as v };
134
+ export { type PoseDescriptor as P, RECT_POSE_DESCRIPTOR as R, type Path as a, ROTATED_POSE_DESCRIPTOR as b, type PolygonPath as c, type RotatedPose as d, type RectPath as e, type PathFillRule as f, poseDescriptorForNode as p, translatePoseViaDescriptor as t, visualBoundsViaDescriptor as v };
@@ -1,17 +1,16 @@
1
- import { M as Mesh } from './depSchema-nMqj_qTM.js';
2
- export { D as DrawCommand, E as Effect, G as GroupDrawCommand, I as IDENTITY_COLOR_MATRIX, a as ImageDrawCommand, b as ImageMinification, c as Mat3, P as PathDrawCommand, R as RenderTarget, S as SPRITE_STRIDE, d as ShaderCompileError, e as ShaderDrawCommand, f as ShaderProgramHandle, g as ShaderUniform, h as SolidPaint, i as SpriteSheet, j as SpritesDrawCommand, k as StrokeOptions, T as TextDrawCommand, V as ViewLike, W as WeaselRenderer, l as WeaselRendererOptions, m as blur, n as buildGradientRamp, o as frameRect, p as mat3, r as registerEffect, q as registerProgram, t as tessellateStroke, v as viewToMat3, s as vignette } from './depSchema-nMqj_qTM.js';
3
- import { a as Path } from './poseDescriptor-CGOgIgf8.js';
1
+ import { M as Mesh } from './depSchema-FKQBEfg7.js';
2
+ export { C as CullRect, D as DrawCommand, E as Effect, G as GlMat3, a as GroupDrawCommand, I as IDENTITY_COLOR_MATRIX, b as ImageDrawCommand, c as ImageMinification, P as PathDrawCommand, R as RenderTarget, S as SPRITE_STRIDE, d as ShaderCompileError, e as ShaderDrawCommand, f as ShaderProgramHandle, g as ShaderUniform, h as SolidPaint, i as SpriteSheet, j as SpritesDrawCommand, k as StrokeOptions, T as TextDrawCommand, W as WeaselRenderer, l as WeaselRendererOptions, m as blur, n as buildGradientRamp, o as cullDrawCommands, p as frameRect, q as mat3, r as registerEffect, s as registerProgram, t as tessellateStroke, v as viewToMat3, u as vignette } from './depSchema-FKQBEfg7.js';
3
+ import { a as Path } from './poseDescriptor-PgfVKfa0.js';
4
4
  export { canQueryLocalFonts, enableLocalFontOutlines, hasFontOutlines, isCanvasFont, listFontOutlines, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, subscribeGlyphReady, unregisterCanvasFont, unregisterFontOutlines } from '@weasel-js/font';
5
5
  import { TextureHandle } from '@weasel-js/paint';
6
6
  export { TextureHandle } from '@weasel-js/paint';
7
+ export { View as ViewLike } from '@weasel-js/routing';
7
8
  import '@weasel-js/text';
9
+ import '@weasel-js/geom';
8
10
  import '@weasel-js/history';
9
- import '@weasel-js/routing';
10
- import './types-DtjCJA5r.js';
11
- import 'react';
11
+ import './types-BdaK9PcP.js';
12
12
  import '@weasel-js/routing/react';
13
- import './types-DMyo7dnM.js';
14
- import '@weasel-js/geom';
13
+ import './types-BHGdrOcu.js';
15
14
 
16
15
  /**
17
16
  * registerTexture — accepts an image source, assigns an opaque id, stores in
package/dist/renderer.js CHANGED
@@ -1,7 +1,9 @@
1
- export { EFFECT_KIT_UNIFORMS, EFFECT_VERT_SRC, IDENTITY_COLOR_MATRIX, OUTLINE_MIN_SCREEN_PX, SPRITE_STRIDE, ShaderCompileError, WeaselRenderer, blur, buildGradientRamp, canQueryLocalFonts, enableLocalFontOutlines, frameRect, hasFontOutlines, isCanvasFont, listFontOutlines, mat3, outlineStatus, registerCanvasFont, registerEffect, registerFont, registerFontOutlines, registerProgram, subscribeGlyphReady, tessellate, tessellateStroke, unregisterCanvasFont, unregisterFontOutlines, viewToMat3, vignette } from './chunk-MG7OXCAI.js';
2
- import './chunk-BDWAA634.js';
3
- import './chunk-MQI4PIX3.js';
4
- import './chunk-UCPV7JXC.js';
1
+ export { EFFECT_KIT_UNIFORMS, EFFECT_VERT_SRC, IDENTITY_COLOR_MATRIX, OUTLINE_MIN_SCREEN_PX, SPRITE_STRIDE, ShaderCompileError, WeaselRenderer, blur, buildGradientRamp, canQueryLocalFonts, cullDrawCommands, enableLocalFontOutlines, frameRect, hasFontOutlines, isCanvasFont, listFontOutlines, mat3, outlineStatus, registerCanvasFont, registerEffect, registerFont, registerFontOutlines, registerProgram, subscribeGlyphReady, tessellate, tessellateStroke, unregisterCanvasFont, unregisterFontOutlines, viewToMat3, vignette } from './chunk-QEZL53V6.js';
2
+ import './chunk-PNNZSYRD.js';
3
+ import './chunk-44EWMJV2.js';
4
+ import './chunk-H6N2JSZ3.js';
5
+ import './chunk-HPFJUUTF.js';
6
+ import './chunk-L5YNZYEG.js';
5
7
  import './chunk-T3UQ3F6R.js';
6
8
  import './chunk-D4AAWR64.js';
7
9
  import './chunk-DOBSZOPR.js';