@weasel-js/core 1.5.2 → 1.6.1
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/CHANGELOG.md +159 -0
- package/dist/{autoPoseDescriptor-Dr6CwNZK.d.ts → autoPoseDescriptor-_XOyF7t4.d.ts} +2 -1
- package/dist/{depSchema-FKQBEfg7.d.ts → builtins-HWyuLzE-.d.ts} +158 -64
- package/dist/{chunk-QEZL53V6.js → chunk-MZAIDI6D.js} +2019 -1092
- package/dist/chunk-MZAIDI6D.js.map +1 -0
- package/dist/{chunk-T3UQ3F6R.js → chunk-RMR4QMM6.js} +45 -11
- package/dist/chunk-RMR4QMM6.js.map +1 -0
- package/dist/clipboard.d.ts +2 -1
- package/dist/clipboard.js +1 -1
- package/dist/clone.d.ts +3 -2
- package/dist/{grid-CuxXjaQV.d.ts → grid-BXdz8GF2.d.ts} +28 -28
- package/dist/index.d.ts +607 -344
- package/dist/index.js +2 -2
- package/dist/insert.d.ts +4 -3
- package/dist/{math-CeGmGPy8.d.ts → math-MCQcf_gc.d.ts} +114 -113
- package/dist/math.d.ts +4 -3
- package/dist/move.d.ts +5 -4
- package/dist/{options-BPcmwYk7.d.ts → options-CzjxFoYZ.d.ts} +1 -1
- package/dist/path-JEV2c5If.d.ts +48 -0
- package/dist/{pointSnapToGrid-CgcK2R_I.d.ts → pointSnapToGrid-7mCcm6qG.d.ts} +1 -1
- package/dist/{poseDescriptor-PgfVKfa0.d.ts → poseDescriptor-rZa9W5hJ.d.ts} +1 -48
- package/dist/renderer.d.ts +7 -5
- package/dist/renderer.js +2 -2
- package/dist/resize.d.ts +6 -5
- package/dist/{types-BdaK9PcP.d.ts → types-CxC8P6W0.d.ts} +27 -1
- package/dist/{types-BHGdrOcu.d.ts → types-D_74YlWs.d.ts} +1 -1
- package/package.json +10 -10
- package/dist/chunk-QEZL53V6.js.map +0 -1
- package/dist/chunk-T3UQ3F6R.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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';
|
|
1
|
+
export { ACTION_GLYPHS, ALWAYS, ANCHOR_HIT_BASE_PX, ActionDisabledReason, ActionsProvider, ActionsProviderIfRoot, ActionsScope, ActiveToolContextProvider, ActiveToolContextProviderIfRoot, AlignBottomIcon, AlignCenterXIcon, AlignCenterYIcon, AlignLeftIcon, AlignRightIcon, AlignTopIcon, ArrowIcon, BUILTIN_MARKERS, BUNDLE_TOOLS, BringForwardIcon, BringToFrontIcon, COARSE_TARGET_SCALE, CROSSHAIR_HALO, CURVE_REPS, CanvasView, ColorOverrideRegistry, CopyIcon, CropIcon, CursorCoordsHud, CutIcon, 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, DeleteIcon, DepRegistryProvider, DepRegistryProviderIfRoot, DeviceProfileProvider, DistributeHorizontalIcon, DistributeVerticalIcon, DivideIcon, DuplicateIcon, EASINGS, EllipseIcon, ExcludeIcon, EyedropperIcon, FALLBACK_FIT_VIEW, FlipXIcon, FlipYIcon, GHOST_STROKE, GroupIcon, 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, MINIMAP_CENTER, MINIMAP_PAN, MIXED, MOVE_ANCHORS, MinimapCanvas, NEVER, PAINTED_CURSOR_LAYER_ID, PATH_ANCHOR_CHROME_ID, PasteIcon, PenIcon, PencilIcon, PickHud, PointerProviderIfRoot, PolygonIcon, RECT_POSE_COMPOSITION, RIGID_POSE_COMPOSITION, ROTATION_HANDLE_BASE_PX, RectIcon, RedoIcon, SCRIPT_METRICS, SPRING_PRESETS, SPRITE_STRIDE, STROKE_DASH_RATIOS, SceneCanvas, SceneViewCanvas, SelectIcon, SelectionContextProvider, SelectionContextProviderIfRoot, SendBackwardIcon, SendToBackIcon, StarIcon, SubtractIcon, TOOL_PREF_KINDS, TextIcon, UNION_OF_CHILDREN, UndoIcon, UngroupIcon, UnionIcon, UnknownIcon, VERSION, VIEW_ANIMATION_KEY, WHEEL_ZOOM_STEP, WeaselProvider, ZOOM_FLOOR, _resetMarkersForTests, _resetPaintKindsForTests, actionBindings, actionIs, actionItems, 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, buildDepsFromRequires, buildRuleCtx, buildSceneViewCommands, cachedLayoutRuns, canBringForward, canHover, canQueryLocalFonts2 as canQueryLocalFonts, canSendBackward, capabilityAll, capabilityIn, capabilityIs, capabilityNot, caretIndexAt, cellAt, centerRootOn, charOffsetToDomPosition, circlePath, clampView, clearSelectionAction, clientToCanvas, clipboardCopyAction, clipboardCutAction, clipboardPasteAction, cloneAction, coarsePointer, composeAffordanceLayer, composePath, composeRectPose, composeRigidPose, composeSelectionPose, composeWorldPose, computeFitView, computeFitViewport, computeIndicatorCommand, computeWheelAction, cond, constrainTo45, containedThenNearest, contrastLineColor, cornerWeights, countPathAnchors, createCellHighlightLayer, createChildrenLayer, createCornerResizeAffordance, createDebugOverlayLayer, createDebugSink, createDispatcher, createGridLayer, createGuidesLayer, createHistory, createKeyState, createLinkedCursorContribution, createMarkdownRenderer, createMinimapContribution, 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, crosshairRects, cubicBezierEasing, cullDrawCommands, cursorFor, cycleFill, cycleVertexColors, dashForStrokeStyle, decomposePath, decomposeRectPose, decomposeRigidPose, defaultCommitAdapter, defaultDrawOne, defaultLabelTextRenderer, defaultNodeProperties, defaultNodeRouting, defaultVisibilityRules, defineTool, defineViewportTool, definesFrame, 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, hslToSrgb, imageStatus, inferredNodeProperties, inferredNodeRouting, insertAction, insertPreviewExtent, interpolateSrgb, interpolateView, isBuiltinToolPref, isCanvasFont2 as isCanvasFont, isEditableTarget, isGradientFill, isLayerPainted, isLayerVisible, isMeshGradientFill, isPatternSpec, isTensorPatch, isValidPatch, isVectorImageSrc, keySpecShortcut, lassoSelectAction, layoutMarkdown, layoutRuns, layoutTextPose, lerpColorArray, lerpOklab, lerpOklch, linear, linearSrgbToOklab, linearToSrgb, 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, minimapCenterAction, minimapPanAction, modeIn, modeIs, modeNot, modifierHeld, momentum, moveAction, multiActive, nearest, nearestWithin, nestedHitTester, never, nodeHasFlag, none, normalizeHex, normalizeView, normalizeZoom, not, nurbs, oklabToLinearSrgb, 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, srgbToHsl, srgbToLinear, srgbU8ToOklab, staggerVertexColors, startThresholdDrag, strokeDashStyleOf, strokeInsets, strokeOf, strokeWith, styleAtRange, subscribeGlyphReady2 as subscribeGlyphReady, subscribeImageReady, textCommand, textCommandFromPose, textCommandFromRuns, textLineBoxes, textPoseLayoutInput, tileGrid, tiledProject, toHex8, toRuns, transformRunTexts, 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, useOngoingAction, 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-MZAIDI6D.js';
|
|
2
2
|
export { DEFAULT_ALPHA_DECAY, DEFAULT_ALPHA_MIN, DEFAULT_VELOCITY_DECAY, aabbCenter, createSimulation, pointAlongPath, pointInRotatedRect, rectCorners, rotatePoint, rotatedRectCorners } from './chunk-PNNZSYRD.js';
|
|
3
3
|
export { createReparentOp, createTransformOp, snap } from './chunk-44EWMJV2.js';
|
|
4
4
|
export { CORNER_ANCHORS, cornerPoint, cornerResizeHandles, hitCornerHandle, pointSnapToGrid } from './chunk-H6N2JSZ3.js';
|
|
5
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
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';
|
|
7
|
-
export { PointerContextProvider, WEASEL_CLIPBOARD_MIME, WEASEL_CLIPBOARD_MIME_WEB, applyOpsTo, buildWeaselClipboardText, dispatchApplyBatch, dlog, dwarn, embedWeaselMetadataInSvg, extractWeaselClipboardFromSvg, isDebugEnabled, parseWeaselClipboardText, sniffWeaselClipboardText, useClipboardOps, usePointerContext } from './chunk-
|
|
7
|
+
export { PointerContextProvider, WEASEL_CLIPBOARD_MIME, WEASEL_CLIPBOARD_MIME_WEB, applyOpsTo, buildWeaselClipboardText, createPointerStore, dispatchApplyBatch, dlog, dwarn, embedWeaselMetadataInSvg, extractWeaselClipboardFromSvg, isDebugEnabled, parseWeaselClipboardText, sniffWeaselClipboardText, useClipboardOps, usePointerContext, usePointerPosition } from './chunk-RMR4QMM6.js';
|
|
8
8
|
export { cloneByAltDrag } from './chunk-D4AAWR64.js';
|
|
9
9
|
export { createSetSelectionOp } from './chunk-DOBSZOPR.js';
|
|
10
10
|
export { createDeleteOp, createInsertOp, rebuildOp, registerOpFactory, registeredOpNames } from './chunk-4RJP2N2L.js';
|
package/dist/insert.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export { U as UseInsertOptions } from './options-
|
|
2
|
-
import { I as InsertBehavior } from './types-
|
|
1
|
+
export { U as UseInsertOptions } from './options-CzjxFoYZ.js';
|
|
2
|
+
import { I as InsertBehavior } from './types-D_74YlWs.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-
|
|
6
|
+
import './types-CxC8P6W0.js';
|
|
7
|
+
import './path-JEV2c5If.js';
|
|
7
8
|
|
|
8
9
|
type ModKey$1 = keyof ModifierState;
|
|
9
10
|
/** Insert behavior that rounds the insertion point to a grid, so a shape
|
|
@@ -1,7 +1,119 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as PolygonPath, b as PathFillRule, R as RectPath, P as Path } from './path-JEV2c5If.js';
|
|
2
2
|
import { Point2, Bounds } from '@weasel-js/routing';
|
|
3
|
+
import { b as RotatedPose } from './poseDescriptor-rZa9W5hJ.js';
|
|
3
4
|
import '@weasel-js/geom';
|
|
4
|
-
import './autoPoseDescriptor-
|
|
5
|
+
import './autoPoseDescriptor-_XOyF7t4.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Fluent builder for `PolygonPath`. Hides the `Uint8Array` / `Float32Array`
|
|
9
|
+
* encoding behind move/line/curve/close calls and a final `build()`. Use
|
|
10
|
+
* this to construct paths in tests and demos; production callers that need
|
|
11
|
+
* to mutate large paths in place should reach for the raw arrays directly.
|
|
12
|
+
*
|
|
13
|
+
* Numeric capacity grows by doubling — typical for amortized O(1) push.
|
|
14
|
+
*
|
|
15
|
+
* Also exposes `rectPath` / `polygonFromPoints` shortcuts for the common
|
|
16
|
+
* cases. `rectPath` returns the lighter `RectPath` subtype, not a polygon.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** Fluent builder for `PolygonPath`; hides the `Uint8Array`/`Float32Array` encoding behind move/line/curve/close calls. */
|
|
20
|
+
declare class PathBuilder {
|
|
21
|
+
private cmds;
|
|
22
|
+
private xs;
|
|
23
|
+
private fillRule;
|
|
24
|
+
/** Seed a builder with an existing `PolygonPath`. Useful for extending
|
|
25
|
+
* an in-flight path with another segment (e.g. appending a cubic to
|
|
26
|
+
* the end of a curve in response to a user action) without hand-
|
|
27
|
+
* reaching into the `commands` / `coords` typed arrays.
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
30
|
+
* const next = PathBuilder.fromPath(current).curveTo(...).build();
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
static fromPath(path: PolygonPath): PathBuilder;
|
|
34
|
+
setFillRule(rule: PathFillRule): this;
|
|
35
|
+
moveTo(x: number, y: number): this;
|
|
36
|
+
lineTo(x: number, y: number): this;
|
|
37
|
+
/** Cubic bezier to (x, y) with control points (x1, y1) and (x2, y2). */
|
|
38
|
+
curveTo(x1: number, y1: number, x2: number, y2: number, x: number, y: number): this;
|
|
39
|
+
/** Quadratic bezier to (x, y) with control point (x1, y1). */
|
|
40
|
+
quadTo(x1: number, y1: number, x: number, y: number): this;
|
|
41
|
+
close(): this;
|
|
42
|
+
build(): PolygonPath;
|
|
43
|
+
}
|
|
44
|
+
/** Construct a `RectPath` (the fast-path subtype). */
|
|
45
|
+
declare function rectPath(x: number, y: number, width: number, height: number): RectPath;
|
|
46
|
+
/** Build an open polyline from a flat list of points — the same geometry as
|
|
47
|
+
* {@link polygonFromPoints} without the closing edge. A freehand stroke and a
|
|
48
|
+
* measurement line want this; a region wants the closed one. */
|
|
49
|
+
declare function polylineFromPoints(points: readonly {
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
}[]): PolygonPath | RectPath;
|
|
53
|
+
/** Build a closed polygon from a flat list of points. */
|
|
54
|
+
declare function polygonFromPoints(points: readonly {
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
}[], opts?: {
|
|
58
|
+
fillRule?: PathFillRule;
|
|
59
|
+
}): PolygonPath;
|
|
60
|
+
/** Closed ellipse inscribed in `bounds`, as a 4-cubic-Bezier `PolygonPath`.
|
|
61
|
+
* Matches the geometry `useEllipseTool`'s overlay paints. */
|
|
62
|
+
declare function ellipsePath(bounds: {
|
|
63
|
+
x: number;
|
|
64
|
+
y: number;
|
|
65
|
+
width: number;
|
|
66
|
+
height: number;
|
|
67
|
+
}): PolygonPath;
|
|
68
|
+
/** Closed regular n-gon centered at `center`, circumscribed by `radius`.
|
|
69
|
+
* `rotation` is in radians; default 0 puts the first vertex on the +x axis. */
|
|
70
|
+
declare function regularPolygonPath(center: {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
}, radius: number, sides: number, rotation?: number): PolygonPath;
|
|
74
|
+
/** Closed n-pointed star centered at `center`, alternating `outerRadius` and
|
|
75
|
+
* `innerRadius` (default `outerRadius / 2`). `rotation` is in radians. */
|
|
76
|
+
declare function starPath(center: {
|
|
77
|
+
x: number;
|
|
78
|
+
y: number;
|
|
79
|
+
}, outerRadius: number, points?: number, innerRadius?: number, rotation?: number): PolygonPath;
|
|
80
|
+
/** Open 2-vertex polyline from `a` to `b` — strokeable, not fillable. */
|
|
81
|
+
declare function linePath(a: {
|
|
82
|
+
x: number;
|
|
83
|
+
y: number;
|
|
84
|
+
}, b: {
|
|
85
|
+
x: number;
|
|
86
|
+
y: number;
|
|
87
|
+
}): PolygonPath;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* A station along a path: where it is at a fraction of its length, and which
|
|
91
|
+
* way it is heading there.
|
|
92
|
+
*
|
|
93
|
+
* For anything positioned *along* geometry rather than beside it — a label on a
|
|
94
|
+
* routed edge, a tick on a curve, a badge near an arrowhead. Curves are
|
|
95
|
+
* flattened first, so the fraction is arc length along the drawn shape rather
|
|
96
|
+
* than a curve parameter, which is what makes 0.5 look like the middle.
|
|
97
|
+
*/
|
|
98
|
+
|
|
99
|
+
interface PathStation {
|
|
100
|
+
point: Point2;
|
|
101
|
+
/** Unit vector along the path at `point`, pointing toward the end. */
|
|
102
|
+
tangent: Point2;
|
|
103
|
+
}
|
|
104
|
+
interface PointAlongPathOptions {
|
|
105
|
+
/** Curve flattening tolerance, in world units. Default 0.5. */
|
|
106
|
+
flattenTolerance?: number;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Where `path` is at `t` of its total length, and its heading there.
|
|
110
|
+
*
|
|
111
|
+
* `t` is clamped to 0..1. Subpaths are measured in order and treated as one
|
|
112
|
+
* run, the way a browser measures a whole `<path>`. Returns `null` for a path
|
|
113
|
+
* with no points at all; a path of zero length answers at its single point,
|
|
114
|
+
* heading along +X.
|
|
115
|
+
*/
|
|
116
|
+
declare function pointAlongPath(path: Path, t: number, opts?: PointAlongPathOptions): PathStation | null;
|
|
5
117
|
|
|
6
118
|
/**
|
|
7
119
|
* Minimal node interface for the simulation primitive. Matches d3-force's
|
|
@@ -127,117 +239,6 @@ declare const DEFAULT_VELOCITY_DECAY = 0.4;
|
|
|
127
239
|
|
|
128
240
|
declare function createSimulation<TNode extends SimulationNode>(opts: SimulationOptions<TNode>): SimulationCore<TNode>;
|
|
129
241
|
|
|
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
242
|
/** AABB center of an unrotated rect — the canonical rotation pivot. */
|
|
242
243
|
declare function aabbCenter(bounds: Bounds): {
|
|
243
244
|
x: number;
|
package/dist/math.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { P as Path, b as PathFillRule, a as PolygonPath, R as RectPath } from './path-JEV2c5If.js';
|
|
2
2
|
export { Point2 as Vec2 } from '@weasel-js/routing';
|
|
3
|
-
export { P as
|
|
3
|
+
export { P as PoseDescriptor, t as translatePoseViaDescriptor } from './poseDescriptor-rZa9W5hJ.js';
|
|
4
|
+
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-MCQcf_gc.js';
|
|
4
5
|
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-
|
|
6
|
+
export { A as AUTO_POSE_DESCRIPTOR } from './autoPoseDescriptor-_XOyF7t4.js';
|
package/dist/move.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { O as OriginProjection } from './grid-
|
|
2
|
-
export { U as UseMoveOptions } from './grid-
|
|
3
|
-
import { M as MoveBehavior } from './types-
|
|
1
|
+
import { O as OriginProjection } from './grid-BXdz8GF2.js';
|
|
2
|
+
export { U as UseMoveOptions } from './grid-BXdz8GF2.js';
|
|
3
|
+
import { M as MoveBehavior } from './types-D_74YlWs.js';
|
|
4
4
|
import { ModifierState, View } from '@weasel-js/routing';
|
|
5
|
-
import { S as SnapTarget } from './types-
|
|
5
|
+
import { S as SnapTarget } from './types-CxC8P6W0.js';
|
|
6
6
|
import { G as Guide } from './types-D2tTKEU0.js';
|
|
7
7
|
import '@weasel-js/history';
|
|
8
|
+
import './path-JEV2c5If.js';
|
|
8
9
|
|
|
9
10
|
type ModKey$1 = keyof ModifierState;
|
|
10
11
|
/** Move behavior that snaps the dragged pose's origin to a grid. Hold
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path data model. Vector-graphics primitive used kit-wide as the canonical
|
|
3
|
+
* shape (replacing per-shape ad-hoc poses). SVG-style command stream so we
|
|
4
|
+
* cover lines, polygons, beziers, and multi-contour shapes (think the inner
|
|
5
|
+
* hole of an "O") under one type.
|
|
6
|
+
*
|
|
7
|
+
* Storage: command codes in a `Uint8Array`, parameters in a `Float32Array`.
|
|
8
|
+
* Each command consumes a fixed number of float coords from the parameter
|
|
9
|
+
* array; the parser walks both arrays in lockstep. This keeps interaction
|
|
10
|
+
* hot loops monomorphic and keeps GC pressure low under heavy edits.
|
|
11
|
+
*
|
|
12
|
+
* Two path subtypes are distinguished at the type level so common-case
|
|
13
|
+
* machinery (selection AABBs, area-select intersection, hit-testing rect
|
|
14
|
+
* silhouettes) can short-circuit on `RectPath` without paying the polygon
|
|
15
|
+
* kernel cost. Polymorphic kernels accept either via the `Path` union and
|
|
16
|
+
* dispatch on `kind`.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** Fill rule used by polygon path hit-testing and `ctx.fill()`. */
|
|
20
|
+
type PathFillRule = 'nonzero' | 'evenodd';
|
|
21
|
+
/**
|
|
22
|
+
* Polygon path with arbitrary contours and optional bezier segments.
|
|
23
|
+
* Multi-contour: each `M` opens a new subpath; `Z` closes the current one.
|
|
24
|
+
* Open subpaths (no `Z`) render as polylines and don't contribute to fills.
|
|
25
|
+
*/
|
|
26
|
+
interface PolygonPath {
|
|
27
|
+
kind: 'polygon';
|
|
28
|
+
commands: Uint8Array;
|
|
29
|
+
coords: Float32Array;
|
|
30
|
+
fillRule: PathFillRule;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Axis-aligned rectangle. Fast path for the (very common) case where the
|
|
34
|
+
* shape is just a rect — preserves O(1) bounds and hit-test, avoids the
|
|
35
|
+
* polygon kernel entirely. Promote to `PolygonPath` only when the shape
|
|
36
|
+
* grows beyond what a rect can express.
|
|
37
|
+
*/
|
|
38
|
+
interface RectPath {
|
|
39
|
+
kind: 'rect';
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
width: number;
|
|
43
|
+
height: number;
|
|
44
|
+
}
|
|
45
|
+
/** Canonical path shape — either an axis-aligned rect (fast path) or a polygon command stream. */
|
|
46
|
+
type Path = PolygonPath | RectPath;
|
|
47
|
+
|
|
48
|
+
export type { Path as P, RectPath as R, PolygonPath as a, PathFillRule as b };
|
|
@@ -1,5 +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-
|
|
2
|
+
import { B as BoundsConstraint, P as PointSnapBehavior, a as PointSnapFrame } from './types-D_74YlWs.js';
|
|
3
3
|
|
|
4
4
|
/** Corner resize-handle: world-space center plus the anchor that pins the opposite corner during resize. */
|
|
5
5
|
interface CornerHandle {
|
|
@@ -1,52 +1,5 @@
|
|
|
1
1
|
import { Bounds } from '@weasel-js/routing';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Path data model. Vector-graphics primitive used kit-wide as the canonical
|
|
5
|
-
* shape (replacing per-shape ad-hoc poses). SVG-style command stream so we
|
|
6
|
-
* cover lines, polygons, beziers, and multi-contour shapes (think the inner
|
|
7
|
-
* hole of an "O") under one type.
|
|
8
|
-
*
|
|
9
|
-
* Storage: command codes in a `Uint8Array`, parameters in a `Float32Array`.
|
|
10
|
-
* Each command consumes a fixed number of float coords from the parameter
|
|
11
|
-
* array; the parser walks both arrays in lockstep. This keeps interaction
|
|
12
|
-
* hot loops monomorphic and keeps GC pressure low under heavy edits.
|
|
13
|
-
*
|
|
14
|
-
* Two path subtypes are distinguished at the type level so common-case
|
|
15
|
-
* machinery (selection AABBs, area-select intersection, hit-testing rect
|
|
16
|
-
* silhouettes) can short-circuit on `RectPath` without paying the polygon
|
|
17
|
-
* kernel cost. Polymorphic kernels accept either via the `Path` union and
|
|
18
|
-
* dispatch on `kind`.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/** Fill rule used by polygon path hit-testing and `ctx.fill()`. */
|
|
22
|
-
type PathFillRule = 'nonzero' | 'evenodd';
|
|
23
|
-
/**
|
|
24
|
-
* Polygon path with arbitrary contours and optional bezier segments.
|
|
25
|
-
* Multi-contour: each `M` opens a new subpath; `Z` closes the current one.
|
|
26
|
-
* Open subpaths (no `Z`) render as polylines and don't contribute to fills.
|
|
27
|
-
*/
|
|
28
|
-
interface PolygonPath {
|
|
29
|
-
kind: 'polygon';
|
|
30
|
-
commands: Uint8Array;
|
|
31
|
-
coords: Float32Array;
|
|
32
|
-
fillRule: PathFillRule;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Axis-aligned rectangle. Fast path for the (very common) case where the
|
|
36
|
-
* shape is just a rect — preserves O(1) bounds and hit-test, avoids the
|
|
37
|
-
* polygon kernel entirely. Promote to `PolygonPath` only when the shape
|
|
38
|
-
* grows beyond what a rect can express.
|
|
39
|
-
*/
|
|
40
|
-
interface RectPath {
|
|
41
|
-
kind: 'rect';
|
|
42
|
-
x: number;
|
|
43
|
-
y: number;
|
|
44
|
-
width: number;
|
|
45
|
-
height: number;
|
|
46
|
-
}
|
|
47
|
-
/** Canonical path shape — either an axis-aligned rect (fast path) or a polygon command stream. */
|
|
48
|
-
type Path = PolygonPath | RectPath;
|
|
49
|
-
|
|
50
3
|
/** `Bounds` with a required rotation angle (radians). Pivot is the AABB
|
|
51
4
|
* center of the unrotated `{x, y, width, height}`. */
|
|
52
5
|
interface RotatedPose extends Bounds {
|
|
@@ -131,4 +84,4 @@ declare function visualBoundsViaDescriptor<TPose>(pose: TPose, geometry: PoseDes
|
|
|
131
84
|
* copy of the pose's own bounds when the descriptor has none. */
|
|
132
85
|
declare function translatePoseViaDescriptor<TPose>(pose: TPose, dx: number, dy: number, geometry: PoseDescriptor<TPose>): TPose;
|
|
133
86
|
|
|
134
|
-
export { type PoseDescriptor as P, RECT_POSE_DESCRIPTOR as R,
|
|
87
|
+
export { type PoseDescriptor as P, RECT_POSE_DESCRIPTOR as R, ROTATED_POSE_DESCRIPTOR as a, type RotatedPose as b, poseDescriptorForNode as p, translatePoseViaDescriptor as t, visualBoundsViaDescriptor as v };
|
package/dist/renderer.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { M as Mesh } from './
|
|
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 './
|
|
3
|
-
import {
|
|
1
|
+
import { M as Mesh } from './builtins-HWyuLzE-.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 './builtins-HWyuLzE-.js';
|
|
3
|
+
import { P as Path } from './path-JEV2c5If.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
7
|
export { View as ViewLike } from '@weasel-js/routing';
|
|
8
8
|
import '@weasel-js/text';
|
|
9
9
|
import '@weasel-js/geom';
|
|
10
|
+
import 'react';
|
|
10
11
|
import '@weasel-js/history';
|
|
11
|
-
import './types-
|
|
12
|
+
import './types-CxC8P6W0.js';
|
|
13
|
+
import './poseDescriptor-rZa9W5hJ.js';
|
|
12
14
|
import '@weasel-js/routing/react';
|
|
13
|
-
import './types-
|
|
15
|
+
import './types-D_74YlWs.js';
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* registerTexture — accepts an image source, assigns an opaque id, stores in
|
package/dist/renderer.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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-
|
|
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-MZAIDI6D.js';
|
|
2
2
|
import './chunk-PNNZSYRD.js';
|
|
3
3
|
import './chunk-44EWMJV2.js';
|
|
4
4
|
import './chunk-H6N2JSZ3.js';
|
|
5
5
|
import './chunk-HPFJUUTF.js';
|
|
6
6
|
import './chunk-L5YNZYEG.js';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-RMR4QMM6.js';
|
|
8
8
|
import './chunk-D4AAWR64.js';
|
|
9
9
|
import './chunk-DOBSZOPR.js';
|
|
10
10
|
import './chunk-4RJP2N2L.js';
|
package/dist/resize.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
export { C as CORNER_ANCHORS, a as CornerAnchor, b as CornerHandle, U as UseResizeOptions, c as cornerPoint, d as cornerResizeHandles, f as fixedCornerOf, h as hitCornerHandle, p as pointSnapToGrid } from './pointSnapToGrid-
|
|
2
|
-
export { P as PoseDescriptor, R as RECT_POSE_DESCRIPTOR,
|
|
3
|
-
import { B as BoundsConstraint } from './types-
|
|
1
|
+
export { C as CORNER_ANCHORS, a as CornerAnchor, b as CornerHandle, U as UseResizeOptions, c as cornerPoint, d as cornerResizeHandles, f as fixedCornerOf, h as hitCornerHandle, p as pointSnapToGrid } from './pointSnapToGrid-7mCcm6qG.js';
|
|
2
|
+
export { P as PoseDescriptor, R as RECT_POSE_DESCRIPTOR, a as ROTATED_POSE_DESCRIPTOR, p as poseDescriptorForNode } from './poseDescriptor-rZa9W5hJ.js';
|
|
3
|
+
import { B as BoundsConstraint } from './types-D_74YlWs.js';
|
|
4
4
|
import { Bounds, ModifierState, View } from '@weasel-js/routing';
|
|
5
|
-
export { A as AUTO_POSE_DESCRIPTOR, i as isPathLike, a as isRectPose } from './autoPoseDescriptor-
|
|
5
|
+
export { A as AUTO_POSE_DESCRIPTOR, i as isPathLike, a as isRectPose } from './autoPoseDescriptor-_XOyF7t4.js';
|
|
6
6
|
import { G as Guide } from './types-D2tTKEU0.js';
|
|
7
7
|
import '@weasel-js/history';
|
|
8
|
-
import './types-
|
|
8
|
+
import './types-CxC8P6W0.js';
|
|
9
|
+
import './path-JEV2c5If.js';
|
|
9
10
|
|
|
10
11
|
/** Resize constraint that stops a node shrinking past a minimum. The anchored
|
|
11
12
|
* edge stays put, so clamping pushes the dragged edge back rather than moving
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Op } from '@weasel-js/history';
|
|
2
|
+
import { P as Path } from './path-JEV2c5If.js';
|
|
2
3
|
|
|
3
4
|
/** A layout container's extent in world units. */
|
|
4
5
|
type ContainerBounds = {
|
|
@@ -47,6 +48,25 @@ interface LayoutSnap<TPose> {
|
|
|
47
48
|
y: number;
|
|
48
49
|
}): DropTarget<TPose> | null;
|
|
49
50
|
}
|
|
51
|
+
/** A container's drop region, in its local frame: the origin is the top-left
|
|
52
|
+
* of the container's world bounds. A path (a `RectPath` for a plain rect) is
|
|
53
|
+
* filled-region tested; a predicate is handed the local point. */
|
|
54
|
+
type DropRegion = Path | ((point: {
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
}) => boolean);
|
|
58
|
+
/**
|
|
59
|
+
* Which layout container a drag lands in when more than one contains the
|
|
60
|
+
* point being dropped.
|
|
61
|
+
*
|
|
62
|
+
* - `'innermost'` (default) — the deepest container in the tree, whatever is
|
|
63
|
+
* painted over it; ties at one depth go to the one painted later.
|
|
64
|
+
* - `'topmost'` — the container painted last, in the scene's render order
|
|
65
|
+
* across the whole tree, so a shallow container drawn over a deep one wins.
|
|
66
|
+
* - `'region'` — only containers whose strategy declares a `dropRegion`, and
|
|
67
|
+
* only when the point is inside it; ties are broken as for `'innermost'`.
|
|
68
|
+
*/
|
|
69
|
+
type LayoutDropTargetMode = 'innermost' | 'topmost' | 'region';
|
|
50
70
|
/** The container a layout strategy is arranging children within. */
|
|
51
71
|
interface LayoutContainer {
|
|
52
72
|
id: string;
|
|
@@ -86,6 +106,12 @@ interface LayoutStrategy<TPose> {
|
|
|
86
106
|
x: number;
|
|
87
107
|
y: number;
|
|
88
108
|
}): boolean;
|
|
109
|
+
/** Optional: where this container takes drops. When it returns a region,
|
|
110
|
+
* the region replaces the container body (and `contains`) as the hit area
|
|
111
|
+
* for choosing a drop container — it may be smaller than the body or reach
|
|
112
|
+
* past it — and it is what makes the container a candidate at all under
|
|
113
|
+
* `LayoutDropTargetMode` `'region'`. `null` or absent keeps the body. */
|
|
114
|
+
dropRegion?(container: LayoutContainer): DropRegion | null;
|
|
89
115
|
/** Optional: reject a drag before any drop-target work happens. A type-aware
|
|
90
116
|
* container (a palette that only takes swatches, say) returns `false` and
|
|
91
117
|
* the drag falls through to whatever container is under it next. When
|
|
@@ -382,4 +408,4 @@ interface OrderedAdapter {
|
|
|
382
408
|
setChildOrder?(parentId: string | null, ids: string[]): void;
|
|
383
409
|
}
|
|
384
410
|
|
|
385
|
-
export type { AreaSelectAdapter as A, ClipboardSnapshot as C,
|
|
411
|
+
export type { AreaSelectAdapter as A, ClipboardSnapshot as C, DropRegion as D, InsertAdapter as I, LayoutStrategy as L, MoveAdapter as M, OrderedAdapter as O, ResizeAdapter as R, SnapTarget as S, SceneAdapter as a, LayoutDropTargetMode as b, LassoHitMode as c, LassoSelectAdapter as d, RotateAdapter as e, LayerEnumerableAdapter as f, LayoutSnap as g, ContainerBounds as h, DropTarget as i, LayoutChild as j, LayoutContainer as k, LayoutDragged as l };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Op } from '@weasel-js/history';
|
|
2
|
-
import { S as SnapTarget, M as MoveAdapter, I as InsertAdapter } from './types-
|
|
2
|
+
import { S as SnapTarget, M as MoveAdapter, I as InsertAdapter } from './types-CxC8P6W0.js';
|
|
3
3
|
import { Bounds, ModifierState, ResizeAnchor } from '@weasel-js/routing';
|
|
4
4
|
|
|
5
5
|
/** Pointer position in both world and client coords. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weasel-js/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Domain-agnostic 2D scene graph primitives for React: viewport math, drag/resize/insert/clone interactions, layered canvas rendering.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "orochi235",
|
|
@@ -76,16 +76,16 @@
|
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"react": ">=18",
|
|
79
|
-
"@weasel-js/font": "1.
|
|
79
|
+
"@weasel-js/font": "1.6.1"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@weasel-js/cursor": "1.
|
|
83
|
-
"@weasel-js/geom": "1.
|
|
84
|
-
"@weasel-js/gestures": "1.
|
|
85
|
-
"@weasel-js/history": "1.
|
|
86
|
-
"@weasel-js/paint": "1.
|
|
87
|
-
"@weasel-js/routing": "1.
|
|
88
|
-
"@weasel-js/text": "1.
|
|
82
|
+
"@weasel-js/cursor": "1.6.1",
|
|
83
|
+
"@weasel-js/geom": "1.6.1",
|
|
84
|
+
"@weasel-js/gestures": "1.6.1",
|
|
85
|
+
"@weasel-js/history": "1.6.1",
|
|
86
|
+
"@weasel-js/paint": "1.6.1",
|
|
87
|
+
"@weasel-js/routing": "1.6.1",
|
|
88
|
+
"@weasel-js/text": "1.6.1",
|
|
89
89
|
"earcut": "2.2.4",
|
|
90
90
|
"polygon-clipping": "^0.15.7"
|
|
91
91
|
},
|
|
@@ -103,6 +103,6 @@
|
|
|
103
103
|
"2d"
|
|
104
104
|
],
|
|
105
105
|
"devDependencies": {
|
|
106
|
-
"@weasel-js/modes": "1.
|
|
106
|
+
"@weasel-js/modes": "1.6.1"
|
|
107
107
|
}
|
|
108
108
|
}
|