@weasel-js/core 1.4.0-pre.1 → 1.4.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 +484 -0
- package/README.md +22 -18
- package/dist/{DrawCommand-b-z1bCT-.d.ts → DrawCommand-Ch8W63oQ.d.ts} +34 -2
- package/dist/{chunk-FUQWXDG3.js → chunk-NU7D64RL.js} +996 -413
- package/dist/chunk-NU7D64RL.js.map +1 -0
- package/dist/{chunk-H6E6KPTU.js → chunk-TORKRNFY.js} +21 -11
- package/dist/chunk-TORKRNFY.js.map +1 -0
- package/dist/index.d.ts +268 -90
- package/dist/index.js +2 -2
- package/dist/{registry-sBLZYWI1.d.ts → registry-BwY_DxJM.d.ts} +81 -21
- package/dist/renderer.d.ts +3 -3
- package/dist/renderer.js +2 -2
- package/dist/routing.d.ts +3 -2
- package/dist/routing.js +1 -1
- package/dist/{stroke-B_BxktoE.d.ts → stroke-Dq8nL4A2.d.ts} +66 -1
- package/package.json +9 -9
- package/dist/chunk-FUQWXDG3.js.map +0 -1
- package/dist/chunk-H6E6KPTU.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { ALWAYS, ANCHOR_HIT_BASE_PX, ActionsProviderIfRoot, ActiveToolContextProvider, ActiveToolContextProviderIfRoot, ArrowIcon, BUILTIN_MARKERS, BUNDLE_TOOLS, COARSE_TARGET_SCALE, CURVE_REPS, CanvasView, ColorOverrideRegistry, CropIcon, CursorCoordsHud, 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, 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, LassoIcon, LineIcon, MARKDOWN_RUN_GRAMMAR, MIXED, MOVE_ANCHORS, MinimapCanvas, NEVER, PATH_ANCHOR_CHROME_ID, PenIcon, PencilIcon, PickHud, PointerProviderIfRoot, PolygonIcon, RECT_ALIGN_PROJECTION, ROTATION_HANDLE_BASE_PX, RectIcon, SCRIPT_METRICS, SPRING_PRESETS, STROKE_DASH_RATIOS, SceneCanvas, SceneViewCanvas, SelectIcon, SelectionContextProvider, SelectionContextProviderIfRoot, StarIcon, SubtractIcon, TOOL_PREF_KINDS, TextIcon, UnionIcon, UnknownIcon, VERSION, VIEW_ANIMATION_KEY, WeaselProvider, _resetMarkersForTests, _resetPaintKindsForTests, aabbCenter, actionIs, actionShortcuts, alignDeltaFor, alignInsertBehavior, alignMoveBehavior, alignResizeBehavior, alignedStrokeRect, always, and, animateLifecycle, animateOnSetPose, annulusSemiAxes, applyBooleanOp, applyStyleToRange, areaSelectAction, arrayAdapter, asNodeId, asPaint, axisAlignedBounds, bezierCubic, bezierQuadratic, blendPoses, 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, composeSelectionPose, composeWorldPose, computeFitView, computeFitViewport, computeIndicatorCommand, computeWheelAction, cond, constrainTo45, containedThenNearest, countPathAnchors, createCellHighlightLayer, createChildrenLayer, createCornerResizeAffordance, createDebugOverlayLayer, createDebugSink, createDispatcher, createGridLayer, createGuidesLayer, createHistory, createMarkdownRenderer, createMoveToIndexOp, createNodeProperties, createNodeRouting, createParallaxLayer, createPathAnchorAffordances, createPathEditingOverlayLayer, createPathLayer, createPenPreviewLayer, createReorderOp, createRotationAffordance, createScene, createSelectionHandlesLayer, createSelectionOutlineLayer, createSelectionOverlayLayer, createSetDataOp, createSetLayerOp, createSetPathOp, createSetTextOp, createTextLayer, createViewResolver, createViewportLayer, cubicBezierEasing, cycleVertexColors, dashForStrokeStyle, decomposePath, decomposeRectPose, defaultCommitAdapter, defaultDrawOne, defaultLabelTextRenderer, defaultNodeProperties, defaultNodeRouting, defaultVisibilityRules, defineTool, defineViewportTool, deriveAlignmentGuides, deriveParallaxView, describeRule, 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, enableLocalFontOutlines2 as enableLocalFontOutlines, enterTextEditAction, enumerateAnchors, evaluate, fillInPoseFrame, fillToBoundsFrame, findNodeShape, findShapeInk, findShapeSilhouette, fitTextPose, fitToBounds, fitViewToBounds, fitZoom, focused, fontString, forEachCoalesced, frameRect, freeform, gateLayer, gesturing, getAlpha01, getImageBitmap, getMarker, getNodeShapes, getPaintKind, getStylusData, gradientForBounds, gradientGeometry, hasFontOutlines2 as hasFontOutlines, hexToRgba, hitAffordanceRegions, hitAnchor, hitRotationHandle, hostAnchorCss, hostAnchorRect, hovering, hoveringSelected, imageStatus, inferredNodeProperties, inferredNodeRouting, insertAction, interpolateView, isBuiltinToolPref, isCanvasFont2 as isCanvasFont, isEditableTarget, isGradientFill, isLayerPainted, isLayerVisible, isPatternSpec, keySpecShortcut, lassoSelectAction, layoutMarkdown, layoutRuns, lerpColorArray, lerpOklab, lerpOklch, linear, listFontOutlines2 as listFontOutlines, listMarkers, listPaintKinds, liveScope, makePinchZoomAction, 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, not, nurbs, oklabToOklch, oklabToSrgbU8, oklchToOklab, openFilePicker, 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, pointInRotatedRect, pointInTextPose, poseRotationOf, pressureToWidth, rainbowVertexColors, rebaseLocalPose, rectCorners, registerCanvasFont2 as registerCanvasFont, registerContentHandler, registerFont2 as registerFont, registerFontOutlines2 as registerFontOutlines, registerMarker, registerNodeShape, registerPaintKind, renderLabel, renderSceneToCanvas, renderSceneToPixels, resizeAction, resolveAlign, resolveColor, resolveDeviceProfile, resolveEasing, resolveFillPattern, resolveMarkerSize, resolveParams, resolvePatternSpec, resolveRuns, resolveSkeleton, resolveStrokeWidth, resolveTextStyle, resolveVisibility, rgbaToHex, rotateAction, rotateAroundAABBCenter, rotatePathAround, rotatePoint, rotatedRectCorners, rotationDegreesUnit, rotationHandle, roundToCell, runsToDom, runsToMarkdown, runsToPlainText, sampleGradientStops, sampleTrack, sceneFromJSON, sceneNodeClientRect, sceneSelectionStore, sceneToAdapter, scopeBindings, screenToWorld, selectFromLasso, selectionAtLeast, selectionEmpty, selectionIs, setFlagOverRange, shapeCoversPoint, sliceAction, snapPoint, solid, solidVertexColors, specificity, spiro, splitPathByLine, splitSubpaths, springPose, springVertexColors, srgbU8ToOklab, staggerVertexColors, startThresholdDrag, strokeDashStyleOf, strokeInsets, strokeOf, strokeWith, styleAtRange, subscribeGlyphReady2 as subscribeGlyphReady, subscribeImageReady, textCommand, textCommandFromRuns, textLineBoxes, tileGrid, toHex8, toRuns, translatePoseViaDescriptor, translateRectPose, trimPolyline, tweenPose, tweenVertexColors, unionAABB, unionBounds, unionBoundsPath, unregisterCanvasFont2 as unregisterCanvasFont, unregisterFontOutlines2 as unregisterFontOutlines, useActiveToolContext, useAlign, useAnimator, useArrayAdapter, useAutoCenter, useBooleans, useBooleansAdapter, useCanvasFocus, useCanvasSize, useDecayLoop, useDeviceProfile, useDistribute, useDragGesture, useDragHandle, useDragRadial, useDragRect, useDropZone, useEllipseTool, useEyedropperTool, useGestureDispatcher, useGridCellHover, useGuides, useHandTool, useHandleDrag, useHostAnchor, useHoverTracking, useImageTool, useKeybindings, useLassoTool, useLineTool, useNodeOverlayFrame, useOptionalActiveToolContext, usePenTool, usePencilTool, usePinchGesture, usePinchZoomTool, usePointerStylus, usePolygonTool, usePublishSelection, useRectTool, useResizePolicy, useRotateTool, useScene, useSceneAdapter, useSceneTextEdit, useSelectTool, useSelection, useSelectionContext, useSimulation, useSliceDep, useStandardActions, useStarTool, useTextEdit, useTextTool, useTools, useVelocityTracker, useViewAnimation, useVisibleRaf, useZoom, verticalAlignOffset, viewToMat3, viewToTransform, viewportDragPanAction, viewportZoomAction, viewportsAt, visualBoundsViaDescriptor, when, withAlpha01, withCoord, withGradientKind, worldEditToStorage, worldPoseLookup, worldToScreen, zoomAt, zoomAtLeast } from './chunk-
|
|
2
|
-
export { ActionDisabledReason, ActionsProvider, DepRegistryProvider, actionBindings, evaluateEnabled, useAction, useActionsRegistry, useDepRegistry, useDepSource, useOptionalDepRegistry } from './chunk-
|
|
1
|
+
export { ALWAYS, ANCHOR_HIT_BASE_PX, ActionsProviderIfRoot, ActiveToolContextProvider, ActiveToolContextProviderIfRoot, ArrowIcon, BUILTIN_MARKERS, BUNDLE_TOOLS, COARSE_TARGET_SCALE, CURVE_REPS, CanvasView, ColorOverrideRegistry, CropIcon, CursorCoordsHud, 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, 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, LassoIcon, LineIcon, MARKDOWN_RUN_GRAMMAR, MIXED, MOVE_ANCHORS, MinimapCanvas, NEVER, PAINTED_CURSOR_LAYER_ID, PATH_ANCHOR_CHROME_ID, PenIcon, PencilIcon, PickHud, PointerProviderIfRoot, PolygonIcon, RECT_ALIGN_PROJECTION, ROTATION_HANDLE_BASE_PX, RectIcon, SCRIPT_METRICS, SPRING_PRESETS, STROKE_DASH_RATIOS, SceneCanvas, SceneViewCanvas, SelectIcon, SelectionContextProvider, SelectionContextProviderIfRoot, StarIcon, SubtractIcon, TOOL_PREF_KINDS, TextIcon, UnionIcon, UnknownIcon, VERSION, VIEW_ANIMATION_KEY, WeaselProvider, _resetMarkersForTests, _resetPaintKindsForTests, aabbCenter, actionIs, actionShortcuts, alignDeltaFor, alignInsertBehavior, alignMoveBehavior, alignResizeBehavior, alignedStrokeRect, always, and, animateLifecycle, animateOnSetPose, annulusSemiAxes, applyBooleanOp, applyStyleToRange, areaSelectAction, arrayAdapter, asNodeId, asPaint, axisAlignedBounds, bakeCursor, bezierCubic, bezierQuadratic, blendPoses, 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, 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, createReorderOp, createRotationAffordance, createScene, createSelectionHandlesLayer, createSelectionOutlineLayer, createSelectionOverlayLayer, createSetDataOp, createSetLayerOp, createSetPathOp, createSetTextOp, createTextLayer, createVelocityTracker, createViewResolver, createViewportLayer, cubicBezierEasing, cursorFor, cycleVertexColors, dashForStrokeStyle, decomposePath, decomposeRectPose, defaultCommitAdapter, defaultDrawOne, defaultLabelTextRenderer, defaultNodeProperties, defaultNodeRouting, defaultVisibilityRules, defineTool, defineViewportTool, deriveAlignmentGuides, deriveParallaxView, describeRule, 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, enableLocalFontOutlines2 as enableLocalFontOutlines, enterTextEditAction, enumerateAnchors, evaluate, fillInPoseFrame, fillToBoundsFrame, findNodeShape, findShapeInk, findShapeSilhouette, fitTextPose, fitToBounds, fitViewToBounds, fitZoom, focused, fontString, forEachCoalesced, frameRect, freeform, gateLayer, gesturing, getAlpha01, getImageBitmap, getMarker, getNodeShapes, getPaintKind, getStylusData, gradientForBounds, gradientGeometry, hasFontOutlines2 as hasFontOutlines, hexToRgba, hitAffordanceRegions, hitAnchor, hitRotationHandle, hostAnchorCss, hostAnchorRect, hovering, hoveringSelected, imageStatus, inferredNodeProperties, inferredNodeRouting, insertAction, interpolateView, isBuiltinToolPref, isCanvasFont2 as isCanvasFont, isEditableTarget, isGradientFill, isLayerPainted, isLayerVisible, isPatternSpec, keySpecShortcut, lassoSelectAction, layoutMarkdown, layoutRuns, 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, 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, pointInRotatedRect, pointInTextPose, poseRotationOf, pressureToWidth, rainbowVertexColors, rebaseLocalPose, rectCorners, registerCanvasFont2 as registerCanvasFont, registerContentHandler, registerFont2 as registerFont, registerFontOutlines2 as registerFontOutlines, registerMarker, registerNodeShape, registerPaintKind, renderLabel, renderSceneToCanvas, renderSceneToPixels, resizeAction, resolveAlign, resolveColor, resolveCursor, resolveCursorTier, resolveDeviceProfile, resolveEasing, resolveFillPattern, resolveMarkerSize, resolveParams, resolvePatternSpec, resolveRuns, resolveSkeleton, resolveStrokeWidth, resolveTextStyle, resolveVisibility, rgbaToHex, rotateAction, rotateAroundAABBCenter, rotatePathAround, rotatePoint, rotatedRectCorners, rotationDegreesUnit, rotationHandle, roundToCell, runsToDom, runsToMarkdown, runsToPlainText, sampleGradientStops, sampleTrack, sceneFromJSON, sceneNodeClientRect, sceneSelectionStore, sceneToAdapter, scopeBindings, screenToWorld, selectFromLasso, selectionAtLeast, selectionEmpty, selectionIs, setFlagOverRange, shapeCoversPoint, sliceAction, snapPoint, solid, solidVertexColors, specificity, spiro, splitPathByLine, splitSubpaths, springPose, springVertexColors, srgbU8ToOklab, staggerVertexColors, startThresholdDrag, strokeDashStyleOf, strokeInsets, strokeOf, strokeWith, styleAtRange, subscribeGlyphReady2 as subscribeGlyphReady, subscribeImageReady, textCommand, textCommandFromRuns, textLineBoxes, tileGrid, toHex8, toRuns, translatePoseViaDescriptor, translateRectPose, trimPolyline, tweenPose, tweenVertexColors, unionAABB, unionBounds, unionBoundsPath, unregisterCanvasFont2 as unregisterCanvasFont, unregisterFontOutlines2 as unregisterFontOutlines, useActiveToolContext, useAlign, useAnimator, useArrayAdapter, useAutoCenter, useBooleans, useBooleansAdapter, useCanvasFocus, useCanvasSize, useDecayLoop, useDeviceProfile, useDistribute, useDragGesture, useDragHandle, useDragRadial, useDragRect, useDropZone, useEllipseTool, useEyedropperTool, useGestureDispatcher, useGridCellHover, useGuides, useHandTool, useHandleDrag, useHostAnchor, useHoverTracking, useImageTool, useKeybindings, useLassoTool, useLineTool, useNodeOverlayFrame, useOptionalActiveToolContext, usePenTool, usePencilTool, usePinchGesture, usePinchZoomTool, usePointerStylus, usePolygonTool, usePublishSelection, useRectTool, useResizePolicy, useRotateTool, useScene, useSceneAdapter, useSceneTextEdit, useSelectTool, useSelection, useSelectionContext, useSimulation, useSliceDep, useStandardActions, useStarTool, useTextEdit, useTextTool, useTools, useVelocityTracker, useViewAnimation, useVisibleRaf, useZoom, verticalAlignOffset, viewToMat3, viewToTransform, viewportDragPanAction, viewportWheelPanAction, viewportZoomAction, viewportsAt, visualBoundsViaDescriptor, when, withAlpha01, withCoord, withGradientKind, worldEditToStorage, worldPoseLookup, worldToScreen, zoomAt, zoomAtLeast } from './chunk-NU7D64RL.js';
|
|
2
|
+
export { ActionDisabledReason, ActionsProvider, DepRegistryProvider, actionBindings, evaluateEnabled, useAction, useActionsRegistry, useDepRegistry, useDepSource, useOptionalDepRegistry } from './chunk-TORKRNFY.js';
|
|
3
3
|
export { createReparentOp, createTransformOp, deleteScratch, getScratch, scratchKey, setScratch, snap } from './chunk-Y5KS66G7.js';
|
|
4
4
|
export { CORNER_ANCHORS, cornerPoint, cornerResizeHandles, hitCornerHandle, pointSnapToGrid } from './chunk-BLJNRMKB.js';
|
|
5
5
|
export { 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, boundsOfPath, ellipsePath, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, formatUnit, gridSnapStrategy, guideSnapStrategy, linePath, pathCommandCoordCount, pathPoseDescriptor, pointInPath, pointToGridCell, polygonFromPoints, polylineFromPoints, pxExtent, rectPath, regularPolygonPath, resolveUnit, scaleDelta, scalePathToBounds, starPath, transformPath, translatePath, translatePolygonInPlace, withinPxBox, withinPxRadius } from './chunk-SBFC6J3C.js';
|
|
@@ -5,9 +5,10 @@ import { CapabilityTag } from '@weasel-js/modes';
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { MutableRefObject, ReactNode, ReactElement } from 'react';
|
|
7
7
|
import { GestureSpec, IngestItem, InputEvent } from '@weasel-js/gestures';
|
|
8
|
-
import { D as DrawCommand } from './DrawCommand-
|
|
8
|
+
import { D as DrawCommand } from './DrawCommand-Ch8W63oQ.js';
|
|
9
9
|
import { B as Bounds, P as PoseProjection, F as FitViewToBoundsOptions, V as ViewportDims } from './geometry-Dtt_k6Dq.js';
|
|
10
10
|
import { FillStyle, Stroke } from '@weasel-js/paint';
|
|
11
|
+
import { CursorSpec } from '@weasel-js/cursor';
|
|
11
12
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
12
13
|
import { P as Path } from './path-JEV2c5If.js';
|
|
13
14
|
import { Op, History } from '@weasel-js/history';
|
|
@@ -161,10 +162,10 @@ interface AffordanceRegion<TScratch = unknown> {
|
|
|
161
162
|
* discriminator; `buildAffordanceAt` falls back to
|
|
162
163
|
* `<affordanceId>:<regionId>`. */
|
|
163
164
|
hitKind?: string;
|
|
164
|
-
/**
|
|
165
|
+
/** Cursor to show while hovering this region. Read by the hover-cursor
|
|
165
166
|
* pump in `useGestureDispatcher` via `AffordanceHit.cursor`, which
|
|
166
167
|
* `buildAffordanceAt` fills in from the region the walk landed on. */
|
|
167
|
-
cursor?:
|
|
168
|
+
cursor?: CursorSpec;
|
|
168
169
|
/** `'exclusive'` bars every binding whose target doesn't consult the
|
|
169
170
|
* affordance. Read only when the affordance is composed into a
|
|
170
171
|
* consumer-registered layer; kit chrome routes through
|
|
@@ -251,9 +252,9 @@ interface CommonAffordanceScratch {
|
|
|
251
252
|
* outright.
|
|
252
253
|
*/
|
|
253
254
|
interface LayerHit<TScratch = unknown> extends AffordanceBinding<TScratch> {
|
|
254
|
-
/**
|
|
255
|
+
/** Cursor while the pointer is over this hit. Reaches the hover-cursor
|
|
255
256
|
* pump as `AffordanceHit.cursor`, the same path kit chrome uses. */
|
|
256
|
-
cursor?:
|
|
257
|
+
cursor?: CursorSpec;
|
|
257
258
|
/** `'exclusive'` bars every binding whose target doesn't consult the
|
|
258
259
|
* affordance. Omitted means `'shared'` — today's behavior. Same name and
|
|
259
260
|
* meaning as `AffordanceHit.strength`, which it becomes. */
|
|
@@ -820,11 +821,11 @@ interface AffordanceHit {
|
|
|
820
821
|
* Other affordance kinds (rotate-handle, anchor:N, controlIn:N, controlOut:N)
|
|
821
822
|
* leave this undefined. */
|
|
822
823
|
anchor?: ResizeAnchor;
|
|
823
|
-
/**
|
|
824
|
+
/** Cursor to show while the pointer hovers this affordance (no
|
|
824
825
|
* gesture in flight). Consumed by the hover-cursor pump in
|
|
825
826
|
* `useGestureDispatcher`; unset = the pump falls through to
|
|
826
827
|
* action-cursor prediction, then to the active tool's cursor. */
|
|
827
|
-
cursor?:
|
|
828
|
+
cursor?: CursorSpec;
|
|
828
829
|
/**
|
|
829
830
|
* Free-form payload from whatever produced the hit, carried through to the
|
|
830
831
|
* matching action untouched.
|
|
@@ -1129,10 +1130,9 @@ interface OngoingHandle {
|
|
|
1129
1130
|
* async side-effect; the registry doesn't wait). */
|
|
1130
1131
|
interface ImmediateInvoker {
|
|
1131
1132
|
timing: 'immediate';
|
|
1132
|
-
/** `params` carries the matched binding's opts.params.
|
|
1133
|
-
*
|
|
1134
|
-
*
|
|
1135
|
-
* default to a sensible variant. */
|
|
1133
|
+
/** `params` carries the matched binding's opts.params. Invoked from the
|
|
1134
|
+
* command palette, or anywhere else with no per-binding context, `params`
|
|
1135
|
+
* is undefined; descriptors should default to a sensible variant. */
|
|
1136
1136
|
run(deps: ActionDeps, params?: Record<string, unknown>): void;
|
|
1137
1137
|
}
|
|
1138
1138
|
/** Phase-machine invocation. `start` opens the phase and returns the handle
|
|
@@ -1478,6 +1478,58 @@ interface ContentHandlerEntry {
|
|
|
1478
1478
|
/** Register a content handler. Returns a disposer that removes it. */
|
|
1479
1479
|
declare function registerContentHandler(entry: ContentHandlerEntry): () => void;
|
|
1480
1480
|
|
|
1481
|
+
/** Per-axis limits on a view's position. Any side may be left open. */
|
|
1482
|
+
interface PanBounds {
|
|
1483
|
+
minX?: number;
|
|
1484
|
+
maxX?: number;
|
|
1485
|
+
minY?: number;
|
|
1486
|
+
maxY?: number;
|
|
1487
|
+
}
|
|
1488
|
+
/** Momentum settings for a pan: how quickly a flung view slows, when it stops,
|
|
1489
|
+
* and what happens at the pan limits. The `DecayLoopConfig` fields a caller
|
|
1490
|
+
* chooses up front, without the per-gesture `velocity` / `onTick`. */
|
|
1491
|
+
interface InertiaConfig {
|
|
1492
|
+
friction?: number;
|
|
1493
|
+
minSpeed?: number;
|
|
1494
|
+
/** What to do when inertial pan reaches `bounds`. Default: no clamping. */
|
|
1495
|
+
boundary?: 'stop' | 'bounce' | 'spring';
|
|
1496
|
+
/** View-coordinate limits for boundary clamping. Requires `boundary` to take effect. */
|
|
1497
|
+
bounds?: PanBounds;
|
|
1498
|
+
}
|
|
1499
|
+
/** How a decay should run: its starting velocity, how fast it slows, and what
|
|
1500
|
+
* happens if it reaches the pan limits. */
|
|
1501
|
+
interface DecayLoopConfig {
|
|
1502
|
+
velocity: {
|
|
1503
|
+
vx: number;
|
|
1504
|
+
vy: number;
|
|
1505
|
+
};
|
|
1506
|
+
friction?: number;
|
|
1507
|
+
minSpeed?: number;
|
|
1508
|
+
/** Bounds for boundary clamping. Requires `boundary` to take effect. */
|
|
1509
|
+
viewBounds?: PanBounds;
|
|
1510
|
+
/**
|
|
1511
|
+
* What to do when the accumulated position hits `viewBounds`. Default: no clamping.
|
|
1512
|
+
* - `'stop'`: clamp at boundary, kill velocity component.
|
|
1513
|
+
* - `'bounce'`: linear reflection — flip velocity sign, magnitude preserved.
|
|
1514
|
+
* - `'spring'`: damped reflection — flip velocity sign and shrink magnitude
|
|
1515
|
+
* by `SPRING_DAMPING` per bounce so the motion settles naturally.
|
|
1516
|
+
*/
|
|
1517
|
+
boundary?: 'stop' | 'bounce' | 'spring';
|
|
1518
|
+
/** Starting position for internal boundary tracking. Required when `viewBounds` is set. */
|
|
1519
|
+
initialPosition?: {
|
|
1520
|
+
x: number;
|
|
1521
|
+
y: number;
|
|
1522
|
+
};
|
|
1523
|
+
onTick: (dx: number, dy: number) => void;
|
|
1524
|
+
onEnd?: () => void;
|
|
1525
|
+
}
|
|
1526
|
+
/** A rAF loop that coasts a value to a stop under friction, reporting the
|
|
1527
|
+
* per-frame delta. What turns a released pan drag into momentum scrolling. */
|
|
1528
|
+
declare function useDecayLoop(): {
|
|
1529
|
+
start: (config: DecayLoopConfig) => void;
|
|
1530
|
+
cancel: () => void;
|
|
1531
|
+
};
|
|
1532
|
+
|
|
1481
1533
|
/** Which of a node's two per-anchor color arrays an override applies to. */
|
|
1482
1534
|
type VertexColorChannel = 'fill' | 'stroke';
|
|
1483
1535
|
/** Function-form override: receives the consumer-supplied base color
|
|
@@ -2408,6 +2460,11 @@ interface ViewApi {
|
|
|
2408
2460
|
/** Where an in-flight camera animation is heading, or null. Compute the next
|
|
2409
2461
|
* discrete step from this so repeated presses compound. */
|
|
2410
2462
|
animationTarget?(): View | null;
|
|
2463
|
+
/** Optional momentum decay. `<SceneCanvas>` wires this from `useDecayLoop`;
|
|
2464
|
+
* a consumer publishing their own `view` dep need not, and `viewport.dragPan`
|
|
2465
|
+
* simply lands the pan without coasting. */
|
|
2466
|
+
decay?(config: DecayLoopConfig): void;
|
|
2467
|
+
stopDecay?(): void;
|
|
2411
2468
|
}
|
|
2412
2469
|
/**
|
|
2413
2470
|
* Adapter dep for `areaSelectAction`.
|
|
@@ -3105,7 +3162,7 @@ interface ToolDef<TScratch = void> {
|
|
|
3105
3162
|
hotkey?: HotkeyTrigger;
|
|
3106
3163
|
onActivate?: (ctx: ToolCtx<TScratch>) => void;
|
|
3107
3164
|
onDeactivate?: (ctx: ToolCtx<TScratch>) => void;
|
|
3108
|
-
cursor?:
|
|
3165
|
+
cursor?: CursorSpec | ((ctx: ToolCtx<TScratch>) => CursorSpec);
|
|
3109
3166
|
/** Override the default scratch initializer. Default is `() => null`
|
|
3110
3167
|
* cast to `TScratch`, which works for tools whose scratch is fresh
|
|
3111
3168
|
* every gesture. Tools that need scratch identity to survive across
|
|
@@ -3139,15 +3196,12 @@ interface ToolDef<TScratch = void> {
|
|
|
3139
3196
|
* authoring signal that a tool pans/zooms the view rather than the scene. */
|
|
3140
3197
|
type ViewportToolDef<TScratch = void> = ToolDef<TScratch>;
|
|
3141
3198
|
|
|
3142
|
-
/** Modifier-key snapshot at event dispatch time.
|
|
3143
|
-
* because tools commonly use space as a hotkey-slot trigger and may
|
|
3144
|
-
* also want to read it as a flag mid-gesture. */
|
|
3199
|
+
/** Modifier-key snapshot at event dispatch time. */
|
|
3145
3200
|
interface ToolModifiers {
|
|
3146
3201
|
alt: boolean;
|
|
3147
3202
|
shift: boolean;
|
|
3148
3203
|
meta: boolean;
|
|
3149
3204
|
ctrl: boolean;
|
|
3150
|
-
space: boolean;
|
|
3151
3205
|
}
|
|
3152
3206
|
/** Per-event context passed to every channel handler. `scratch` is typed
|
|
3153
3207
|
* via the tool's `TScratch` parameter; it survives across a single
|
|
@@ -3232,7 +3286,7 @@ interface Tool<TScratch = unknown> extends Contribution {
|
|
|
3232
3286
|
* the invoker knows which tool to switch to). */
|
|
3233
3287
|
keybinding?: ToolKeybinding;
|
|
3234
3288
|
initScratch?: () => TScratch;
|
|
3235
|
-
cursor?:
|
|
3289
|
+
cursor?: CursorSpec | ((ctx: ToolCtx<TScratch>) => CursorSpec);
|
|
3236
3290
|
onActivate?: (ctx: ToolCtx<TScratch>) => void;
|
|
3237
3291
|
onDeactivate?: (ctx: ToolCtx<TScratch>) => void;
|
|
3238
3292
|
/** Returns the in-flight preview pose for `id` if this tool is mid-gesture
|
|
@@ -3715,12 +3769,12 @@ interface Action {
|
|
|
3715
3769
|
* `Tool.cursor` shows). Affordance hits are resolved earlier in the
|
|
3716
3770
|
* pump via `AffordanceRegion.cursor` and never reach this field.
|
|
3717
3771
|
*
|
|
3718
|
-
* Static
|
|
3772
|
+
* Static value only. Prediction runs `enabled()` but cannot run the
|
|
3719
3773
|
* invoker, so an action that matches yet bails at `start()` (empty
|
|
3720
3774
|
* handle) may still show its cursor — keep `enabled` accurate for
|
|
3721
3775
|
* actions that declare one.
|
|
3722
3776
|
*/
|
|
3723
|
-
cursor?:
|
|
3777
|
+
cursor?: CursorSpec;
|
|
3724
3778
|
/**
|
|
3725
3779
|
* CSS cursor shown while THIS action's ongoing handle is in flight —
|
|
3726
3780
|
* grabbing while panning, `move` while dragging a selection, `crosshair`
|
|
@@ -3739,7 +3793,7 @@ interface Action {
|
|
|
3739
3793
|
* being taken over by bindings, and neither could describe a cursor for an
|
|
3740
3794
|
* action a tool doesn't own.
|
|
3741
3795
|
*/
|
|
3742
|
-
activeCursor?:
|
|
3796
|
+
activeCursor?: CursorSpec;
|
|
3743
3797
|
}
|
|
3744
3798
|
/**
|
|
3745
3799
|
* @experimental
|
|
@@ -3790,7 +3844,13 @@ type ActionsProp = null | Record<string, ActionEntry>;
|
|
|
3790
3844
|
* Imperative API exposed by `useActionsRegistry()`.
|
|
3791
3845
|
*/
|
|
3792
3846
|
interface ActionsRegistry {
|
|
3847
|
+
/** Add an action and return its release. Registrants for one id stack,
|
|
3848
|
+
* newest live, so releasing yours uncovers whoever you displaced. Call it
|
|
3849
|
+
* from an effect and release it in that effect's cleanup — registering from
|
|
3850
|
+
* a render body pushes an entry per render and releases none. */
|
|
3793
3851
|
register(action: Action): () => void;
|
|
3852
|
+
/** Drop every registrant of `id`. This is the "this action should not exist"
|
|
3853
|
+
* door, not a release — for that, call what `register` returned. */
|
|
3794
3854
|
unregister(id: string): void;
|
|
3795
3855
|
list(): readonly Action[];
|
|
3796
3856
|
/** Fire an immediate-invoker action by id. The optional `params` arg is
|
|
@@ -3850,4 +3910,4 @@ declare function useActionsRegistry(): ActionsRegistry | null;
|
|
|
3850
3910
|
*/
|
|
3851
3911
|
declare function useAction(action: Action): void;
|
|
3852
3912
|
|
|
3853
|
-
export { type
|
|
3913
|
+
export { type ScopedBinding as $, type Action as A, type BuiltinShapeToolId as B, type Condition as C, type Dims as D, type CommonAffordanceScratch as E, ColorOverrideRegistry as F, type GeometryProjection as G, type HotkeyTrigger as H, type InertiaConfig as I, type BooleansAdapter as J, type UseAnimatorOptions as K, type LayerHit as L, type SpringPresetName as M, type EasingSpec as N, type OverlayPosition as O, type PanBounds as P, type AnimationHandle as Q, type RenderLayer as R, type SliceDep as S, type Tool as T, type UseSelectionOptions as U, type VisibilityRules as V, type VertexColorChannel as W, type SampledTrack as X, type Eligibility as Y, type BindingScope as Z, type Contribution as _, type DeviceProfile as a, type PointerContextValue as a$, ALWAYS as a0, type ActionDeps as a1, ActionDisabledReason as a2, type ActionEnabledResult as a3, type ActionEntry as a4, ActionsProvider as a5, ActiveToolContextProvider as a6, ActiveToolContextProviderIfRoot as a7, type ActiveToolContextProviderProps as a8, type ActiveToolContextValue as a9, type GestureBinding as aA, IDENTITY_POSE_COMPOSITION as aB, type ImmediateInvoker as aC, type IngestCtx as aD, type IngestionDep as aE, type InsertDep as aF, type Interpolate as aG, type InterpolatorFactory as aH, type InvocationCtx as aI, type Invoker as aJ, KIT_SHAPE_KINDS as aK, type Keyframe as aL, type LassoSelectDep as aM, type LayerCommandCache as aN, type LayoutDep as aO, type LoopFactory as aP, type LoopOptions as aQ, type MatchResult as aR, NEVER as aS, type NestedTimeline as aT, type NodeAtPointDep as aU, type OngoingHandle as aV, type OngoingInvoker as aW, type PhysicsHandle as aX, type PhysicsOptions as aY, type Point2 as aZ, PointerContextProvider as a_, type AnimateToBoundsOptions as aa, type AreaSelectDep as ab, type BezierEasing as ac, type BindingOpts as ad, type BooleanOp as ae, type BooleanOpResult as af, type BoundGesture as ag, type BuildRuleCtxArgs as ah, type ClaimableGesture as ai, type ClipboardDep as aj, type ClipboardIngestCtx as ak, type ColorOverride as al, type ColorOverrideFn as am, type CustomPaintContext as an, type DecayLoopConfig as ao, type DecayOptions as ap, type DepName as aq, type DepRegistry as ar, DepRegistryProvider as as, type DispatcherContext as at, type DragSample as au, EASINGS as av, type EasingFn as aw, type EasingName as ax, type EditAnchorsDep as ay, type EventTrack as az, type DetectedDeviceFacts as b, easeInOutElastic as b$, type PointerWorldPos as b0, type PoseAdapter as b1, type PoseComposition as b2, type ResizePolicy as b3, type ResolveAllOptions as b4, type ResolveOnlyResult as b5, type ResolvedCandidate as b6, SPRING_PRESETS as b7, type SelectionExtendKey as b8, type SelectionMode as b9, type ViewApi as bA, type ViewChannel as bB, actionBindings as bC, applyBooleanOp as bD, buildRuleCtx as bE, clipboardCopyAction as bF, clipboardCutAction as bG, composeRectPose as bH, composeWorldPose as bI, createDispatcher as bJ, cubicBezierEasing as bK, decomposeRectPose as bL, describeRule as bM, drawLayers as bN, drawOneLayer as bO, easeIn as bP, easeInBack as bQ, easeInBounce as bR, easeInCirc as bS, easeInCubic as bT, easeInElastic as bU, easeInExpo as bV, easeInOut as bW, easeInOutBack as bX, easeInOutBounce as bY, easeInOutCirc as bZ, easeInOutCubic as b_, type Selector as ba, type SnapDep as bb, type SpringOptions as bc, type SpringPreset as bd, type StaggerBuilder as be, type StaggerDelay as bf, type StaggerFactory as bg, type StaggerOptions as bh, type StaggerPerItem as bi, type StaggerSpringPoseOptions as bj, type StaggerTweenOptions as bk, type SvgUnpacker as bl, type TextEditDep as bm, type TimelineHandle as bn, type TimelineOptions as bo, type TimelineTrack as bp, type ToolCtx as bq, type ToolModifiers as br, type ToolPresentation as bs, type ToolSlot as bt, type Track as bu, type TweenLoopOptions as bv, type TweenOptions as bw, type UiOngoingControl as bx, VIEW_ANIMATION_KEY as by, type ViewAnimationApi as bz, type Rule as c, easeInOutExpo as c0, easeInOutQuad as c1, easeInOutQuart as c2, easeInOutQuint as c3, easeInOutSine as c4, easeInQuad as c5, easeInQuart as c6, easeInQuint as c7, easeInSine as c8, easeOut as c9, useDecayLoop as cA, useDepRegistry as cB, useDepSource as cC, useOptionalActiveToolContext as cD, useOptionalDepRegistry as cE, usePointerContext as cF, useSelection as cG, useViewAnimation as cH, worldPoseLookup as cI, easeOutBack as ca, easeOutBounce as cb, easeOutCirc as cc, easeOutCubic as cd, easeOutElastic as ce, easeOutExpo as cf, easeOutQuad as cg, easeOutQuart as ch, easeOutQuint as ci, easeOutSine as cj, enterTextEditAction as ck, evaluate as cl, evaluateEnabled as cm, isLayerPainted as cn, isLayerVisible as co, linear as cp, rebaseLocalPose as cq, registerContentHandler as cr, resolveEasing as cs, resolveParams as ct, sliceAction as cu, specificity as cv, translateRectPose as cw, useAction as cx, useActionsRegistry as cy, useActiveToolContext as cz, type RuleCtx as d, type ChromeCtx as e, type ChromeId as f, type ViewAnimationOptions as g, type DepSchema as h, type ActionsRegistry as i, type AffordanceHit as j, type Dispatcher as k, type ToolDef as l, type ViewportToolDef as m, type AnyTool as n, type ToolKeybinding as o, type OngoingOverlay as p, type ChromeState as q, type SelectionApi as r, type InsertExtras as s, type ContentHandlerEntry as t, type SvgIngestOptions as u, type ActionsProp as v, type Animator as w, type Affordance as x, type AffordanceRegion as y, type AffordanceBinding as z };
|
package/dist/renderer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as Mesh } from './stroke-
|
|
2
|
-
export { I as IDENTITY_COLOR_MATRIX, a as ImageMinification, R as RenderTarget, S as ShaderCompileError, b as SpriteSheet, c as StrokeOptions, V as ViewLike, W as WeaselRenderer, d as WeaselRendererOptions, e as buildGradientRamp, f as frameRect, t as tessellateStroke, v as viewToMat3 } from './stroke-
|
|
3
|
-
export { D as DrawCommand, G as GroupDrawCommand, I as ImageDrawCommand, M as Mat3, P as PathDrawCommand, S as
|
|
1
|
+
import { M as Mesh } from './stroke-Dq8nL4A2.js';
|
|
2
|
+
export { I as IDENTITY_COLOR_MATRIX, a as ImageMinification, R as RenderTarget, S as ShaderCompileError, b as SpriteSheet, c as StrokeOptions, V as ViewLike, W as WeaselRenderer, d as WeaselRendererOptions, e as buildGradientRamp, f as frameRect, t as tessellateStroke, v as viewToMat3 } from './stroke-Dq8nL4A2.js';
|
|
3
|
+
export { D as DrawCommand, G as GroupDrawCommand, I as ImageDrawCommand, M as Mat3, P as PathDrawCommand, S as SPRITE_STRIDE, a as ShaderDrawCommand, b as ShaderProgramHandle, c as ShaderUniform, d as SolidPaint, e as SpritesDrawCommand, T as TextDrawCommand, m as mat3, r as registerProgram } from './DrawCommand-Ch8W63oQ.js';
|
|
4
4
|
import { P as Path } from './path-JEV2c5If.js';
|
|
5
5
|
export { canQueryLocalFonts, enableLocalFontOutlines, hasFontOutlines, isCanvasFont, listFontOutlines, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, subscribeGlyphReady, unregisterCanvasFont, unregisterFontOutlines } from '@weasel-js/font';
|
|
6
6
|
import { TextureHandle } from '@weasel-js/paint';
|
package/dist/renderer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { IDENTITY_COLOR_MATRIX, OUTLINE_MIN_SCREEN_PX, ShaderCompileError, WeaselRenderer, buildGradientRamp, canQueryLocalFonts, enableLocalFontOutlines, frameRect, hasFontOutlines, isCanvasFont, listFontOutlines, mat3, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, registerProgram, subscribeGlyphReady, tessellate, tessellateStroke, unregisterCanvasFont, unregisterFontOutlines, viewToMat3 } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { IDENTITY_COLOR_MATRIX, OUTLINE_MIN_SCREEN_PX, SPRITE_STRIDE, ShaderCompileError, WeaselRenderer, buildGradientRamp, canQueryLocalFonts, enableLocalFontOutlines, frameRect, hasFontOutlines, isCanvasFont, listFontOutlines, mat3, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, registerProgram, subscribeGlyphReady, tessellate, tessellateStroke, unregisterCanvasFont, unregisterFontOutlines, viewToMat3 } from './chunk-NU7D64RL.js';
|
|
2
|
+
import './chunk-TORKRNFY.js';
|
|
3
3
|
import './chunk-Y5KS66G7.js';
|
|
4
4
|
import './chunk-BLJNRMKB.js';
|
|
5
5
|
import './chunk-SBFC6J3C.js';
|
package/dist/routing.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ParsedModifiers, GestureName, GestureSpec } from '@weasel-js/gestures';
|
|
2
2
|
export { ChannelRef, DescribeRouteOptions, GESTURE_DESCRIPTORS, GestureArgSpec, GestureDescriptor, GestureName, ModRequirement, ModifierKey, ParsedModifiers, ParsedRoute, PhaseAtom, RESERVED_ID_NAMES, RESERVED_ID_PREFIXES, ROUTE_FIELD_DEFINITIONS, ROUTE_TERMS, RouteDescriptionPart, RouteFieldName, RouteTermLabel, canonicalModifiers, collapseShiftPairs, describeRoute, describeRouteParts, formatPhaseAtom, formatRoute, getGestureDescriptor, isKnownGestureName, parseRoute } from '@weasel-js/gestures';
|
|
3
|
-
import { T as Tool } from './registry-
|
|
3
|
+
import { T as Tool } from './registry-BwY_DxJM.js';
|
|
4
4
|
import './types-DIQAisSG.js';
|
|
5
5
|
import '@weasel-js/history';
|
|
6
6
|
import './path-JEV2c5If.js';
|
|
@@ -9,10 +9,11 @@ import './types-XBcDEp3Y.js';
|
|
|
9
9
|
import './view-DSQgxBJB.js';
|
|
10
10
|
import '@weasel-js/modes';
|
|
11
11
|
import 'react';
|
|
12
|
-
import './DrawCommand-
|
|
12
|
+
import './DrawCommand-Ch8W63oQ.js';
|
|
13
13
|
import '@weasel-js/paint';
|
|
14
14
|
import '@weasel-js/text';
|
|
15
15
|
import './geometry-Dtt_k6Dq.js';
|
|
16
|
+
import '@weasel-js/cursor';
|
|
16
17
|
import 'react/jsx-runtime';
|
|
17
18
|
import './types-BHK2dkMu.js';
|
|
18
19
|
import '@weasel-js/geom';
|
package/dist/routing.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { GESTURE_DESCRIPTORS, PREDICATE_TARGET, RESERVED_ID_NAMES, RESERVED_ID_PREFIXES, ROUTE_FIELD_DEFINITIONS, ROUTE_TERMS, buildRouteRegistry, canonicalModifiers, collapseShiftPairs, describeRoute, describeRouteParts, findConflicts, formatPhaseAtom, formatRoute, getGestureDescriptor, isKnownGestureName, parseRoute, routeGestureForSpecKind, routesForSpec } from './chunk-
|
|
1
|
+
export { GESTURE_DESCRIPTORS, PREDICATE_TARGET, RESERVED_ID_NAMES, RESERVED_ID_PREFIXES, ROUTE_FIELD_DEFINITIONS, ROUTE_TERMS, buildRouteRegistry, canonicalModifiers, collapseShiftPairs, describeRoute, describeRouteParts, findConflicts, formatPhaseAtom, formatRoute, getGestureDescriptor, isKnownGestureName, parseRoute, routeGestureForSpecKind, routesForSpec } from './chunk-TORKRNFY.js';
|
|
2
2
|
//# sourceMappingURL=routing.js.map
|
|
3
3
|
//# sourceMappingURL=routing.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GradStop, Stroke } from '@weasel-js/paint';
|
|
2
|
-
import { M as Mat3,
|
|
2
|
+
import { M as Mat3, b as ShaderProgramHandle, D as DrawCommand } from './DrawCommand-Ch8W63oQ.js';
|
|
3
3
|
import { P as Path } from './path-JEV2c5If.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -343,6 +343,67 @@ declare class SolidBatch {
|
|
|
343
343
|
private deleteSet;
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
+
/**
|
|
347
|
+
* Growable vertex staging for consecutive image quads.
|
|
348
|
+
*
|
|
349
|
+
* Geometry only: `draw.ts` owns when a run starts, what breaks it, and the
|
|
350
|
+
* uniforms the flush draws under. The counterpart to `SolidBatch`, and the same
|
|
351
|
+
* two tricks — the model transform is applied here rather than uploaded, so
|
|
352
|
+
* quads under different group transforms still share a draw, and opacity rides
|
|
353
|
+
* the vertices, so quads under different opacities do too. What it cannot
|
|
354
|
+
* absorb is the texture: a batch samples one, which is why an atlas is what
|
|
355
|
+
* makes a large run coalesce at all.
|
|
356
|
+
*
|
|
357
|
+
* Every run is quads, so a slot's index buffer is written once at creation and
|
|
358
|
+
* never again: the pattern for N quads is a prefix of the pattern for any
|
|
359
|
+
* larger N, so the pattern for a slot's capacity serves every flush it takes.
|
|
360
|
+
* `SolidBatch` carries meshes, whose indices are rebased per flush, and has to
|
|
361
|
+
* re-upload; this does not.
|
|
362
|
+
*/
|
|
363
|
+
|
|
364
|
+
declare class ImageBatch {
|
|
365
|
+
private readonly gl;
|
|
366
|
+
private readonly aPos;
|
|
367
|
+
private readonly aUv;
|
|
368
|
+
private readonly aOpacity;
|
|
369
|
+
/** One ring per tier, cycled per flush. Slots are created on first use, so a
|
|
370
|
+
* renderer that flushes rarely allocates as few as it flushes. */
|
|
371
|
+
private readonly rings;
|
|
372
|
+
private readonly nextInRing;
|
|
373
|
+
/** For flushes past the largest tier; these sets grow to fit. */
|
|
374
|
+
private readonly largeRing;
|
|
375
|
+
private nextLarge;
|
|
376
|
+
private verts;
|
|
377
|
+
private nQuads;
|
|
378
|
+
constructor(gl: WebGL2RenderingContext, prog: ShaderProgram);
|
|
379
|
+
/** Indices staged — what a caller passes to `drawElements`. */
|
|
380
|
+
get length(): number;
|
|
381
|
+
get quads(): number;
|
|
382
|
+
/** Whether staging one more quad would put the run past the per-flush cap. */
|
|
383
|
+
wouldOverflow(): boolean;
|
|
384
|
+
/**
|
|
385
|
+
* Append one image quad: the destination rect `(x, y, w, h)` mapped through
|
|
386
|
+
* `m`, sampling `(u0, v0)`-`(u1, v1)`, every corner carrying `opacity`.
|
|
387
|
+
*
|
|
388
|
+
* An affine maps a rect to a parallelogram, so two triangles still cover it
|
|
389
|
+
* and the batch draws at `u_model` identity. Corners wind top-left,
|
|
390
|
+
* top-right, bottom-right, bottom-left, with UVs following — the flips a
|
|
391
|
+
* command asks for are already in the `u`/`v` the caller passes.
|
|
392
|
+
*/
|
|
393
|
+
pushQuad(x: number, y: number, w: number, h: number, m: Mat3, u0: number, v0: number, u1: number, v1: number, opacity: number): void;
|
|
394
|
+
/** Upload the staged geometry into the next set of buffers and bind its VAO.
|
|
395
|
+
* Returns the index count for the caller's `drawElements`. */
|
|
396
|
+
uploadAndBind(): number;
|
|
397
|
+
reset(): void;
|
|
398
|
+
dispose(): void;
|
|
399
|
+
/** Grow the CPU arrays so one more quad fits. */
|
|
400
|
+
private reserve;
|
|
401
|
+
private nextRingSlot;
|
|
402
|
+
private nextLargeSlot;
|
|
403
|
+
private createSet;
|
|
404
|
+
private deleteSet;
|
|
405
|
+
}
|
|
406
|
+
|
|
346
407
|
/** How to construct a `WeaselRenderer`: the GL context or canvas to draw
|
|
347
408
|
* into, the output size, and the quality knobs that separate screen
|
|
348
409
|
* rendering from print. */
|
|
@@ -412,6 +473,7 @@ declare class WeaselRenderer {
|
|
|
412
473
|
private textSdf;
|
|
413
474
|
private textSdfR8;
|
|
414
475
|
private imageFill;
|
|
476
|
+
private imageFillVOpacity;
|
|
415
477
|
private gradFill;
|
|
416
478
|
private patternFill;
|
|
417
479
|
private meshCache;
|
|
@@ -422,6 +484,7 @@ declare class WeaselRenderer {
|
|
|
422
484
|
private quadVbo;
|
|
423
485
|
private quadIbo;
|
|
424
486
|
private solidBatch;
|
|
487
|
+
private imageBatch;
|
|
425
488
|
private readonly groupState;
|
|
426
489
|
private widthCss;
|
|
427
490
|
private heightCss;
|
|
@@ -515,9 +578,11 @@ declare class WeaselRenderer {
|
|
|
515
578
|
/** @internal */ _pathFill(): ShaderProgram;
|
|
516
579
|
/** @internal */ _pathFillVColor(): ShaderProgram;
|
|
517
580
|
/** @internal */ _solidBatch(): SolidBatch;
|
|
581
|
+
/** @internal */ _imageBatch(): ImageBatch;
|
|
518
582
|
/** @internal */ _textSdf(): ShaderProgram;
|
|
519
583
|
/** @internal */ _textSdfR8(): ShaderProgram;
|
|
520
584
|
/** @internal */ _imageFill(): ShaderProgram;
|
|
585
|
+
/** @internal */ _imageFillVOpacity(): ShaderProgram;
|
|
521
586
|
/** @internal */ _gradFill(): ShaderProgram;
|
|
522
587
|
/** @internal */ _patternFill(): ShaderProgram;
|
|
523
588
|
/** @internal */ _meshCache(): GLMeshCache;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weasel-js/core",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.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",
|
|
@@ -72,16 +72,16 @@
|
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
74
|
"react": ">=18",
|
|
75
|
-
"@weasel-js/font": "1.4.
|
|
75
|
+
"@weasel-js/font": "1.4.1"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@weasel-js/cursor": "1.4.
|
|
79
|
-
"@weasel-js/geom": "1.4.
|
|
80
|
-
"@weasel-js/gestures": "1.4.
|
|
81
|
-
"@weasel-js/history": "1.4.
|
|
82
|
-
"@weasel-js/modes": "1.4.
|
|
83
|
-
"@weasel-js/paint": "1.4.
|
|
84
|
-
"@weasel-js/text": "1.4.
|
|
78
|
+
"@weasel-js/cursor": "1.4.1",
|
|
79
|
+
"@weasel-js/geom": "1.4.1",
|
|
80
|
+
"@weasel-js/gestures": "1.4.1",
|
|
81
|
+
"@weasel-js/history": "1.4.1",
|
|
82
|
+
"@weasel-js/modes": "1.4.1",
|
|
83
|
+
"@weasel-js/paint": "1.4.1",
|
|
84
|
+
"@weasel-js/text": "1.4.1",
|
|
85
85
|
"earcut": "2.2.4",
|
|
86
86
|
"polygon-clipping": "^0.15.7"
|
|
87
87
|
},
|