@weasel-js/core 1.4.0-pre.0 → 1.4.0-pre.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
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.4.0-pre.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 36b6ee7: Add `@weasel-js/cursor` and give three tools real cursors.
|
|
8
|
+
|
|
9
|
+
A cursor glyph is SVG path `d` strings tagged with a paint role plus a hotspot
|
|
10
|
+
in glyph units — the one geometry form both a data-URI baker and a `Path2D`
|
|
11
|
+
painter consume without translating. `bakeCursor` renders one to a
|
|
12
|
+
`url(data:image/svg+xml,…)` string with the hotspot scaled to integer CSS px,
|
|
13
|
+
and `cursorFor` memoizes that per name and size. The pencil, pen and eyedropper
|
|
14
|
+
tools now show their own glyph instead of a shared `crosshair`.
|
|
15
|
+
|
|
16
|
+
Cursors ship as SVG with no bitmap fallback: Chrome rasterizes an SVG data-URI
|
|
17
|
+
cursor at device scale, so it is already crisp on a retina display. `bakeCursor`
|
|
18
|
+
throws above 128 CSS px rather than emitting a cursor the browser would drop
|
|
19
|
+
silently — that size is where a later painted tier will take over.
|
|
20
|
+
|
|
21
|
+
Glyph geometry is authored in `scripts/glyphs/` and generated to resolved
|
|
22
|
+
literals by `npm run gen:cursors`; `npm run proof:cursors` renders the baked
|
|
23
|
+
assets over three backgrounds for inspection.
|
|
24
|
+
|
|
25
|
+
New API: `bakeCursor`, `cursorFor`, `GLYPHS`, `haloFitsInBox`, `CursorGlyph`,
|
|
26
|
+
`CursorPath`, `CursorGlyphName`, `BakeOptions`, and the register constants
|
|
27
|
+
`CURSOR_INK`, `CURSOR_HALO`, `CURSOR_HALO_WIDTH`, `CURSOR_MAX_CSS_PX`.
|
|
28
|
+
- Updated dependencies [36b6ee7]
|
|
29
|
+
- @weasel-js/cursor@1.4.0-pre.1
|
|
30
|
+
- @weasel-js/font@1.4.0-pre.1
|
|
31
|
+
- @weasel-js/geom@1.4.0-pre.1
|
|
32
|
+
- @weasel-js/gestures@1.4.0-pre.1
|
|
33
|
+
- @weasel-js/history@1.4.0-pre.1
|
|
34
|
+
- @weasel-js/modes@1.4.0-pre.1
|
|
35
|
+
- @weasel-js/paint@1.4.0-pre.1
|
|
36
|
+
- @weasel-js/text@1.4.0-pre.1
|
|
37
|
+
|
|
3
38
|
## 1.4.0-pre.0
|
|
4
39
|
|
|
5
40
|
### Minor Changes
|
|
@@ -19,11 +19,12 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
19
19
|
import polygonClipping from 'polygon-clipping';
|
|
20
20
|
import { matchSpec, RESERVED_ID_PREFIXES, RESERVED_ID_NAMES, parseTargetSpec, mimeMatchesGlob } from '@weasel-js/gestures';
|
|
21
21
|
import { NORMAL, IMPLICIT_TAGS } from '@weasel-js/modes';
|
|
22
|
+
import { cursorFor } from '@weasel-js/cursor';
|
|
22
23
|
import { createHistory } from '@weasel-js/history';
|
|
23
24
|
export * from '@weasel-js/history';
|
|
24
25
|
|
|
25
26
|
// src/version.ts
|
|
26
|
-
var VERSION = "1.4.0-pre.
|
|
27
|
+
var VERSION = "1.4.0-pre.1" ;
|
|
27
28
|
|
|
28
29
|
// src/features/grid/roundToCell.ts
|
|
29
30
|
function roundToCell(value, cellSize) {
|
|
@@ -17808,8 +17809,6 @@ function constrainTo45(dx, dy) {
|
|
|
17808
17809
|
const snapped = Math.round(angle / step) * step;
|
|
17809
17810
|
return { dx: Math.cos(snapped) * mag, dy: Math.sin(snapped) * mag };
|
|
17810
17811
|
}
|
|
17811
|
-
|
|
17812
|
-
// src/tools/builtin/pen/usePenTool.ts
|
|
17813
17812
|
function freshScratch() {
|
|
17814
17813
|
return {
|
|
17815
17814
|
finishedSubpaths: [],
|
|
@@ -18048,7 +18047,7 @@ function usePenTool(options) {
|
|
|
18048
18047
|
hookName: "usePenTool",
|
|
18049
18048
|
// Reads the tool's own ref rather than a scratch handed in by a
|
|
18050
18049
|
// dispatcher — the pen owns this state and nothing else needs it.
|
|
18051
|
-
cursor: () => scratchRef.current?.closeHintActive ? "pointer" : "crosshair",
|
|
18050
|
+
cursor: () => scratchRef.current?.closeHintActive ? "pointer" : cursorFor("pen", { fallback: "crosshair" }),
|
|
18052
18051
|
presentation: {
|
|
18053
18052
|
label: "Pen",
|
|
18054
18053
|
icon: createElement(PenIcon),
|
|
@@ -18224,7 +18223,7 @@ function useEyedropperTool(opts) {
|
|
|
18224
18223
|
hookName: "useEyedropperTool",
|
|
18225
18224
|
keybinding,
|
|
18226
18225
|
hotkey,
|
|
18227
|
-
cursor: "crosshair",
|
|
18226
|
+
cursor: cursorFor("eyedropper", { fallback: "crosshair" }),
|
|
18228
18227
|
presentation: {
|
|
18229
18228
|
label: "Eyedropper",
|
|
18230
18229
|
icon: createElement(EyedropperIcon),
|
|
@@ -18522,7 +18521,7 @@ function usePencilTool() {
|
|
|
18522
18521
|
id: "pencil",
|
|
18523
18522
|
capabilities: ["creates-paths"],
|
|
18524
18523
|
hookName: "usePencilTool",
|
|
18525
|
-
cursor: "crosshair",
|
|
18524
|
+
cursor: cursorFor("pencil", { fallback: "crosshair" }),
|
|
18526
18525
|
presentation: {
|
|
18527
18526
|
label: "Pencil",
|
|
18528
18527
|
group: "draw",
|
|
@@ -30686,5 +30685,5 @@ function mergeContributions(...bundles) {
|
|
|
30686
30685
|
}
|
|
30687
30686
|
|
|
30688
30687
|
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_SIZE2 as DEFAULT_HANDLE_SIZE, DEFAULT_MAX_ZOOM, DEFAULT_MIN_ZOOM, DEFAULT_PALETTE, DEFAULT_ROTATION_HANDLE_DISTANCE, DEFAULT_SHAPE_FILL, DEFAULT_STROKE_COLOR, DEFAULT_VELOCITY_DECAY, DepRegistryProviderIfRoot, DeviceProfileProvider, DivideIcon, EASINGS, EllipseIcon, ExcludeIcon, EyedropperIcon, FALLBACK_FIT_VIEW, GHOST_STROKE, HANDLE_BASE_PX, HandIcon, IDENTITY_COLOR_MATRIX, IDENTITY_JOINT, IDENTITY_POSE_COMPOSITION, ImageIcon, IntersectIcon, KIT_SHAPE_KINDS, LassoIcon, LineIcon, MIXED, MOVE_ANCHORS, MinimapCanvas, NEVER, OUTLINE_MIN_SCREEN_PX, PATH_ANCHOR_CHROME_ID, PenIcon, PencilIcon, PickHud, PointerProviderIfRoot, PolygonIcon, RECT_ALIGN_PROJECTION, ROTATION_HANDLE_BASE_PX, RectIcon, SPRING_PRESETS, SceneCanvas, SceneViewCanvas, SelectIcon, SelectionContextProvider, SelectionContextProviderIfRoot, ShaderCompileError, StarIcon, SubtractIcon, TOOL_PREF_KINDS, TextIcon, UnionIcon, UnknownIcon, VERSION, VIEW_ANIMATION_KEY, WeaselProvider, WeaselRenderer, _resetMarkersForTests, _resetPaintKindsForTests, aabbCenter, actionIs, actionShortcuts, alignDeltaFor, alignInsertBehavior, alignMoveBehavior, alignResizeBehavior, always, and, animateLifecycle, animateOnSetPose, annulusSemiAxes, applyBooleanOp, applyStyleToRange, areaSelectAction, arrayAdapter, asNodeId, asPaint, axisAlignedBounds, bezierCubic, bezierQuadratic, blendPoses, buildChromeCtx, buildGradientRamp, buildRuleCtx, buildSceneViewCommands, canBringForward, canHover, 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, createHistory2 as createHistory, createMoveToIndexOp, createNodeProperties, createNodeRouting, createParallaxLayer, createPathAnchorAffordances, createPathEditingOverlayLayer, createPathLayer, createPenPreviewLayer, createReorderOp, createRotationAffordance, createScene, createSelectionHandlesLayer, createSelectionOutlineLayer, createSelectionOverlayLayer, createSetDataOp, createSetLayerOp, createSetPathOp, createSetTextOp, createTextLayer, createViewResolver, createViewportLayer, cubicBezierEasing, cycleVertexColors, 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, enterTextEditAction, enumerateAnchors, evaluate, fillInPoseFrame, fillToBoundsFrame, findNodeShape, findShapeInk, findShapeSilhouette, fitTextPose, fitToBounds, fitViewToBounds, fitZoom, focused, forEachCoalesced, frameRect, freeform, gateLayer, gesturing, getAlpha01, getImageBitmap, getMarker, getNodeShapes, getPaintKind, getStylusData, gradientForBounds, gradientGeometry, hexToRgba, hitAffordanceRegions, hitAnchor, hitRotationHandle, hostAnchorCss, hostAnchorRect, hovering, hoveringSelected, imageStatus, inferredNodeProperties, inferredNodeRouting, insertAction, interpolateView, isBuiltinToolPref, isEditableTarget2 as isEditableTarget, isGradientFill, isLayerPainted, isLayerVisible, isPatternSpec, keySpecShortcut, lassoSelectAction, lerpColorArray, lerpOklab, lerpOklch, linear, listMarkers, listPaintKinds, liveScope, makePinchZoomAction, makeViewportZoomAction, markerDrawCommands, markerInset, markerKeyOf, markerSites, mat3, matchAlignment, matchesKeyBinding, meanScale, mergeAlphaFromPrev, mergeContributions, modeIn, modeIs, modeNot, modifierHeld, momentum, moveAction, multiActive, nearest, nearestWithin, nestedHitTester, never, nodeHasFlag, none, normalizeHex, not, nurbs, oklabToOklch, oklabToSrgbU8, oklchToOklab, openFilePicker, or, 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, registerContentHandler, registerMarker, registerNodeShape, registerPaintKind, registerProgram, renderLabel, renderSceneToCanvas, renderSceneToPixels, resizeAction, resolveColor, resolveDeviceProfile, resolveEasing, resolveFillPattern, resolveMarkerSize, resolveParams, resolvePatternSpec, resolveSkeleton, resolveStrokeWidth, resolveVisibility, rgbaToHex, rotateAction, rotateAroundAABBCenter, rotatePathAround, rotatePoint, rotatedRectCorners, rotationDegreesUnit, rotationHandle, roundToCell, runsToDom, 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, strokeInsets, strokeOf, strokeWith, styleAtRange, subscribeImageReady, tessellate, tessellateStroke, textCommand, textCommandFromRuns, tileGrid, toHex8, translatePoseViaDescriptor, translateRectPose, trimPolyline, tweenPose, tweenVertexColors, unionAABB, unionBounds, unionBoundsPath, 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, viewToMat3, viewToTransform, viewportDragPanAction, viewportZoomAction, viewportsAt, visualBoundsViaDescriptor, when, withAlpha01, withCoord, withGradientKind, worldEditToStorage, worldPoseLookup, worldToScreen, zoomAt, zoomAtLeast };
|
|
30689
|
-
//# sourceMappingURL=chunk-
|
|
30690
|
-
//# sourceMappingURL=chunk-
|
|
30688
|
+
//# sourceMappingURL=chunk-FUQWXDG3.js.map
|
|
30689
|
+
//# sourceMappingURL=chunk-FUQWXDG3.js.map
|