@weasel-js/core 0.6.0 → 0.7.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 +233 -0
- package/dist/{DrawCommand-Dl0bXNfS.d.ts → DrawCommand-CJtqqt8H.d.ts} +26 -2
- package/dist/{chunk-7V6JEOXE.js → chunk-2J6V527H.js} +10033 -10912
- package/dist/chunk-2J6V527H.js.map +1 -0
- package/dist/chunk-SYM6RAM4.js +232 -0
- package/dist/chunk-SYM6RAM4.js.map +1 -0
- package/dist/clone.d.ts +1 -1
- package/dist/geometry-D9BDMiQi.d.ts +114 -0
- package/dist/{grid-Cf87knjU.d.ts → grid-CaSK9bHV.d.ts} +1 -1
- package/dist/index-DOYRTfP0.d.ts +2986 -0
- package/dist/index.css +0 -35
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +1174 -2481
- package/dist/index.js +2 -2
- package/dist/insert.d.ts +2 -2
- package/dist/move.d.ts +3 -3
- package/dist/{options-BPPBWMa7.d.ts → options-DMWeTELe.d.ts} +1 -1
- package/dist/{pointSnapToGrid-D7s7QmOF.d.ts → pointSnapToGrid-C3EruUwt.d.ts} +3 -54
- package/dist/renderer.css +0 -35
- package/dist/renderer.css.map +1 -1
- package/dist/renderer.d.ts +30 -5
- package/dist/renderer.js +2 -2
- package/dist/resize.d.ts +3 -3
- package/dist/routing.d.ts +10 -8
- package/dist/routing.js +1 -1
- package/dist/{types-BjUi2vA-.d.ts → types-Dcaa0tPq.d.ts} +1 -25
- package/dist/{registerFont-CP-wCsrz.d.ts → viewToMat3-D4lrBigW.d.ts} +2 -44
- package/package.json +6 -5
- package/dist/chunk-7V6JEOXE.js.map +0 -1
- package/dist/chunk-AM6ARSPN.js +0 -517
- package/dist/chunk-AM6ARSPN.js.map +0 -1
- package/dist/fitViewToBounds-evGsnR8Q.d.ts +0 -62
- package/dist/index-DZBYMsHI.d.ts +0 -1555
- package/dist/routing.css +0 -35
- package/dist/routing.css.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { ALWAYS, ActionDisabledReason, ActionsProvider, ActionsProviderIfRoot, ActiveToolContextProvider, ActiveToolContextProviderIfRoot, BUNDLE_TOOLS, CURVE_REPS, ColorOverrideRegistry, CropIcon, CursorCoordsHud, DEFAULT_ALPHA_DECAY, DEFAULT_ALPHA_MIN, DEFAULT_DEBUG_THEME, DEFAULT_FILL_COLOR, DEFAULT_HANDLE_SIZE, DEFAULT_PALETTE, DEFAULT_ROTATION_HANDLE_DISTANCE, DEFAULT_STROKE_COLOR, DEFAULT_TEXT_STYLE, DEFAULT_VELOCITY_DECAY, DepRegistryProvider, DepRegistryProviderIfRoot, DivideIcon, EASINGS, EllipseIcon, ExcludeIcon, EyedropperIcon, FALLBACK_FIT_VIEW, GHOST_STROKE, HandIcon, IDENTITY_POSE_COMPOSITION, IntersectIcon, KIT_SHAPE_KINDS, LassoIcon, LineIcon, MOVE_ANCHORS, MinimapCanvas, NEVER, PenIcon, PencilIcon, PickHud, PointerProviderIfRoot, PolygonIcon, RECT_ALIGN_PROJECTION, RectIcon, SPRING_PRESETS, SceneCanvas, SceneViewCanvas, SelectIcon, SelectionContextProvider, SelectionContextProviderIfRoot, StarIcon, SubtractIcon, TextIcon, UnionIcon, UnknownIcon, WeaselProvider, aabbCenter, actionIs, alignDeltaFor, alignInsertBehavior, alignMoveBehavior, alignResizeBehavior, alignedStrokeRect, always, and, animateLifecycle, animateOnSetPose, applyBooleanOp, applyHitExistingGate, areaSelectAction, arrayAdapter, asNodeId, bezierCubic, bezierQuadratic, buildChromeCtx, buildRuleCtx, buildSceneViewCommands, canBringForward, canSendBackward, capabilityAll, capabilityIn, capabilityIs, capabilityNot, caretIndexAt, cellAt, charOffsetToDomPosition, clampView, clearSelectionAction, clientToCanvas, cloneAction, composeAffordanceLayer, composePath, composeRectPose, composeSelectionPose, composeWorldPose, computeFitView, computeIndicatorCommand, computeWheelAction, cond, constrainTo45, containedThenNearest, countPathAnchors,
|
|
2
|
-
export { routing_exports as routing } from './chunk-
|
|
1
|
+
export { ALWAYS, ActionDisabledReason, ActionsProvider, ActionsProviderIfRoot, ActiveToolContextProvider, ActiveToolContextProviderIfRoot, BUNDLE_TOOLS, CURVE_REPS, ColorOverrideRegistry, CropIcon, CursorCoordsHud, DEFAULT_ALPHA_DECAY, DEFAULT_ALPHA_MIN, DEFAULT_DEBUG_THEME, DEFAULT_FILL_COLOR, DEFAULT_HANDLE_SIZE, DEFAULT_PALETTE, DEFAULT_ROTATION_HANDLE_DISTANCE, DEFAULT_STROKE_COLOR, DEFAULT_TEXT_STYLE, DEFAULT_VELOCITY_DECAY, DepRegistryProvider, DepRegistryProviderIfRoot, DivideIcon, EASINGS, EllipseIcon, ExcludeIcon, EyedropperIcon, FALLBACK_FIT_VIEW, GHOST_STROKE, HandIcon, IDENTITY_POSE_COMPOSITION, IntersectIcon, KIT_SHAPE_KINDS, LassoIcon, LineIcon, MIXED, MOVE_ANCHORS, MinimapCanvas, NEVER, PATH_ANCHOR_CHROME_ID, PenIcon, PencilIcon, PickHud, PointerProviderIfRoot, PolygonIcon, RECT_ALIGN_PROJECTION, RectIcon, SPRING_PRESETS, SceneCanvas, SceneViewCanvas, SelectIcon, SelectionContextProvider, SelectionContextProviderIfRoot, StarIcon, SubtractIcon, TextIcon, UnionIcon, UnknownIcon, VERSION, WeaselProvider, aabbCenter, actionIs, alignDeltaFor, alignInsertBehavior, alignMoveBehavior, alignResizeBehavior, alignedStrokeRect, always, and, animateLifecycle, animateOnSetPose, annulusSemiAxes, applyBooleanOp, applyHitExistingGate, applyStyleToRange, areaSelectAction, arrayAdapter, asNodeId, bezierCubic, bezierQuadratic, buildChromeCtx, buildRuleCtx, buildSceneViewCommands, canBringForward, canQueryLocalFonts2 as canQueryLocalFonts, canSendBackward, capabilityAll, capabilityIn, capabilityIs, capabilityNot, caretIndexAt, cellAt, charOffsetToDomPosition, clampView, clearSelectionAction, clientToCanvas, cloneAction, composeAffordanceLayer, composePath, composeRectPose, composeSelectionPose, composeWorldPose, computeFitView, 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, createViewportLayer, cycleVertexColors, decomposePath, decomposeRectPose, defaultCommitAdapter, defaultDrawOne, defaultLabelTextRenderer, defaultNodeProperties, defaultNodeRouting, defaultVisibilityRules, deriveAlignmentGuides, deriveParallaxView, describeRule, domPositionToCharOffset, domToRuns, drawLayers, 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, evaluateEnabled, findNodeShape, findShapeInk, findShapeSilhouette, fitTextPose, fitToBounds, fitViewToBounds, fitZoom, focused, fontString, forEachCoalesced, freeform, gateLayer, gesturing, getAlpha01, getImageBitmap, getNodeShapes, getStylusData, hasFontOutlines2 as hasFontOutlines, hexToRgba, hitAffordanceRegions, hitAnchor, hitRotationHandle, hovering, hoveringSelected, imageStatus, inferredNodeProperties, inferredNodeRouting, insertAction, isCanvasFont2 as isCanvasFont, isEditableTarget, lassoSelectAction, layoutMarkdown, lerpColorArray, lerpOklab, lerpOklch, linear, listFontOutlines2 as listFontOutlines, makeViewportZoomAction, markdownToRuns, matchAlignment, matchesKeyBinding, measureText, measureTextBounds, measuredWidth, mergeAlphaFromPrev, modeIn, modeIs, modeNot, modifierHeld, momentum, moveAction, multiActive, nearest, nearestWithin, nestedHitTester, never, none, normalizeHex, not, nurbs, oklabToOklch, oklabToSrgbU8, oklchToOklab, openFilePicker, or, outlineStatus2 as outlineStatus, 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, registerNodeShape, renderLabel, renderSceneToCanvas, renderSceneToPixels, resizeAction, resolveColor, resolveRuns, resolveTextStyle, resolveVisibility, rgbaToHex, rotateAction, rotateAroundAABBCenter, rotatePathAround, rotatePoint, rotatedRectCorners, rotationDegreesUnit, rotationHandle, roundToCell, runsToDom, runsToMarkdown, runsToPlainText, sceneFromJSON, sceneNodeClientRect, sceneToAdapter, screenToWorld, selectFromLasso, selectionAtLeast, selectionEmpty, selectionIs, shapeCoversPoint, sliceAction, snapPoint, solidVertexColors, specificity, spiro, splitPathByLine, splitSubpaths, springPose, springVertexColors, srgbU8ToOklab, staggerVertexColors, startThresholdDrag, styleAtRange, subscribeGlyphReady2 as subscribeGlyphReady, subscribeImageReady, textCommand, textLineBoxes, tileGrid, toHex8, toRuns, translatePoseViaDescriptor, translateRectPose, tweenPose, tweenVertexColors, unionBounds, unionBoundsPath, unregisterCanvasFont2 as unregisterCanvasFont, unregisterFontOutlines2 as unregisterFontOutlines, useAction, useActionsRegistry, useActiveToolContext, useAlign, useAnimator, useArrayAdapter, useAutoCenter, useBooleans, useBooleansAdapter, useCanvasFocus, useCanvasSize, useDecayLoop, useDepRegistry, useDepSource, useDistribute, useDragGesture, useDragHandle, useDragRadial, useDragRect, useDropZone, useEllipseTool, useEyedropperTool, useGestureDispatcher, useGridCellHover, useGuides, useHandTool, useHandleDrag, useHoverTracking, useImageTool, useKeybindings, useLassoTool, useLineTool, useOptionalActiveToolContext, useOptionalDepRegistry, 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, useViewTween, useZoom, verticalAlignOffset, viewToMat3, viewToTransform, viewportDragPanAction, viewportZoomAction, when, withAlpha01, withCoord, worldEditToStorage, worldPoseLookup, worldToScreen, zoomAt, zoomAtLeast } from './chunk-2J6V527H.js';
|
|
2
|
+
export { routing_exports as routing } from './chunk-SYM6RAM4.js';
|
|
3
3
|
export { createReparentOp, createTransformOp, deleteScratch, getScratch, scratchKey, setScratch, snap } from './chunk-VOVKONXA.js';
|
|
4
4
|
export { CORNER_ANCHORS, cornerPoint, cornerResizeHandles, hitCornerHandle, pointSnapToGrid } from './chunk-BGGZ4CVF.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, meanScale, pathPoseDescriptor, pointInPath, pointToGridCell, polygonFromPoints, rectPath, regularPolygonPath, resolveUnit, scalePathToBounds, starPath, transformPath, translatePath, translatePolygonInPlace } from './chunk-CQNKCG34.js';
|
package/dist/insert.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { U as UseInsertOptions } from './options-
|
|
2
|
-
import { M as ModifierState, I as InsertBehavior } from './types-
|
|
1
|
+
export { U as UseInsertOptions } from './options-DMWeTELe.js';
|
|
2
|
+
import { M as ModifierState, I as InsertBehavior } from './types-Dcaa0tPq.js';
|
|
3
3
|
import { G as Guide } from './types-D2tTKEU0.js';
|
|
4
4
|
import { V as View } from './view-DSQgxBJB.js';
|
|
5
5
|
import '@weasel-js/history';
|
package/dist/move.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { O as OriginProjection } from './grid-
|
|
2
|
-
export { U as UseMoveOptions } from './grid-
|
|
3
|
-
import { M as ModifierState,
|
|
1
|
+
import { O as OriginProjection } from './grid-CaSK9bHV.js';
|
|
2
|
+
export { U as UseMoveOptions } from './grid-CaSK9bHV.js';
|
|
3
|
+
import { M as ModifierState, b as MoveBehavior } from './types-Dcaa0tPq.js';
|
|
4
4
|
import { S as SnapTarget } from './types-B_-khFM0.js';
|
|
5
5
|
import { G as Guide } from './types-D2tTKEU0.js';
|
|
6
6
|
import { V as View } from './view-DSQgxBJB.js';
|
|
@@ -1,58 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { B as Bounds } from './
|
|
1
|
+
import { c as ResizeAnchor, R as ResizePose, B as BoundsConstraint, P as PointSnapBehavior, d as PointSnapFrame, M as ModifierState } from './types-Dcaa0tPq.js';
|
|
2
|
+
import { B as Bounds, P as PoseProjection } from './geometry-D9BDMiQi.js';
|
|
3
3
|
import { D as DebugSink } from './types-BJ8_cyT7.js';
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* Bridges arbitrary `TPose` shapes into the resize hook's bounds-driven math.
|
|
7
|
-
* The hook reads bounds via `getBounds`, runs anchor-relative math on those
|
|
8
|
-
* bounds, then asks `remapBounds` to project the result back into TPose.
|
|
9
|
-
*
|
|
10
|
-
* `remapBounds(pose, src, dst)` is a single operation that subsumes both
|
|
11
|
-
* "set my own AABB to dst" (single-leaf resize) and "scale me as a leaf
|
|
12
|
-
* inside parent's src→dst rect" (group resize) — they're the same affine
|
|
13
|
-
* map. For rect-shaped poses the default geometry interprets the pose as
|
|
14
|
-
* its own bounds; for Path or polygon poses the consumer supplies a
|
|
15
|
-
* projection that knows how to read and rewrite the underlying geometry.
|
|
16
|
-
*/
|
|
17
|
-
interface PoseProjection<TPose> {
|
|
18
|
-
getBounds(pose: TPose): ResizePose;
|
|
19
|
-
remapBounds(pose: TPose, src: ResizePose, dst: ResizePose): TPose;
|
|
20
|
-
/** Translate the pose by (dx, dy). Optional — when omitted, callers fall
|
|
21
|
-
* back to a translation derived from `remapBounds` (origin shifted, no
|
|
22
|
-
* scale). Path-shaped poses should provide this for performance. */
|
|
23
|
-
translate?(pose: TPose, dx: number, dy: number): TPose;
|
|
24
|
-
/** True iff any portion of the pose's geometry intersects `rect`. Optional
|
|
25
|
-
* — when omitted, area-select and similar callers test against `getBounds`
|
|
26
|
-
* AABB (looser, but correct for axis-aligned rect poses). */
|
|
27
|
-
intersectsRect?(pose: TPose, rect: ResizePose): boolean;
|
|
28
|
-
/** Interpolate between two poses. Optional — animation helpers fall back to
|
|
29
|
-
* rect-shape lerp when omitted (which fails for non-rect poses). */
|
|
30
|
-
lerp?(a: TPose, b: TPose, t: number): TPose;
|
|
31
|
-
/** Read the pose's rotation in radians. Pivot is the AABB center
|
|
32
|
-
* (`getBounds(pose)` center). Default 0 when omitted — descriptor
|
|
33
|
-
* declares "this pose has no rotation." When supplied and non-zero,
|
|
34
|
-
* `useResize` projects the drag delta into the leaf's local frame,
|
|
35
|
-
* runs anchor math there, and translates the resulting pose so the
|
|
36
|
-
* diagonally opposite world-space corner is pinned. */
|
|
37
|
-
getRotation?(pose: TPose): number;
|
|
38
|
-
/** True iff this pose shape can carry a rotation. Consulted by the
|
|
39
|
-
* rotation affordance to decide whether to render the rotate cursor /
|
|
40
|
-
* drag-band over a selection. When omitted, the kit assumes `true` for
|
|
41
|
-
* back-compat — descriptors whose poses lack `x/y/width/height/rotation`
|
|
42
|
-
* fields (e.g. polygon Paths) should return `false` so the affordance
|
|
43
|
-
* hides instead of exposing a non-functional rotate cursor. */
|
|
44
|
-
supportsRotation?(pose: TPose): boolean;
|
|
45
|
-
}
|
|
46
|
-
/** Identity geometry for `TPose extends ResizePose`. Treats the pose as its
|
|
47
|
-
* own bounds and remaps via affine scale against `src`/`dst`. */
|
|
48
|
-
declare const RECT_POSE_DESCRIPTOR: PoseProjection<ResizePose>;
|
|
49
|
-
/** Identity geometry for `RotatedPose`. Inherits rect-shape projection
|
|
50
|
-
* from `RECT_POSE_DESCRIPTOR` (the `RotatedPose extends ResizePose`
|
|
51
|
-
* subtype lets the rect descriptor's methods apply directly; `remapBounds`
|
|
52
|
-
* preserves the `rotation` field via `...p` spread). Adds `getRotation` so
|
|
53
|
-
* `useResize` knows to take the rotation-aware math path. */
|
|
54
|
-
declare const ROTATED_POSE_DESCRIPTOR: PoseProjection<RotatedPose>;
|
|
55
|
-
|
|
56
5
|
/** Corner resize-handle: world-space center plus the anchor that pins the opposite corner during resize. */
|
|
57
6
|
interface CornerHandle {
|
|
58
7
|
cx: number;
|
|
@@ -182,4 +131,4 @@ declare function pointSnapToGrid<TPose extends ResizePose>(args: {
|
|
|
182
131
|
bypassKey?: keyof ModifierState;
|
|
183
132
|
}): PointSnapBehavior<TPose>;
|
|
184
133
|
|
|
185
|
-
export { CORNER_ANCHORS as C, type
|
|
134
|
+
export { CORNER_ANCHORS as C, type UseResizeOptions as U, type CornerAnchor as a, type CornerHandle as b, cornerPoint as c, cornerResizeHandles as d, type CornerEdge as e, fixedCornerOf as f, hitCornerHandle as h, pointSnapToGrid as p };
|
package/dist/renderer.css
CHANGED
|
@@ -1,38 +1,3 @@
|
|
|
1
|
-
/* src/tools/routing/reflection/ToolDebugOverlay.module.css */
|
|
2
|
-
.overlay {
|
|
3
|
-
position: absolute;
|
|
4
|
-
bottom: 12px;
|
|
5
|
-
right: 12px;
|
|
6
|
-
min-width: 180px;
|
|
7
|
-
padding: 8px 10px;
|
|
8
|
-
background: rgba(20, 20, 24, 0.86);
|
|
9
|
-
color: #eaeaea;
|
|
10
|
-
font:
|
|
11
|
-
11px/1.4 ui-monospace,
|
|
12
|
-
"SF Mono",
|
|
13
|
-
Menlo,
|
|
14
|
-
monospace;
|
|
15
|
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
16
|
-
border-radius: 4px;
|
|
17
|
-
pointer-events: none;
|
|
18
|
-
user-select: none;
|
|
19
|
-
}
|
|
20
|
-
.row {
|
|
21
|
-
display: flex;
|
|
22
|
-
justify-content: space-between;
|
|
23
|
-
gap: 12px;
|
|
24
|
-
}
|
|
25
|
-
.label {
|
|
26
|
-
color: #888;
|
|
27
|
-
}
|
|
28
|
-
.value {
|
|
29
|
-
color: #f5f5f5;
|
|
30
|
-
}
|
|
31
|
-
.empty {
|
|
32
|
-
color: #888;
|
|
33
|
-
font-style: italic;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
1
|
/* src/canvas/PickHud.module.css */
|
|
37
2
|
.hud {
|
|
38
3
|
position: fixed;
|
package/dist/renderer.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/
|
|
1
|
+
{"version":3,"sources":["../src/canvas/PickHud.module.css","../src/canvas/ModalityHud.module.css"],"sourcesContent":[".hud {\n position: fixed;\n z-index: 10000;\n background: rgba(0, 0, 0, 0.7);\n color: #e8e8e8;\n font: 11px ui-monospace, SFMono-Regular, Menlo, monospace;\n padding: 6px 8px;\n border-radius: 4px;\n pointer-events: none;\n line-height: 1.4;\n text-align: right;\n min-width: 120px;\n max-width: 260px;\n}\n\n.header {\n color: #888;\n margin-bottom: 2px;\n}\n\n.empty {\n color: #888;\n font-style: italic;\n}\n\n.list {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 1px;\n}\n\n.item {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.itemBest {\n font-weight: 700;\n}\n",".hud {\n position: fixed;\n z-index: 10000;\n background: rgba(0, 0, 0, 0.7);\n color: #e8e8e8;\n font: 11px ui-monospace, SFMono-Regular, Menlo, monospace;\n padding: 6px 8px;\n border-radius: 4px;\n pointer-events: none;\n line-height: 1.4;\n text-align: right;\n min-width: 120px;\n max-width: 260px;\n}\n\n.row {\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n white-space: nowrap;\n}\n\n.label {\n color: #888;\n}\n\n.value {\n color: #e8e8e8;\n}\n\n.valueMuted {\n color: #888;\n font-style: italic;\n}\n\n.stack {\n display: flex;\n flex-direction: column;\n gap: 0;\n align-items: flex-end;\n}\n"],"mappings":";AAAA,CAAC;AACC,YAAU;AACV,WAAS;AACT,cAAY,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AAC1B,SAAO;AACP;AAAA,IAAM,KAAK,YAAY;AAAA,IAAE,cAAc;AAAA,IAAE,KAAK;AAAA,IAAE;AAChD,WAAS,IAAI;AACb,iBAAe;AACf,kBAAgB;AAChB,eAAa;AACb,cAAY;AACZ,aAAW;AACX,aAAW;AACb;AAEA,CAAC;AACC,SAAO;AACP,iBAAe;AACjB;AAEA,CAAC;AACC,SAAO;AACP,cAAY;AACd;AAEA,CAAC;AACC,cAAY;AACZ,UAAQ;AACR,WAAS;AACT,WAAS;AACT,kBAAgB;AAChB,OAAK;AACP;AAEA,CAAC;AACC,eAAa;AACb,YAAU;AACV,iBAAe;AACjB;AAEA,CAAC;AACC,eAAa;AACf;;;AC1CA,CAAC;AACC,YAAU;AACV,WAAS;AACT,cAAY,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AAC1B,SAAO;AACP;AAAA,IAAM,KAAK,YAAY;AAAA,IAAE,cAAc;AAAA,IAAE,KAAK;AAAA,IAAE;AAChD,WAAS,IAAI;AACb,iBAAe;AACf,kBAAgB;AAChB,eAAa;AACb,cAAY;AACZ,aAAW;AACX,aAAW;AACb;AAEA,CAAC;AACC,WAAS;AACT,OAAK;AACL,mBAAiB;AACjB,eAAa;AACf;AAEA,CAAC;AACC,SAAO;AACT;AAEA,CAAC;AACC,SAAO;AACT;AAEA,CAAC;AACC,SAAO;AACP,cAAY;AACd;AAEA,CAAC;AACC,WAAS;AACT,kBAAgB;AAChB,OAAK;AACL,eAAa;AACf;","names":[]}
|
package/dist/renderer.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { I as ImageMinification, G as GLImageCache } from './
|
|
2
|
-
export { V as ViewLike,
|
|
3
|
-
import { G as GradStop, M as Mat3, S as ShaderProgramHandle, D as DrawCommand, a as Stroke } from './DrawCommand-
|
|
4
|
-
export { b as GroupDrawCommand, I as ImageDrawCommand, P as PathDrawCommand, c as ShaderDrawCommand, d as ShaderUniform, e as SolidPaint, T as TextDrawCommand, m as mat3, r as registerProgram } from './DrawCommand-
|
|
1
|
+
import { I as ImageMinification, G as GLImageCache } from './viewToMat3-D4lrBigW.js';
|
|
2
|
+
export { V as ViewLike, v as viewToMat3 } from './viewToMat3-D4lrBigW.js';
|
|
3
|
+
import { G as GradStop, M as Mat3, S as ShaderProgramHandle, D as DrawCommand, a as Stroke } from './DrawCommand-CJtqqt8H.js';
|
|
4
|
+
export { b as GroupDrawCommand, I as ImageDrawCommand, P as PathDrawCommand, c as ShaderDrawCommand, d as ShaderUniform, e as SolidPaint, T as TextDrawCommand, m as mat3, r as registerProgram } from './DrawCommand-CJtqqt8H.js';
|
|
5
5
|
import { P as Path } from './types-B6MMiodD.js';
|
|
6
|
+
export { canQueryLocalFonts, enableLocalFontOutlines, hasFontOutlines, isCanvasFont, listFontOutlines, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, subscribeGlyphReady, unregisterCanvasFont, unregisterFontOutlines } from '@weasel-js/font';
|
|
6
7
|
export { T as TextureHandle, r as registerTexture } from './registerTexture-BzHTLhD9.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -248,6 +249,14 @@ interface WeaselRendererOptions {
|
|
|
248
249
|
* Default DEFAULT_BAKE_BUDGET (16). The headless renderSceneToPixels
|
|
249
250
|
* path passes Infinity so print never defers a glyph. */
|
|
250
251
|
bakeBudget?: number;
|
|
252
|
+
/** On-screen glyph size, in CSS pixels, at or above which text renders from
|
|
253
|
+
* tessellated font outlines instead of a distance field — see
|
|
254
|
+
* `OUTLINE_MIN_SCREEN_PX`. Only faces registered with
|
|
255
|
+
* `registerFontOutlines` are affected; everything else keeps its SDF tier
|
|
256
|
+
* whatever this says. Pass `Infinity` to disable the tier outright, or 0
|
|
257
|
+
* to use outlines wherever they exist (what the headless path does, since
|
|
258
|
+
* print has no reason to sample a field it could evaluate exactly). */
|
|
259
|
+
textOutlineMinScreenSize?: number;
|
|
251
260
|
}
|
|
252
261
|
declare class WeaselRenderer {
|
|
253
262
|
private readonly gl;
|
|
@@ -276,6 +285,7 @@ declare class WeaselRenderer {
|
|
|
276
285
|
private readonly imageMinification;
|
|
277
286
|
private readonly flattenTolerance?;
|
|
278
287
|
private readonly bakeBudget;
|
|
288
|
+
private readonly textOutlineMinScreenSize;
|
|
279
289
|
private contextLost;
|
|
280
290
|
private boundOnLost;
|
|
281
291
|
private boundOnRestored;
|
|
@@ -373,4 +383,19 @@ interface StrokeOptions {
|
|
|
373
383
|
*/
|
|
374
384
|
declare function tessellateStroke(path: Path, stroke: Stroke, opts?: StrokeOptions): Mesh;
|
|
375
385
|
|
|
376
|
-
|
|
386
|
+
/**
|
|
387
|
+
* On-screen glyph size (CSS px) at or above which a face with registered
|
|
388
|
+
* outlines is drawn as geometry instead of sampled from a distance field.
|
|
389
|
+
*
|
|
390
|
+
* 48 is the dynamic tier's own `BAKE_SIZE`, which makes it the size at which
|
|
391
|
+
* that tier stops being an interpolation and starts being a magnification:
|
|
392
|
+
* `glyphRasterizer.ts` measures coverage error bottoming out *at* the bake
|
|
393
|
+
* size and rising on both sides, and past a few times it the reconstructed
|
|
394
|
+
* field shows the raster as contour wobble. The same number is a safe
|
|
395
|
+
* crossing for the baked MSDF atlas, which is still crisp here — outlines are
|
|
396
|
+
* exact, so switching early costs nothing but the tessellation, and the
|
|
397
|
+
* hinting the atlas has and outlines don't stopped mattering well below this.
|
|
398
|
+
*/
|
|
399
|
+
declare const OUTLINE_MIN_SCREEN_PX = 48;
|
|
400
|
+
|
|
401
|
+
export { DrawCommand, IDENTITY_COLOR_MATRIX, ImageMinification, Mat3, type Mesh, OUTLINE_MIN_SCREEN_PX, ShaderCompileError, ShaderProgramHandle, type StrokeOptions, type TessellateOptions, WeaselRenderer, type WeaselRendererOptions, buildGradientRamp, tessellate, tessellateStroke };
|
package/dist/renderer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { IDENTITY_COLOR_MATRIX, ShaderCompileError, WeaselRenderer, buildGradientRamp, isCanvasFont, mat3, registerCanvasFont, registerFont, registerProgram, subscribeGlyphReady, tessellate, tessellateStroke, unregisterCanvasFont, viewToMat3 } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { IDENTITY_COLOR_MATRIX, OUTLINE_MIN_SCREEN_PX, ShaderCompileError, WeaselRenderer, buildGradientRamp, canQueryLocalFonts, enableLocalFontOutlines, hasFontOutlines, isCanvasFont, listFontOutlines, mat3, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, registerProgram, subscribeGlyphReady, tessellate, tessellateStroke, unregisterCanvasFont, unregisterFontOutlines, viewToMat3 } from './chunk-2J6V527H.js';
|
|
2
|
+
import './chunk-SYM6RAM4.js';
|
|
3
3
|
import './chunk-VOVKONXA.js';
|
|
4
4
|
import './chunk-BGGZ4CVF.js';
|
|
5
5
|
import './chunk-CQNKCG34.js';
|
package/dist/resize.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { C as CORNER_ANCHORS, a as CornerAnchor, b as CornerHandle,
|
|
2
|
-
|
|
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-C3EruUwt.js';
|
|
2
|
+
export { P as PoseProjection, R as RECT_POSE_DESCRIPTOR, a as ROTATED_POSE_DESCRIPTOR } from './geometry-D9BDMiQi.js';
|
|
3
|
+
import { R as ResizePose, B as BoundsConstraint, M as ModifierState } from './types-Dcaa0tPq.js';
|
|
3
4
|
import { G as Guide } from './types-D2tTKEU0.js';
|
|
4
5
|
import { V as View } from './view-DSQgxBJB.js';
|
|
5
|
-
import './fitViewToBounds-evGsnR8Q.js';
|
|
6
6
|
import './types-BJ8_cyT7.js';
|
|
7
7
|
import '@weasel-js/history';
|
|
8
8
|
import './types-B_-khFM0.js';
|
package/dist/routing.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { ChannelRef, DescribeRouteOptions, GESTURE_DESCRIPTORS, GestureArgSpec, GestureDescriptor, GestureName, ModRequirement,
|
|
1
|
+
export { aX as Conflict, aY as PREDICATE_TARGET, aZ as RegistryEntry, a_ as ToolDef, k as ToolKeybinding, a$ as ToolScopes, b0 as ViewportToolDef, b1 as buildRouteRegistry, b2 as defineTool, b3 as defineViewportTool, b4 as findConflicts, b5 as findScopedConflicts, b6 as formatConflict, b7 as reportRouteConflicts } from './index-DOYRTfP0.js';
|
|
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
3
|
import './types-Cpb4hii1.js';
|
|
4
4
|
import '@weasel-js/history';
|
|
5
5
|
import './types-B6MMiodD.js';
|
|
6
|
-
import '
|
|
7
|
-
import './view-DSQgxBJB.js';
|
|
8
|
-
import './types-BjUi2vA-.js';
|
|
6
|
+
import './types-Dcaa0tPq.js';
|
|
9
7
|
import './types-B_-khFM0.js';
|
|
10
|
-
import './
|
|
11
|
-
import '
|
|
8
|
+
import './view-DSQgxBJB.js';
|
|
9
|
+
import '@weasel-js/modes';
|
|
10
|
+
import 'react';
|
|
11
|
+
import './DrawCommand-CJtqqt8H.js';
|
|
12
12
|
import './registerTexture-BzHTLhD9.js';
|
|
13
|
+
import 'react/jsx-runtime';
|
|
14
|
+
import './geometry-D9BDMiQi.js';
|
|
15
|
+
import '@weasel-js/geom';
|
|
13
16
|
import './types-BJ8_cyT7.js';
|
|
14
|
-
import '@weasel-js/modes';
|
package/dist/routing.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { GESTURE_DESCRIPTORS, RESERVED_ID_NAMES, RESERVED_ID_PREFIXES, ROUTE_FIELD_DEFINITIONS, ROUTE_TERMS,
|
|
1
|
+
export { GESTURE_DESCRIPTORS, PREDICATE_TARGET, RESERVED_ID_NAMES, RESERVED_ID_PREFIXES, ROUTE_FIELD_DEFINITIONS, ROUTE_TERMS, buildRouteRegistry, canonicalModifiers, collapseShiftPairs, defineTool, defineViewportTool, describeRoute, describeRouteParts, findConflicts, findScopedConflicts, formatConflict, formatPhaseAtom, formatRoute, getGestureDescriptor, isKnownGestureName, parseRoute, reportRouteConflicts } from './chunk-SYM6RAM4.js';
|
|
2
2
|
import './chunk-PZ5AY32C.js';
|
|
3
3
|
//# sourceMappingURL=routing.js.map
|
|
4
4
|
//# sourceMappingURL=routing.js.map
|
|
@@ -217,30 +217,6 @@ interface InsertOverlay<TPose> {
|
|
|
217
217
|
/** TPose constructed from `bounds` via the hook's `posefromBounds`. */
|
|
218
218
|
pose: TPose;
|
|
219
219
|
}
|
|
220
|
-
/** Pose carried through area-select gestures: the world point under the
|
|
221
|
-
* cursor at gesture start, plus the shift-key state at start. */
|
|
222
|
-
interface AreaSelectPose {
|
|
223
|
-
worldX: number;
|
|
224
|
-
worldY: number;
|
|
225
|
-
shiftHeld: boolean;
|
|
226
|
-
}
|
|
227
|
-
/** Per-frame proposed area-select state: start point, current point, and shift policy. */
|
|
228
|
-
interface AreaSelectProposed {
|
|
229
|
-
start: {
|
|
230
|
-
worldX: number;
|
|
231
|
-
worldY: number;
|
|
232
|
-
};
|
|
233
|
-
current: {
|
|
234
|
-
worldX: number;
|
|
235
|
-
worldY: number;
|
|
236
|
-
};
|
|
237
|
-
shiftHeld: boolean;
|
|
238
|
-
}
|
|
239
|
-
/** onMove for area-select doesn't shape ops; behaviors only need to react in
|
|
240
|
-
* onEnd. We return void from onMove. */
|
|
241
|
-
type AreaSelectMoveResult = void;
|
|
242
|
-
/** A behavior plugged into `useAreaSelect`. */
|
|
243
|
-
type AreaSelectBehavior = ActionBehavior<AreaSelectPose, AreaSelectProposed, AreaSelectMoveResult>;
|
|
244
220
|
/** Live overlay state exposed by `useAreaSelect` for rendering the marquee. */
|
|
245
221
|
interface AreaSelectOverlay {
|
|
246
222
|
start: {
|
|
@@ -352,4 +328,4 @@ interface CloneBehavior {
|
|
|
352
328
|
}) => Op[];
|
|
353
329
|
}
|
|
354
330
|
|
|
355
|
-
export type { ActionBehavior as A, BoundsConstraint as B, CloneBehavior as C,
|
|
331
|
+
export type { ActionBehavior as A, BoundsConstraint as B, CloneBehavior as C, RotateOverlay as D, RotateProposed as E, GestureContext as G, InsertBehavior as I, LassoSelectBehavior as L, ModifierState as M, PointSnapBehavior as P, ResizePose as R, SnapStrategy as S, RotatedPose as a, MoveBehavior as b, ResizeAnchor as c, PointSnapFrame as d, RotateBehavior as e, AreaSelectOverlay as f, BehaviorMoveResult as g, BehaviorResult as h, CloneLayer as i, ClonePose as j, GroupTransform as k, InsertMoveResult as l, InsertOverlay as m, InsertPoint as n, InsertProposed as o, LassoSelectMoveResult as p, LassoSelectOverlay as q, LassoSelectPose as r, LassoSelectProposed as s, PointSnapContext as t, PointSnapResult as u, PointerState as v, ResizeMoveResult as w, ResizeOverlay as x, ResizeProposed as y, RotateMoveResult as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as Mat3 } from './DrawCommand-
|
|
1
|
+
import { M as Mat3 } from './DrawCommand-CJtqqt8H.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* GL texture upload cache for ImageBitmap objects.
|
|
@@ -64,46 +64,4 @@ interface View {
|
|
|
64
64
|
*/
|
|
65
65
|
declare function viewToMat3(view: View): Mat3;
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
* DynamicGlyphAtlas — runtime single-channel SDF glyphs for canvas-sourced
|
|
69
|
-
* (installed machine) fonts. TinySDF technique: canvas fillText at 48 px →
|
|
70
|
-
* Euclidean distance transform → shelf-packed R8 pages (1024², max 4).
|
|
71
|
-
*
|
|
72
|
-
* Baked MSDF atlases always win: this tier only serves families registered
|
|
73
|
-
* via `registerCanvasFont` that have no baked entry (see resolveFontVariant).
|
|
74
|
-
*
|
|
75
|
-
* Faces expose a BmFont-shaped `font` whose charMap grows as glyphs are
|
|
76
|
-
* requested, so `layoutRuns` consumes them through the same code path as
|
|
77
|
-
* baked atlases. A char's advance is valid immediately (measureText); its
|
|
78
|
-
* atlas rect fills in when the bake lands (width 0 / page -1 until then, so
|
|
79
|
-
* layout advances the pen but emits no quad).
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
|
-
/** Mark `family` as canvas-sourced: when no baked atlas covers it,
|
|
83
|
-
* resolveFontVariant serves it from this dynamic atlas. */
|
|
84
|
-
declare function registerCanvasFont(family: string): void;
|
|
85
|
-
declare function isCanvasFont(family: string): boolean;
|
|
86
|
-
/** Remove a canvas family. Its faces are dropped; already-baked glyph
|
|
87
|
-
* pixels stay in their pages (no eviction in v1). */
|
|
88
|
-
declare function unregisterCanvasFont(family: string): void;
|
|
89
|
-
/** Subscribe to deferred-bake completion (fires after each flush batch).
|
|
90
|
-
* `<SceneCanvas>` subscribes and requests a redraw, mirroring
|
|
91
|
-
* `subscribeImageReady`. Returns an unsubscribe. */
|
|
92
|
-
declare function subscribeGlyphReady(cb: () => void): () => void;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* FontRegistry and registerFont() public API.
|
|
96
|
-
*
|
|
97
|
-
* Variants are keyed by (family, weight, style). registerFont() takes a
|
|
98
|
-
* FontVariant alongside the family and the two URLs; the registry stores
|
|
99
|
-
* entries in a two-level Map so resolveFontVariant() can iterate a family's
|
|
100
|
-
* variants for the fallback chain.
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
interface FontVariant {
|
|
104
|
-
weight?: number;
|
|
105
|
-
style?: 'normal' | 'italic';
|
|
106
|
-
}
|
|
107
|
-
declare function registerFont(family: string, variant: FontVariant, metricsUrl: string, atlasUrl: string): Promise<void>;
|
|
108
|
-
|
|
109
|
-
export { type FontVariant as F, GLImageCache as G, type ImageMinification as I, type View as V, registerFont as a, isCanvasFont as i, registerCanvasFont as r, subscribeGlyphReady as s, unregisterCanvasFont as u, viewToMat3 as v };
|
|
67
|
+
export { GLImageCache as G, type ImageMinification as I, type View as V, viewToMat3 as v };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weasel-js/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.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",
|
|
@@ -70,10 +70,11 @@
|
|
|
70
70
|
"react": ">=18"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@weasel-js/
|
|
74
|
-
"@weasel-js/
|
|
75
|
-
"@weasel-js/
|
|
76
|
-
"@weasel-js/
|
|
73
|
+
"@weasel-js/font": "0.7.1",
|
|
74
|
+
"@weasel-js/geom": "0.7.1",
|
|
75
|
+
"@weasel-js/gestures": "0.7.1",
|
|
76
|
+
"@weasel-js/history": "0.7.1",
|
|
77
|
+
"@weasel-js/modes": "0.7.1",
|
|
77
78
|
"earcut": "2.2.4",
|
|
78
79
|
"polygon-clipping": "^0.15.7"
|
|
79
80
|
},
|