@weasel-js/core 1.6.0 → 1.7.0
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 +266 -0
- package/README.md +24 -4
- package/dist/{depSchema-BhgZc0-Q.d.ts → builtins-DLn2lCr_.d.ts} +693 -53
- package/dist/{chunk-BJN5ZRIJ.js → chunk-3TY6FHAF.js} +7 -4
- package/dist/chunk-3TY6FHAF.js.map +1 -0
- package/dist/{chunk-H6N2JSZ3.js → chunk-DGWNNKGD.js} +3 -3
- package/dist/{chunk-H6N2JSZ3.js.map → chunk-DGWNNKGD.js.map} +1 -1
- package/dist/{chunk-THCSDHII.js → chunk-G4ZGQMY7.js} +2453 -1264
- package/dist/chunk-G4ZGQMY7.js.map +1 -0
- package/dist/{chunk-HPFJUUTF.js → chunk-LU4IJ52W.js} +5 -61
- package/dist/chunk-LU4IJ52W.js.map +1 -0
- package/dist/{chunk-D4AAWR64.js → chunk-M24CLARN.js} +4 -4
- package/dist/{chunk-D4AAWR64.js.map → chunk-M24CLARN.js.map} +1 -1
- package/dist/{chunk-4RJP2N2L.js → chunk-NE27EOLP.js} +8 -5
- package/dist/chunk-NE27EOLP.js.map +1 -0
- package/dist/{chunk-DOBSZOPR.js → chunk-UPZY4ART.js} +3 -3
- package/dist/{chunk-DOBSZOPR.js.map → chunk-UPZY4ART.js.map} +1 -1
- package/dist/{chunk-T3UQ3F6R.js → chunk-WPNA6L5O.js} +47 -13
- package/dist/chunk-WPNA6L5O.js.map +1 -0
- package/dist/{chunk-44EWMJV2.js → chunk-XMAWPGTK.js} +5 -5
- package/dist/{chunk-44EWMJV2.js.map → chunk-XMAWPGTK.js.map} +1 -1
- package/dist/clipboard.d.ts +1 -1
- package/dist/clipboard.js +3 -3
- package/dist/clone.d.ts +2 -2
- package/dist/clone.js +3 -3
- package/dist/grid-CY5UKlZh.d.ts +98 -0
- package/dist/index.css +11 -35
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +912 -1148
- package/dist/index.js +9 -9
- package/dist/insert.d.ts +2 -3
- package/dist/insert.js +1 -1
- package/dist/math.d.ts +1 -1
- package/dist/move.d.ts +5 -4
- package/dist/move.js +4 -4
- package/dist/move.js.map +1 -1
- package/dist/patterns-builtin.js +1 -1
- package/dist/{pointSnapToGrid-7mCcm6qG.d.ts → pointSnapToGrid-Dp2IxLGb.d.ts} +53 -60
- package/dist/renderer.css +11 -35
- package/dist/renderer.css.map +1 -1
- package/dist/renderer.d.ts +17 -8
- package/dist/renderer.js +9 -9
- package/dist/resize.d.ts +3 -3
- package/dist/resize.js +2 -2
- package/dist/routing.d.ts +1 -1
- package/dist/routing.js +1 -1
- package/dist/{types-CxC8P6W0.d.ts → types-D-9QWBy5.d.ts} +9 -6
- package/dist/{types-D_74YlWs.d.ts → types-qYpyTAiZ.d.ts} +4 -7
- package/package.json +15 -12
- package/dist/chunk-4RJP2N2L.js.map +0 -1
- package/dist/chunk-BJN5ZRIJ.js.map +0 -1
- package/dist/chunk-HPFJUUTF.js.map +0 -1
- package/dist/chunk-T3UQ3F6R.js.map +0 -1
- package/dist/chunk-THCSDHII.js.map +0 -1
- package/dist/grid-Dx2gQbNv.d.ts +0 -158
- package/dist/options-CzjxFoYZ.d.ts +0 -67
- package/dist/{math-DRa6HBBs.d.ts → math-MCQcf_gc.d.ts} +111 -111
package/dist/index.d.ts
CHANGED
|
@@ -1,68 +1,48 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
import {
|
|
6
|
-
export {
|
|
7
|
-
import {
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import react__default, { RefObject, ReactNode, Ref, MouseEvent, ComponentType, MutableRefObject } from 'react';
|
|
3
|
+
import { UnitValue, UnitSystem, Display, UnitEntry, Unit } from '@weasel-js/quantity';
|
|
4
|
+
export { ANGLE_RADIANS, IMPERIAL_INCHES, METRIC_MM, PIXELS, Unit, UnitEntry, UnitScale, UnitSystem, UnitValue, formatUnit, resolveUnit, unitScale } from '@weasel-js/quantity';
|
|
5
|
+
import { y as RenderLayer, z as Dims, A as Scene, B as RectPose, F as InertiaConfig, V as ViewAnimationOptions, N as Node$1, H as GestureLifecycleOptions, J as PoseComposition, K as SliceDep, L as ToolsApi, O as Tool, Q as Contribution, U as LayerHit, D as DrawCommand, X as ChromeState, Y as VertexColorChannel, Z as RedrawSource, g as ShaderProgramHandle, _ as LayerGroup, $ as InsertExtras, a0 as SerializedScene, a1 as GeometryProjection, a2 as ContentHandlerEntry, a3 as SvgIngestOptions, a4 as AnyTool, a5 as PanBounds, a6 as Animator, a7 as ColorOverrideRegistry, a8 as UseSceneOptions, a9 as SceneRegistry, aa as RegisteredOp, ab as PoseOverrides, ac as DerivedDep, ad as ViewportDims, P as PathDrawCommand, ae as ViewApi, af as Affordance, ag as AffordanceRegion, ah as AffordanceBinding, ai as CommonAffordanceScratch, T as TextDrawCommand, aj as ShaderProgram, G as GlMat3, ak as BooleansAdapter, al as UseAnimatorOptions, am as SpringPresetName, an as EasingSpec, ao as AnimationHandle, ap as SampledTrack } from './builtins-DLn2lCr_.js';
|
|
6
|
+
export { aq as AddLayerSpec, ar as AddNodeSpec, as as AnimateToBoundsOptions, at as AreaSelectDep, au as BezierEasing, av as BooleanOp, aw as BooleanOpResult, ax as ClipboardDep, ay as ClipboardIngestCtx, az as ColorOverride, aA as ColorOverrideFn, aB as ContainerNode, aC as ContributionChrome, C as CullRect, aD as CustomPaintContext, aE as DecayLoopConfig, aF as DecayOptions, aG as EASINGS, aH as EasingFn, aI as EasingName, aJ as EditAnchorsDep, E as Effect, aK as EventBooking, aL as EventBookingHandle, aM as EventTrack, aN as FitViewToBoundsOptions, a as GroupDrawCommand, aO as IDENTITY_POSE_COMPOSITION, b as ImageDrawCommand, c as ImageMinification, aP as IngestCtx, aQ as IngestionDep, aR as InsertDep, aS as Interpolate, aT as InterpolatorFactory, aU as Keyframe, aV as LassoSelectDep, aW as LayerCommandCache, aX as LayerDrawFailure, aY as LayerRecord, aZ as LayoutDep, a_ as LeafNode, a$ as LoopFactory, b0 as LoopOptions, b1 as NestedTimeline, b2 as NodeAtPointDep, b3 as PhysicsHandle, b4 as PhysicsOptions, b5 as PointerContextProvider, b6 as PointerContextValue, b7 as PointerWorldPos, b8 as PoseAdapter, b9 as PoseClosure, ba as PoseOverride, bb as RECT_POSE_COMPOSITION, bc as RIGID_POSE_COMPOSITION, R as RenderTarget, bd as ResizePolicy, be as SPRING_PRESETS, S as SPRITE_STRIDE, bf as SerializedNode, f as ShaderDrawCommand, h as ShaderUniform, bg as SnapDep, bh as SpringOptions, bi as SpringPreset, j as SpriteSheet, k as SpritesDrawCommand, bj as StaggerBuilder, bk as StaggerDelay, bl as StaggerFactory, bm as StaggerOptions, bn as StaggerPerItem, bo as StaggerSpringPoseOptions, bp as StaggerTweenOptions, bq as SvgUnpacker, br as SystemLayerRecord, bs as SystemLayerSpec, bt as TextEditDep, bu as TimelineClock, bv as TimelineEvent, bw as TimelineHandle, bx as TimelineOptions, by as TimelineTrack, bz as ToolDef, bA as Track, bB as TweenLoopOptions, bC as TweenOptions, bD as UseToolsOptions, bE as UserLayerRecord, bF as VIEW_ANIMATION_KEY, bG as ViewAnimationApi, bH as ViewChannel, bI as applyBooleanOp, bJ as asNodeId, n as blur, bK as composeRectPose, bL as composeRigidPose, bM as composeWorldPose, bN as createPointerStore, bO as cubicBezierEasing, p as cullDrawCommands, bP as decomposeRectPose, bQ as decomposeRigidPose, bR as drawLayers, bS as drawOneLayer, bT as easeIn, bU as easeInBack, bV as easeInBounce, bW as easeInCirc, bX as easeInCubic, bY as easeInElastic, bZ as easeInExpo, b_ as easeInOut, b$ as easeInOutBack, c0 as easeInOutBounce, c1 as easeInOutCirc, c2 as easeInOutCubic, c3 as easeInOutElastic, c4 as easeInOutExpo, c5 as easeInOutQuad, c6 as easeInOutQuart, c7 as easeInOutQuint, c8 as easeInOutSine, c9 as easeInQuad, ca as easeInQuart, cb as easeInQuint, cc as easeInSine, cd as easeOut, ce as easeOutBack, cf as easeOutBounce, cg as easeOutCirc, ch as easeOutCubic, ci as easeOutElastic, cj as easeOutExpo, ck as easeOutQuad, cl as easeOutQuart, cm as easeOutQuint, cn as easeOutSine, co as fitViewToBounds, q as frameRect, cp as isLayerPainted, cq as isLayerVisible, cr as linear, r as mat3, cs as rebaseLocalPose, ct as registerContentHandler, t as registerEffect, cu as resolveEasing, cv as resolveStrokeWidth, cw as subscribeToSources, cx as translateRectPose, cy as useDecayLoop, cz as usePointerContext, cA as usePointerPosition, cB as useTools, cC as useViewAnimation, cD as useViewAnimationOn, w as viewToMat3, x as vignette, cE as worldPoseLookup } from './builtins-DLn2lCr_.js';
|
|
7
|
+
import { Stroke, FillStyle, TextureHandle, GradientUnits, ColorSpace, GradStop, TilePatternSpec, GradientKind, GradientFill, MarkerKey, MarkerRef, Palette } from '@weasel-js/paint';
|
|
8
8
|
export { ColorInterpolationSpace, ColorSpace, FillStyle, GradStop, GradientFill, GradientKind, GradientUnits, HueInterpolation, KitMarkerKey, MarkerKey, MarkerRef, OklchDeg, Region, STROKE_DASH_RATIOS, ScreenLength, Stroke, StrokeAlign, StrokeDashStyle, TextureHandle, TilePatternSpec, alignedStrokeRect, contrastLineColor, dashForStrokeStyle, hexToOklchDeg, hslToSrgb, interpolateSrgb, lerpColorArray, lerpOklab, lerpOklch, linearSrgbToOklab, linearToSrgb, oklabToLinearSrgb, oklabToOklch, oklabToSrgbU8, oklchDegToHex, oklchToOklab, resolveScreenLength, srgbFloatToOklab, srgbToHsl, srgbToLinear, srgbU8ToOklab, strokeDashStyleOf } from '@weasel-js/paint';
|
|
9
|
-
import {
|
|
10
|
-
export {
|
|
11
|
-
import {
|
|
12
|
-
export {
|
|
13
|
-
import {
|
|
9
|
+
import { View, HitShape, HandleKind, NodeId, PointerSessionCancelReason, DeviceProfile, Bounds, Action, SelectionMode, SelectionExtendKey, SelectionApi, DepSchema, GestureBinding, ToolKeybinding, HotkeyTrigger, ModifierState, RuleCtx, Rule, IngestItem, OngoingOverlay, DebugSink, DepName, ActionsProp, OverlayRole, ResizeAnchor, Point2 } from '@weasel-js/routing';
|
|
10
|
+
export { ALWAYS, Action, ActionDeps, ActionDisabledReason, ActionDispatch, ActionEnabledResult, ActionEntry, ActionItem, ActionPresentation, ActionVariant, ActionsProp, ActionsRegistry, AffordanceHit, BindingOpts, BindingScope, BindingSource, BoundGesture, Bounds, BuildRuleCtxArgs, COARSE_TARGET_SCALE, ContributionDeps, ContributionRouting, DEFAULT_ALLOWED_CAPABILITIES, DEFAULT_DEVICE_PROFILE, DRAG_THRESHOLD_PX, DebugSink, DepName, DepRegistry, DepSchema, DetectedDeviceFacts, DeviceProfile, Dispatcher, DispatcherContext, DragSample, Eligibility, EligibilityState, GestureBinding, HandleKind, HitShape, HotkeyTrigger, ImmediateInvoker, IngestItem, InputEvent, InvocationCtx, Invoker, MatchResult, ModeShortcutHandlers, ModifierState, NEVER, NodeId, OngoingHandle, OngoingInvoker, OngoingOverlay, OverlayPosition, OverlayRole, Point2, PointerSession, PointerSessionCallbacks, PointerSessionCancelReason, PointerSessionOptions, ResizeAnchor, ResolveAllOptions, ResolveOnlyResult, ResolvedCandidate, Rule, RuleCtx, ScopedBinding, ScratchKey, ScratchStore, SelectionApi, SelectionExtendKey, SelectionMode, Selector, ToolCtx, ToolKeybinding, ToolLifecycleCtx, ToolModifiers, ToolPresentation, ToolSlot, UiOngoingControl, Point2 as Vec2, View, actionBindings, actionItems, buildDepsFromRequires, buildRuleCtx, clientToCanvas, createDepRegistry, createDispatcher, defineTool, deleteScratch, describeRule, evaluate, evaluateEnabled, getScratch, isEditableTarget, liveScope, matchesKeyBinding, modeShortcutSpec, modeShortcuts, openPointerSession, pastDragThreshold, resolveDeviceProfile, resolveParams, scopeBindings, scratchKey, setScratch, specificity } from '@weasel-js/routing';
|
|
11
|
+
import { S as SimulationNode, U as UseSimulationOptions, a as Simulation, P as PathBuilder } from './math-MCQcf_gc.js';
|
|
12
|
+
export { D as DEFAULT_ALPHA_DECAY, b as DEFAULT_ALPHA_MIN, c as DEFAULT_VELOCITY_DECAY, d as PathStation, e as PointAlongPathOptions, f as SimulationCore, g as SimulationForce, h as SimulationOptions, i as aabbCenter, j as createSimulation, k as ellipsePath, l as linePath, p as pointAlongPath, m as pointInRotatedRect, n as polygonFromPoints, o as polylineFromPoints, r as rectCorners, q as rectPath, s as regularPolygonPath, t as rotatePoint, u as rotatedRectCorners, v as starPath } from './math-MCQcf_gc.js';
|
|
13
|
+
import { Yoke } from '@weasel-js/routing/react';
|
|
14
|
+
export { ActionsProvider, ActiveToolContextProvider, ActiveToolContextProviderIfRoot, ActiveToolContextProviderProps, ActiveToolContextValue, DepRegistryProvider, DispatcherChannels, InputScope, OngoingAction, UseGestureDispatcherOptions, Yoke, useAction, useActionsRegistry, useActiveToolContext, useDepRegistry, useDepSource, useGestureDispatcher, useOngoingAction, useOptionalActiveToolContext, useOptionalDepRegistry, useYoke } from '@weasel-js/routing/react';
|
|
15
|
+
import { GestureSpec } from '@weasel-js/gestures';
|
|
14
16
|
export { ClaimableGesture, ClickSpec, DragSpec, DropSpec, GestureSpec, KeyHeldSpec, KeySpec, ModSpec, MultiTouchSpec, PasteSpec, PinchSpec, TargetSpec, WheelSpec } from '@weasel-js/gestures';
|
|
15
|
-
import {
|
|
16
|
-
export {
|
|
17
|
-
import { ToolsApi as ToolsApi$1, UseToolsOptions as UseToolsOptions$1 } from '@weasel-js/routing/react';
|
|
18
|
-
export { ActionsProvider, ActionsScope, ActiveToolContextProvider, ActiveToolContextProviderIfRoot, ActiveToolContextProviderProps, ActiveToolContextValue, DepRegistry, DepRegistryProvider, DispatcherChannels, OngoingAction, UseGestureDispatcherOptions, useAction, useActionsRegistry, useActiveToolContext, useDepRegistry, useDepSource, useGestureDispatcher, useOngoingAction, useOptionalActiveToolContext, useOptionalDepRegistry } from '@weasel-js/routing/react';
|
|
19
|
-
import { B as BoundsConstraint, P as PointSnapBehavior, L as LassoSelectBehavior, R as RotateBehavior, S as SnapStrategy, M as MoveBehavior, I as InsertBehavior } from './types-D_74YlWs.js';
|
|
20
|
-
export { A as ActionBehavior, b as AreaSelectOverlay, c as BehaviorMoveResult, d as BehaviorResult, C as CloneBehavior, e as CloneLayer, f as ClonePose, G as GestureContext, g as GroupTransform, h as InsertMoveResult, i as InsertOverlay, j as InsertPoint, k as InsertProposed, l as LassoSelectMoveResult, m as LassoSelectOverlay, n as LassoSelectPose, o as LassoSelectProposed, p as PointSnapContext, a as PointSnapFrame, q as PointSnapResult, r as PointerState, s as ResizeMoveResult, t as ResizeOverlay, u as ResizeProposed, v as RotateMoveResult, w as RotateOverlay, x as RotateProposed } from './types-D_74YlWs.js';
|
|
17
|
+
import { B as BoundsConstraint, P as PointSnapBehavior, R as RotateBehavior, L as LassoSelectBehavior, S as SnapStrategy, M as MoveBehavior, I as InsertBehavior } from './types-qYpyTAiZ.js';
|
|
18
|
+
export { A as ActionBehavior, b as AreaSelectOverlay, c as BehaviorMoveResult, d as BehaviorResult, C as CloneBehavior, e as CloneLayer, f as ClonePose, G as GestureContext, g as GroupTransform, h as InsertMoveResult, i as InsertOverlay, j as InsertPoint, k as InsertProposed, l as LassoSelectMoveResult, m as LassoSelectOverlay, n as LassoSelectPose, o as LassoSelectProposed, p as PointSnapContext, a as PointSnapFrame, q as PointSnapResult, r as PointerState, s as ResizeMoveResult, t as ResizeOverlay, u as ResizeProposed, v as RotateMoveResult, w as RotateOverlay, x as RotateProposed } from './types-qYpyTAiZ.js';
|
|
21
19
|
import { P as PoseDescriptor, b as RotatedPose } from './poseDescriptor-rZa9W5hJ.js';
|
|
22
20
|
export { R as RECT_POSE_DESCRIPTOR, a as ROTATED_POSE_DESCRIPTOR, p as poseDescriptorForNode, t as translatePoseViaDescriptor, v as visualBoundsViaDescriptor } from './poseDescriptor-rZa9W5hJ.js';
|
|
23
|
-
import { U as UseResizeOptions } from './pointSnapToGrid-
|
|
24
|
-
export { C as CORNER_ANCHORS, a as CornerAnchor, e as CornerEdge, b as CornerHandle, c as cornerPoint, d as cornerResizeHandles, h as hitCornerHandle, p as pointSnapToGrid } from './pointSnapToGrid-
|
|
25
|
-
import { M as MoveAdapter, A as AreaSelectAdapter, c as LassoHitMode, d as LassoSelectAdapter, R as ResizeAdapter, e as RotateAdapter, L as LayoutStrategy, f as LayerEnumerableAdapter, I as InsertAdapter, C as ClipboardSnapshot, b as LayoutDropTargetMode, O as OrderedAdapter, a as SceneAdapter, g as LayoutSnap } from './types-
|
|
26
|
-
export { h as ContainerBounds, D as DropRegion, i as DropTarget, j as LayoutChild, k as LayoutContainer, l as LayoutDragged, S as SnapTarget } from './types-
|
|
21
|
+
import { U as UseResizeOptions } from './pointSnapToGrid-Dp2IxLGb.js';
|
|
22
|
+
export { C as CORNER_ANCHORS, a as CornerAnchor, e as CornerEdge, b as CornerHandle, c as cornerPoint, d as cornerResizeHandles, f as fixedCornerOf, h as hitCornerHandle, p as pointSnapToGrid } from './pointSnapToGrid-Dp2IxLGb.js';
|
|
23
|
+
import { M as MoveAdapter, A as AreaSelectAdapter, c as LassoHitMode, d as LassoSelectAdapter, R as ResizeAdapter, e as RotateAdapter, L as LayoutStrategy, f as LayerEnumerableAdapter, I as InsertAdapter, C as ClipboardSnapshot, b as LayoutDropTargetMode, O as OrderedAdapter, a as SceneAdapter, g as LayoutSnap } from './types-D-9QWBy5.js';
|
|
24
|
+
export { h as ContainerBounds, D as DropRegion, i as DropTarget, j as LayoutChild, k as LayoutContainer, l as LayoutDragged, S as SnapTarget } from './types-D-9QWBy5.js';
|
|
25
|
+
import { U as UseMoveOptions, O as OriginProjection } from './grid-CY5UKlZh.js';
|
|
26
|
+
export { R as RECT_ORIGIN_PROJECTION, g as gridSnapStrategy, p as pointToGridCell } from './grid-CY5UKlZh.js';
|
|
27
27
|
import { a as PolygonPath, P as Path, R as RectPath } from './path-JEV2c5If.js';
|
|
28
28
|
export { b as PathFillRule } from './path-JEV2c5If.js';
|
|
29
|
-
import
|
|
29
|
+
import { PaintedCursorState, CursorSpec } from '@weasel-js/cursor';
|
|
30
|
+
export { BakeOptions, CursorGlyph, CursorGlyphName, CursorGlyphSpec, CursorSpec, PaintedCursor, PaintedCursorFrame, PaintedCursorState, ResolvedCursor, bakeCursor, createPaintedCursorState, cursorFor, resolveCursor, resolveCursorTier } from '@weasel-js/cursor';
|
|
30
31
|
import { Op, HistorySelection, CreateHistoryOptions, History } from '@weasel-js/history';
|
|
31
32
|
export * from '@weasel-js/history';
|
|
32
33
|
export { Op } from '@weasel-js/history';
|
|
34
|
+
import { ModeRegistry, ModeDecorations } from '@weasel-js/modes';
|
|
33
35
|
import { PlacementAlign, Rect, Mat3 } from '@weasel-js/geom';
|
|
34
36
|
export { DEFAULT_FLATTEN_TOLERANCE, PATH_C, PATH_CMD_LENGTHS, PATH_L, PATH_M, PATH_Q, PATH_Z, Rect, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, pathCommandCoordCount } from '@weasel-js/geom';
|
|
35
37
|
import { TextRenderer, TextPose, StyledRun, TextStyle, TextVerticalAlign, TextPaint } from '@weasel-js/text';
|
|
36
38
|
export { DEFAULT_TEXT_STYLE, LaidOutDecoration, LaidOutGroup, LaidOutLineBox, LaidOutOutlineGlyph, LaidOutQuad, LaidOutRuns, LayoutLine, LayoutResult, LayoutRunsOpts, MARKDOWN_RUN_GRAMMAR, MarkdownFontOptions, MeasureFn, MeasureTextBoundsOpts, MeasuredText, PositionedRun, ResolvedRun, ResolvedTextStyle, RunFlag, RunGrammar, RunMarker, RunSourceMap, SCRIPT_METRICS, StyledRun, TextAlign, TextDirection, TextLineBoxesOpts, TextPaint, TextPose, TextPoseLayout, TextPoseLayoutInput, TextRenderer, TextStyle, TextTransform, TextVerticalAlign, TransformedRunText, cachedLayoutRuns, createMarkdownRenderer, fontString, layoutMarkdown, layoutRuns, layoutTextPose, markdownToRuns, measureText, measureTextBounds, measuredWidth, resolveAlign, resolveRuns, resolveTextStyle, runsToMarkdown, runsToPlainText, textLineBoxes, textPoseLayoutInput, toRuns, transformRunTexts, verticalAlignOffset } from '@weasel-js/text';
|
|
39
|
+
import { Reflection } from '@weasel-js/registry';
|
|
40
|
+
export { Reflectable, ReflectedEntry, Reflection, RegisterOptions, Registrant, createReflectable } from '@weasel-js/registry';
|
|
37
41
|
import { G as Guide } from './types-D2tTKEU0.js';
|
|
38
42
|
export { A as AUTO_POSE_DESCRIPTOR, i as isPathLike, a as isRectPose } from './autoPoseDescriptor-_XOyF7t4.js';
|
|
39
|
-
export { U as UseInsertOptions } from './options-CzjxFoYZ.js';
|
|
40
43
|
export { UseClipboardOpsOptions, UseClipboardOpsReturn, WEASEL_CLIPBOARD_MIME, WEASEL_CLIPBOARD_MIME_WEB, buildWeaselClipboardText, embedWeaselMetadataInSvg, extractWeaselClipboardFromSvg, parseWeaselClipboardText, sniffWeaselClipboardText, useClipboardOps } from './clipboard.js';
|
|
41
44
|
export { cloneByAltDrag } from './clone.js';
|
|
42
|
-
export { FontStyle, FontVariant, LocalFontOutlinesResult, OutlineSource, OutlineStatus, OutlineVariant, canQueryLocalFonts, enableLocalFontOutlines, hasFontOutlines, isCanvasFont, listFontOutlines, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, subscribeGlyphReady, unregisterCanvasFont, unregisterFontOutlines } from '@weasel-js/font';
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* The kit version a build was compiled from, so an app can report what it is
|
|
46
|
-
* running. Substituted at build time — by `tsup.config.ts` for the published
|
|
47
|
-
* package, and by `scripts/vite-build-info.ts` for anything in this repo that
|
|
48
|
-
* bundles core's source through the workspace aliases.
|
|
49
|
-
*
|
|
50
|
-
* Apps pair this with their own compile timestamp; the kit deliberately does
|
|
51
|
-
* not carry one, since a published package's build date says nothing about
|
|
52
|
-
* when the app embedding it was built.
|
|
53
|
-
*/
|
|
54
|
-
/**
|
|
55
|
-
* Semver of `@weasel-js/core` as of the build.
|
|
56
|
-
*
|
|
57
|
-
* Falls back to `'0.0.0-unknown'` when core's source is imported by a bundler
|
|
58
|
-
* that hasn't been given the define — honest about not knowing rather than
|
|
59
|
-
* throwing, since nothing about version reporting should be able to break a
|
|
60
|
-
* consumer's build.
|
|
61
|
-
*/
|
|
62
|
-
declare const VERSION: string;
|
|
63
|
-
|
|
64
|
-
/** Round `value` to the nearest multiple of `cellSize`. Returns 0 when the result would be -0. */
|
|
65
|
-
declare function roundToCell(value: number, cellSize: number): number;
|
|
45
|
+
export { FontFamilyFaces, FontStyle, FontVariant, LocalFontOutlinesResult, OutlineFaceInfo, OutlineSource, OutlineStatus, OutlineVariant, canQueryLocalFonts, enableLocalFontOutlines, fontOutlineRegistry, fontRegistry, hasFontOutlines, isCanvasFont, listFontOutlines, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, subscribeGlyphReady, unregisterCanvasFont, unregisterFontOutlines } from '@weasel-js/font';
|
|
66
46
|
|
|
67
47
|
/** Pan offset (in pixels) plus per-axis zoom (pixels per content unit). */
|
|
68
48
|
interface ViewTransform {
|
|
@@ -78,64 +58,6 @@ declare function worldToScreen(worldX: number, worldY: number, view: ViewTransfo
|
|
|
78
58
|
/** Inverse of `worldToScreen` — recover the world-space point under a screen-space pixel. */
|
|
79
59
|
declare function screenToWorld(screenX: number, screenY: number, view: ViewTransform): [number, number];
|
|
80
60
|
|
|
81
|
-
/**
|
|
82
|
-
* Pointer-tracking glue that turns hover position into a grid cell, suitable
|
|
83
|
-
* for dropping straight into `createCellHighlightLayer({ getCell })`. Pairs
|
|
84
|
-
* with `gridSnapStrategy` / `createGridLayer` so the visual hover preview
|
|
85
|
-
* uses the exact same spacing as the snap behavior.
|
|
86
|
-
*
|
|
87
|
-
* Wires three things you'd otherwise glue by hand:
|
|
88
|
-
* 1. pointermove on a target element → client coords
|
|
89
|
-
* 2. client coords → world coords via your `ViewTransform`
|
|
90
|
-
* 3. world coords → integer `{col, row}` via `pointToGridCell`
|
|
91
|
-
*
|
|
92
|
-
* State updates only fire when the cell actually changes (not on every
|
|
93
|
-
* pointer tick). Pass `onChange` to trigger a canvas redraw on each transition.
|
|
94
|
-
*/
|
|
95
|
-
|
|
96
|
-
/** Options for `useGridCellHover`. */
|
|
97
|
-
interface UseGridCellHoverOptions {
|
|
98
|
-
/** Element to attach pointer listeners to (typically the canvas). */
|
|
99
|
-
ref: RefObject<HTMLElement | null>;
|
|
100
|
-
/** Read the current view transform. Called on every pointermove so it can
|
|
101
|
-
* reflect live pan/zoom without a re-binding step. */
|
|
102
|
-
view: () => ViewTransform;
|
|
103
|
-
/** Cell spacing in world units. Same value you pass to `createGridLayer`
|
|
104
|
-
* and `createCellHighlightLayer`. */
|
|
105
|
-
spacing: UnitValue;
|
|
106
|
-
/** Required if `spacing` is tagged (e.g. `{ value: 1, unit: 'ft' }`). */
|
|
107
|
-
unitSystem?: UnitSystem;
|
|
108
|
-
/** Origin the cell grid is anchored to, in world units. Default `(0, 0)`. */
|
|
109
|
-
origin?: {
|
|
110
|
-
x: number;
|
|
111
|
-
y: number;
|
|
112
|
-
};
|
|
113
|
-
/** Fires when the hovered cell changes (including to/from `null`). Use it
|
|
114
|
-
* to invalidate your layer renderer. */
|
|
115
|
-
onChange?: (cell: {
|
|
116
|
-
col: number;
|
|
117
|
-
row: number;
|
|
118
|
-
} | null) => void;
|
|
119
|
-
/** Disable the listeners without unmounting. Default `true`. */
|
|
120
|
-
enabled?: boolean;
|
|
121
|
-
}
|
|
122
|
-
/** Return shape of `useGridCellHover`. */
|
|
123
|
-
interface UseGridCellHoverReturn {
|
|
124
|
-
/** Current hovered cell, or `null` when the pointer is outside the element. */
|
|
125
|
-
cell: {
|
|
126
|
-
col: number;
|
|
127
|
-
row: number;
|
|
128
|
-
} | null;
|
|
129
|
-
/** Stable callback that returns the current cell — drop straight into
|
|
130
|
-
* `createCellHighlightLayer({ getCell })`. */
|
|
131
|
-
getCell: () => {
|
|
132
|
-
col: number;
|
|
133
|
-
row: number;
|
|
134
|
-
} | null;
|
|
135
|
-
}
|
|
136
|
-
/** Track which grid cell the pointer is over; pairs with `createCellHighlightLayer`. */
|
|
137
|
-
declare function useGridCellHover(opts: UseGridCellHoverOptions): UseGridCellHoverReturn;
|
|
138
|
-
|
|
139
61
|
/**
|
|
140
62
|
* Input convenience for zoom primitives. A `number` is treated as a
|
|
141
63
|
* uniform factor applied to both axes; a `{x, y}` vector applies
|
|
@@ -178,489 +100,209 @@ declare function viewZoom(view: View): number;
|
|
|
178
100
|
*/
|
|
179
101
|
declare function normalizeView(view: View): View;
|
|
180
102
|
|
|
181
|
-
interface ChromeState {
|
|
182
|
-
/** Currently selected ids. Live; reflects useSelection's React state. */
|
|
183
|
-
readonly selection: readonly NodeId[];
|
|
184
|
-
/** True when the canvas is in multi-mode AND >= 2 ids are selected. */
|
|
185
|
-
readonly multiActive: boolean;
|
|
186
|
-
/** Bounds for any selection member id. Honors active-tool overlay state
|
|
187
|
-
* (move/resize/rotate ghosts → ghost bounds; otherwise → committed
|
|
188
|
-
* pose bounds). Returns null for unknown ids or ids whose bounds aren't
|
|
189
|
-
* computable. */
|
|
190
|
-
boundsOf(id: string): Bounds | null;
|
|
191
|
-
/** Multi-union AABB when `multiActive`. Computed lazily from `boundsOf`
|
|
192
|
-
* over every selected id, expanding rotated members to the extent of
|
|
193
|
-
* their ink; null otherwise. */
|
|
194
|
-
readonly unionBounds: Bounds | null;
|
|
195
|
-
/** Active modifier state at the moment of the call. */
|
|
196
|
-
readonly modifiers: ModifierState;
|
|
197
|
-
/** True iff the node's pose-descriptor declares it can carry a rotation.
|
|
198
|
-
* Affordances consult this to decide whether to expose rotate cursors /
|
|
199
|
-
* drag-bands. Defaults to `true` when the descriptor doesn't declare
|
|
200
|
-
* (back-compat) or when the id is unknown — the rotation gesture will
|
|
201
|
-
* no-op visually for poses without AABB fields, but the affordance
|
|
202
|
-
* doesn't lie about the cursor. Optional on the interface so unit-test
|
|
203
|
-
* call sites that construct `ChromeState` by hand keep compiling;
|
|
204
|
-
* affordances should treat an absent predicate as "true". */
|
|
205
|
-
canRotate?(id: string): boolean;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
103
|
/**
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
104
|
+
* `DebugSink`, `HitShape` and `HandleKind` are declared in
|
|
105
|
+
* `@weasel-js/routing` — `ToolCtx.debug` carries a sink, so routing has to
|
|
106
|
+
* name the type. Re-exported here, beside the overlay that reads one.
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
/** One bit per debug feature; absent keys are off. */
|
|
110
|
+
interface DebugConfig {
|
|
111
|
+
hitboxes?: boolean;
|
|
112
|
+
handles?: boolean;
|
|
113
|
+
bounds?: boolean;
|
|
114
|
+
origins?: boolean;
|
|
115
|
+
snap?: boolean;
|
|
116
|
+
layers?: boolean;
|
|
117
|
+
/** Render each tracked node's id as a label at the top-left of its
|
|
118
|
+
* bounds. Pulls from the same `recordBounds` stream `bounds` uses, so
|
|
119
|
+
* no extra sink calls are required to enable. */
|
|
120
|
+
ids?: boolean;
|
|
121
|
+
/** Rolling FPS counter rendered in the top-left corner of the canvas.
|
|
122
|
+
* Tracks the rate at which the debug overlay's draw callback runs;
|
|
123
|
+
* this matches the canvas's effective repaint rate. */
|
|
124
|
+
fps?: boolean;
|
|
125
|
+
/** Optional per-feature color overrides; falls back to the default theme. */
|
|
126
|
+
theme?: Partial<DebugTheme>;
|
|
127
|
+
/** Optional per-feature line-width / dash overrides; falls back to
|
|
128
|
+
* {@link DEFAULT_DEBUG_STROKES}. */
|
|
129
|
+
strokes?: Partial<DebugStrokes>;
|
|
130
|
+
}
|
|
131
|
+
/** The name of one debug-overlay feature — the keys of {@link DebugConfig}
|
|
132
|
+
* that toggle a visualization. */
|
|
133
|
+
type DebugFeature = 'hitboxes' | 'handles' | 'bounds' | 'origins' | 'snap' | 'layers' | 'ids' | 'fps';
|
|
134
|
+
/** Colors the debug overlay draws with, one entry per feature. */
|
|
135
|
+
interface DebugTheme {
|
|
136
|
+
hitboxFill: string;
|
|
137
|
+
hitboxStroke: string;
|
|
138
|
+
handle: string;
|
|
139
|
+
bounds: string;
|
|
140
|
+
origin: string;
|
|
141
|
+
snap: string;
|
|
142
|
+
layerText: string;
|
|
143
|
+
layerTextBg: string;
|
|
144
|
+
/** Color for the per-node id label rendered when `config.ids` is on. */
|
|
145
|
+
idText: string;
|
|
146
|
+
/** Foreground / background for the FPS panel. */
|
|
147
|
+
fpsText: string;
|
|
148
|
+
fpsTextBg: string;
|
|
149
|
+
}
|
|
150
|
+
/** Line width and dash pattern for one stroked debug feature. An empty (or
|
|
151
|
+
* omitted) `dash` is a solid line. */
|
|
152
|
+
interface DebugStroke {
|
|
153
|
+
width: number;
|
|
154
|
+
dash?: readonly number[];
|
|
155
|
+
}
|
|
156
|
+
/** The stroked half of the debug overlay's appearance, split from
|
|
157
|
+
* {@link DebugTheme} because only some features draw a line at all — text
|
|
158
|
+
* panels and filled origin dots take color and nothing else. */
|
|
159
|
+
interface DebugStrokes {
|
|
160
|
+
hitbox: DebugStroke;
|
|
161
|
+
bounds: DebugStroke;
|
|
162
|
+
handle: DebugStroke;
|
|
163
|
+
/** Rejected snap candidates only; accepted ones paint as a filled dot. */
|
|
164
|
+
snap: DebugStroke;
|
|
165
|
+
}
|
|
166
|
+
/** A hit region tested during the current frame. */
|
|
167
|
+
interface RecordedHitbox {
|
|
222
168
|
id: string;
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
* is `null`). Returning `[]` means "no chrome for this state" (no
|
|
226
|
-
* selection, multi-mode disabled, etc.). */
|
|
227
|
-
regions(state: ChromeState): readonly AffordanceRegion[];
|
|
228
|
-
/** Optional non-interactive decoration (e.g., a leader line drawn from
|
|
229
|
-
* a bounds edge to a handle — visual only, not draggable). Receives
|
|
230
|
-
* raw state + view because the decoration may live outside any single
|
|
231
|
-
* target's local frame. Most affordances leave this undefined. */
|
|
232
|
-
decorate?(state: ChromeState, view: View): DrawCommand[];
|
|
169
|
+
kind: 'body' | 'handle' | 'rotation' | 'anchor';
|
|
170
|
+
shape: HitShape;
|
|
233
171
|
}
|
|
234
|
-
/**
|
|
235
|
-
|
|
236
|
-
* One interactive region produced by an affordance. The framework owns
|
|
237
|
-
* the local↔world transform for `targetId` (when non-null), so `shape`,
|
|
238
|
-
* `paint.sizePx`, and `hitRadiusPx` are always specified in coordinates
|
|
239
|
-
* the affordance can reason about directly.
|
|
240
|
-
*/
|
|
241
|
-
interface AffordanceRegion<TScratch = unknown> {
|
|
242
|
-
/** Stable id, e.g. `corner-min-min`. Used for debug overlays + a11y. */
|
|
172
|
+
/** A handle drawn during the current frame, and where. */
|
|
173
|
+
interface RecordedHandle {
|
|
243
174
|
id: string;
|
|
244
|
-
|
|
245
|
-
* local frame. `bounds.rotation` (if present) is the only transform
|
|
246
|
-
* applied — translation is the AABB origin; scale is identity. Pass
|
|
247
|
-
* `null` for affordances anchored to the viewport / world frame
|
|
248
|
-
* (identity transform). */
|
|
249
|
-
targetId: string | null;
|
|
250
|
-
/** Region geometry, expressed in the target's local frame.
|
|
251
|
-
*
|
|
252
|
-
* - `point` — circular hit (`hitRadiusPx` is screen-space).
|
|
253
|
-
* - `rect` — axis-aligned rect (target rotation applies).
|
|
254
|
-
* - `annulus` — outer ellipse minus inner rect cutout. Used for
|
|
255
|
-
* invisible zones that sit *around* the AABB (e.g. rotate-on-
|
|
256
|
-
* hover band). The outer ellipse is defined by world-space
|
|
257
|
-
* semi-axes `rx` / `ry` around `(cx, cy)`; the inner rect is the
|
|
258
|
-
* same target-local rect that defines the AABB. Hit-test:
|
|
259
|
-
* inside outer ellipse AND outside inner rect. */
|
|
260
|
-
shape: {
|
|
261
|
-
kind: 'point';
|
|
175
|
+
position: {
|
|
262
176
|
x: number;
|
|
263
177
|
y: number;
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
178
|
+
};
|
|
179
|
+
kind: HandleKind;
|
|
180
|
+
}
|
|
181
|
+
/** A node's bounds as computed during the current frame. */
|
|
182
|
+
interface RecordedBounds {
|
|
183
|
+
id: string;
|
|
184
|
+
bounds: {
|
|
267
185
|
x: number;
|
|
268
186
|
y: number;
|
|
269
187
|
width: number;
|
|
270
188
|
height: number;
|
|
271
|
-
} | {
|
|
272
|
-
kind: 'annulus';
|
|
273
|
-
/** Outer-ellipse center (target-local). */
|
|
274
|
-
cx: number;
|
|
275
|
-
cy: number;
|
|
276
|
-
/** Outer-ellipse semi-axes (target-local). */
|
|
277
|
-
rx: number;
|
|
278
|
-
ry: number;
|
|
279
|
-
/** Inner rect (target-local) — the cutout. Typically the
|
|
280
|
-
* selection's AABB. */
|
|
281
|
-
innerX: number;
|
|
282
|
-
innerY: number;
|
|
283
|
-
innerWidth: number;
|
|
284
|
-
innerHeight: number;
|
|
285
|
-
/** Minimum band thickness outside the inner rect, in **screen**
|
|
286
|
-
* pixels. The framework widens `rx`/`ry` to at least
|
|
287
|
-
* `innerHalfExtent + minBandPx / meanScale(view.scale)` for both
|
|
288
|
-
* paint and hit-test.
|
|
289
|
-
*
|
|
290
|
-
* This exists because the clamp has to know the view and the
|
|
291
|
-
* affordance doesn't: `ChromeState` carries no scale. Expressing the
|
|
292
|
-
* floor in world units instead (which is what the rotate ring used
|
|
293
|
-
* to do) makes the band shrink on screen as you zoom in, until the
|
|
294
|
-
* ring around a small shape is too thin to hover. */
|
|
295
|
-
minBandPx?: number;
|
|
296
|
-
};
|
|
297
|
-
/** Optional paint. World position is derived from `shape` + target
|
|
298
|
-
* transform; visual size stays in screen pixels (so handles don't
|
|
299
|
-
* warp under zoom or non-uniform scale). Omit for hit-only regions.
|
|
300
|
-
*
|
|
301
|
-
* - `square` — small fixed-size square (only valid over `point` shapes).
|
|
302
|
-
* - `annulus` — fill + stroke the annulus ring (only valid over
|
|
303
|
-
* `annulus` shapes). Uses even-odd fill rule to punch the inner-rect
|
|
304
|
-
* cutout.
|
|
305
|
-
* - `custom` — emit arbitrary draw commands; receives a {@link CustomPaintContext}. */
|
|
306
|
-
paint?: {
|
|
307
|
-
kind: 'square';
|
|
308
|
-
sizePx: number;
|
|
309
|
-
fill?: FillStyle;
|
|
310
|
-
stroke?: Stroke;
|
|
311
|
-
} | {
|
|
312
|
-
kind: 'annulus';
|
|
313
|
-
fill?: FillStyle;
|
|
314
|
-
stroke?: Stroke;
|
|
315
|
-
insetPx?: number;
|
|
316
|
-
} | {
|
|
317
|
-
kind: 'custom';
|
|
318
|
-
draw: (ctx: CustomPaintContext) => DrawCommand[];
|
|
319
189
|
};
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
* `<affordanceId>:<regionId>`. */
|
|
326
|
-
hitKind?: string;
|
|
327
|
-
/** Cursor to show while hovering this region. Read by the hover-cursor
|
|
328
|
-
* pump in `useGestureDispatcher` via `AffordanceHit.cursor`, which
|
|
329
|
-
* `buildAffordanceAt` fills in from the region the walk landed on. */
|
|
330
|
-
cursor?: CursorSpec;
|
|
331
|
-
/** `'exclusive'` bars every binding whose target doesn't consult the
|
|
332
|
-
* affordance. Read only when the affordance is composed into a
|
|
333
|
-
* consumer-registered layer; kit chrome routes through
|
|
334
|
-
* `buildAffordanceAt`, which reports `'shared'`. */
|
|
335
|
-
strength?: 'exclusive' | 'shared';
|
|
336
|
-
/** Which gestures an exclusive claim bars. Omitted bars all of them. */
|
|
337
|
-
claimedKinds?: readonly ClaimableGesture[];
|
|
338
|
-
/** Drag binding produced when this region is hit. Lazily called so
|
|
339
|
-
* affordances don't pay binding-construction cost on every paint frame —
|
|
340
|
-
* state snapshots (e.g., capturing per-leaf poses at click time) belong
|
|
341
|
-
* inside `bind()`, not inside `regions()`. */
|
|
342
|
-
bind(): AffordanceBinding<TScratch>;
|
|
343
|
-
}
|
|
344
|
-
/** Context passed to a region's `paint.kind === 'custom'` draw callback.
|
|
345
|
-
* Provides both the world-space anchor (already transformed) and the
|
|
346
|
-
* original local shape, for affordances that want to do additional
|
|
347
|
-
* geometry themselves. */
|
|
348
|
-
interface CustomPaintContext {
|
|
349
|
-
/** World-space mapping of `shape`. For `point`, only `x`/`y` are set.
|
|
350
|
-
* For `rect`, all four fields are set. */
|
|
351
|
-
world: {
|
|
190
|
+
}
|
|
191
|
+
/** A node's transform origin as used during the current frame. */
|
|
192
|
+
interface RecordedOrigin {
|
|
193
|
+
id: string;
|
|
194
|
+
point: {
|
|
352
195
|
x: number;
|
|
353
196
|
y: number;
|
|
354
|
-
width?: number;
|
|
355
|
-
height?: number;
|
|
356
197
|
};
|
|
357
|
-
/** The original local shape (same object identity as `region.shape`). */
|
|
358
|
-
local: AffordanceRegion['shape'];
|
|
359
|
-
view: View;
|
|
360
|
-
state: ChromeState;
|
|
361
198
|
}
|
|
362
|
-
/**
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
* corner, which target id) so the action that picks up the drag doesn't
|
|
368
|
-
* re-derive it. `<SceneCanvas>` reads it out of the layer hit-test and packs
|
|
369
|
-
* it into `AffordanceHit`, which flows to the matching action through
|
|
370
|
-
* `InvocationCtx.drag.affordance`.
|
|
371
|
-
*
|
|
372
|
-
* This used to also carry a `drag: DragChannel` naming the handlers the
|
|
373
|
-
* tool-routing dispatcher should wire up. Every implementation supplied a
|
|
374
|
-
* no-op stub that claimed, because the real routing had already moved to
|
|
375
|
-
* bindings; the field went with that dispatcher.
|
|
376
|
-
*/
|
|
377
|
-
interface AffordanceBinding<TScratch = unknown> {
|
|
378
|
-
initialScratch?: TScratch;
|
|
379
|
-
}
|
|
380
|
-
/**
|
|
381
|
-
* The fields `buildAffordanceAt` lifts out of a region's `initialScratch`
|
|
382
|
-
* when it turns a region hit into an `AffordanceHit`.
|
|
383
|
-
*
|
|
384
|
-
* Scratch is otherwise opaque — whatever the affordance wants to hand the
|
|
385
|
-
* action that picks up the drag. These few names are the exception: they mean
|
|
386
|
-
* the same thing to every affordance, and the actions that consume them
|
|
387
|
-
* (`resizeAction`, `rotateAction`) read them off `AffordanceHit` rather than
|
|
388
|
-
* out of scratch. An affordance that doesn't set them simply produces a hit
|
|
389
|
-
* without those fields.
|
|
390
|
-
*/
|
|
391
|
-
interface CommonAffordanceScratch {
|
|
392
|
-
/** The node (or `MULTI_RESIZE_TARGET_ID`) this chrome acts on. Becomes
|
|
393
|
-
* `AffordanceHit.targetIds`. */
|
|
394
|
-
targetId?: string;
|
|
395
|
-
/** For resize chrome: which corner stays pinned. Mirrors the kit's
|
|
396
|
-
* `ResizeAnchor`, spelled inline so `affordances/` doesn't take a type
|
|
397
|
-
* dependency on the gesture layer for one field. */
|
|
398
|
-
anchor?: {
|
|
399
|
-
x: 'min' | 'max' | 'free';
|
|
400
|
-
y: 'min' | 'max' | 'free';
|
|
401
|
-
};
|
|
402
|
-
/** World-space invariant point of the transform — the fixed corner for a
|
|
403
|
-
* resize, the pivot for a rotation. */
|
|
404
|
-
fixedPoint?: {
|
|
199
|
+
/** A snap candidate considered during the current gesture, and whether it
|
|
200
|
+
* won. Unlike the other records these survive across frames, until the
|
|
201
|
+
* gesture ends. */
|
|
202
|
+
interface RecordedSnap {
|
|
203
|
+
point: {
|
|
405
204
|
x: number;
|
|
406
205
|
y: number;
|
|
407
206
|
};
|
|
207
|
+
accepted: boolean;
|
|
408
208
|
}
|
|
409
|
-
/**
|
|
410
|
-
|
|
411
|
-
* so existing implementations keep typechecking; the added fields are how a
|
|
412
|
-
* consumer's own chrome says the things kit chrome says through
|
|
413
|
-
* `AffordanceRegion` — which cursor to show, and whether it owns the point
|
|
414
|
-
* outright.
|
|
415
|
-
*/
|
|
416
|
-
interface LayerHit<TScratch = unknown> extends AffordanceBinding<TScratch> {
|
|
417
|
-
/** Cursor while the pointer is over this hit. Reaches the hover-cursor
|
|
418
|
-
* pump as `AffordanceHit.cursor`, the same path kit chrome uses. */
|
|
419
|
-
cursor?: CursorSpec;
|
|
420
|
-
/** `'exclusive'` bars every binding whose target doesn't consult the
|
|
421
|
-
* affordance. Omitted means `'shared'` — today's behavior. Same name and
|
|
422
|
-
* meaning as `AffordanceHit.strength`, which it becomes. */
|
|
423
|
-
strength?: 'exclusive' | 'shared';
|
|
424
|
-
/** Which gestures an exclusive claim bars. Omitted bars all of them. */
|
|
425
|
-
claimedKinds?: readonly ClaimableGesture[];
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
/**
|
|
429
|
-
* Canvas size in CSS pixels — passed to `draw` for layers that anchor to
|
|
430
|
-
* canvas edges (e.g. the debug overlay's layer-list panel). The GL backend
|
|
431
|
-
* supplies it explicitly so layers don't have to know about DPR.
|
|
432
|
-
*/
|
|
433
|
-
interface Dims {
|
|
434
|
-
width: number;
|
|
435
|
-
height: number;
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* What a layer's `draw` threw, and which layer threw it.
|
|
439
|
-
*
|
|
440
|
-
* A `draw` runs on the frame loop, so a throw that escapes it surfaces as an
|
|
441
|
-
* uncaught `requestAnimationFrame` error on the window and takes the whole
|
|
442
|
-
* frame with it — every other layer included. One broken layer painting
|
|
443
|
-
* nothing, named in the console, is the lesser wrong.
|
|
444
|
-
*/
|
|
445
|
-
interface LayerDrawFailure {
|
|
446
|
-
layerId: string;
|
|
447
|
-
error: unknown;
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* Several consecutive layers composited as one.
|
|
451
|
-
*
|
|
452
|
-
* A layer's own `effects` run over that layer alone, which is the wrong
|
|
453
|
-
* picture whenever a pass reads neighboring pixels: `blur(A over B)` is not
|
|
454
|
-
* `blur(A) over blur(B)`, and it costs a buffer and a pass chain per layer. A
|
|
455
|
-
* group draws its members into one buffer, runs one chain over it, and
|
|
456
|
-
* composites the result back once.
|
|
457
|
-
*
|
|
458
|
-
* Membership is by `RenderLayer.id` — the same names `layerOrder` and
|
|
459
|
-
* `layerVisibility` use, not the `layers` map's slot keys.
|
|
460
|
-
*
|
|
461
|
-
* Only *consecutive* members share a buffer, because anything drawn between
|
|
462
|
-
* two members has to land between them. A group whose members are separated in
|
|
463
|
-
* the render order is drawn as one bracket per run, with a warning: the
|
|
464
|
-
* picture is right, the declaration almost certainly is not.
|
|
465
|
-
*
|
|
466
|
-
* This is a render-stack bracket, not a scene `ContainerNode` — it holds no
|
|
467
|
-
* ids, survives no reload, and nothing in the scene knows about it.
|
|
468
|
-
*/
|
|
469
|
-
interface LayerGroup {
|
|
470
|
-
/** Names the group in warnings; not a layer id and never drawn. */
|
|
471
|
-
id: string;
|
|
472
|
-
/**
|
|
473
|
-
* Member layer ids. Order here is ignored — the render order decides.
|
|
474
|
-
*
|
|
475
|
-
* A name claims that layer and every layer under it in the `:` namespace, so
|
|
476
|
-
* `'scene'` covers the `scene:<layerId>` layers a scene with declared layers
|
|
477
|
-
* draws as — the same set `before`/`after: 'scene'` anchors against. The
|
|
478
|
-
* separator is required: `'scene'` does not reach `scenery`. A name matching
|
|
479
|
-
* no layer being drawn is warned about rather than ignored.
|
|
480
|
-
*/
|
|
481
|
-
layers: readonly string[];
|
|
482
|
-
/**
|
|
483
|
-
* Passes over the group's combined pixels, in order. A thunk is re-read on
|
|
484
|
-
* every frame, so an animating radius costs no React render; an array is
|
|
485
|
-
* read once per frame either way.
|
|
486
|
-
*/
|
|
487
|
-
effects?: readonly Effect[] | ((view: View, dims: Dims) => readonly Effect[]);
|
|
488
|
-
/** Opacity applied to the group's composited result, not to each member. */
|
|
489
|
-
alpha?: number;
|
|
490
|
-
/** 4×5 color matrix (row-major, 20 numbers) applied to the composited
|
|
491
|
-
* result. See `GroupDrawCommand.colorMatrix`. */
|
|
492
|
-
colorMatrix?: number[];
|
|
493
|
-
}
|
|
494
|
-
/** One layer's memoized output, keyed by layer id. Owned by the canvas that
|
|
495
|
-
* calls `drawLayers`, not by `drawLayers` itself — the function is pure. */
|
|
496
|
-
type LayerCommandCache = Map<string, {
|
|
497
|
-
deps: readonly unknown[];
|
|
498
|
-
cmds: DrawCommand[];
|
|
499
|
-
}>;
|
|
500
|
-
/**
|
|
501
|
-
* A single named render sub-layer within a canvas renderer.
|
|
502
|
-
*
|
|
503
|
-
* @template TData - The data object passed to each draw call.
|
|
504
|
-
*/
|
|
505
|
-
interface RenderLayer<TData> {
|
|
506
|
-
/** Unique identifier used in visibility maps and ordering arrays. When a
|
|
507
|
-
* cache is in use, an id must identify the same logical layer across
|
|
508
|
-
* frames — reusing it for a different layer can serve cross-layer commands. */
|
|
209
|
+
/** A render layer that drew during the current frame. */
|
|
210
|
+
interface RecordedLayer {
|
|
509
211
|
id: string;
|
|
510
|
-
/** Human-readable name for UI toggles. */
|
|
511
212
|
label: string;
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
* subset manually with `viewToMat3(view)`.
|
|
524
|
-
*/
|
|
525
|
-
draw: (data: TData, view: View, dims: Dims) => DrawCommand[];
|
|
526
|
-
/**
|
|
527
|
-
* Optional cache key. When present and a `LayerCommandCache` is supplied to
|
|
528
|
-
* `drawLayers`, the layer's previous `DrawCommand[]` is reused as long as
|
|
529
|
-
* every entry is `Object.is`-equal to the previous call's. A layer with no
|
|
530
|
-
* `deps` rebuilds on every frame.
|
|
531
|
-
*
|
|
532
|
-
* **The returned commands must be treated as immutable.** A cached tree is
|
|
533
|
-
* handed to the renderer again on later frames, so mutating a tree you
|
|
534
|
-
* previously returned corrupts the cache silently rather than erroring.
|
|
535
|
-
*
|
|
536
|
-
* **Screen-space layers are not protected against a stale `view`/`dims`
|
|
537
|
-
* the way world-space layers are** (see `space` below) — include them in
|
|
538
|
-
* `deps` if `draw` reads them.
|
|
539
|
-
*/
|
|
540
|
-
deps?: (data: TData, view: View, dims: Dims) => readonly unknown[];
|
|
541
|
-
/**
|
|
542
|
-
* Whether the layer is shown when no explicit visibility entry exists.
|
|
543
|
-
* Defaults to `true` when absent.
|
|
544
|
-
*/
|
|
545
|
-
defaultVisible?: boolean;
|
|
546
|
-
/**
|
|
547
|
-
* When true, the layer is always drawn regardless of the visibility map.
|
|
548
|
-
* Useful for layers that must never be hidden (e.g. base grid).
|
|
549
|
-
*/
|
|
550
|
-
alwaysOn?: boolean;
|
|
551
|
-
/**
|
|
552
|
-
* Coordinate space the layer draws in.
|
|
553
|
-
*
|
|
554
|
-
* - `'world'` (default): the layer's `draw` returns world-space commands;
|
|
555
|
-
* `drawLayers` wraps them in a `kind: 'group'` with `viewToMat3(view)`
|
|
556
|
-
* automatically.
|
|
557
|
-
* - `'screen'`: the layer's `draw` returns screen-space (CSS-pixel)
|
|
558
|
-
* commands; `drawLayers` passes them through unchanged. World-anchored
|
|
559
|
-
* chrome inside a screen-space layer must call `worldToScreen` or wrap
|
|
560
|
-
* the relevant subset with `viewToMat3(view)` manually.
|
|
561
|
-
*/
|
|
562
|
-
space?: 'world' | 'screen';
|
|
563
|
-
/**
|
|
564
|
-
* Full-screen passes run over this layer's own pixels before it joins the
|
|
565
|
-
* frame — a blur here blurs the world and leaves the HUD drawn above it
|
|
566
|
-
* sharp, which is the thing a CSS `filter` on the `<canvas>` cannot do.
|
|
567
|
-
*
|
|
568
|
-
* Costs nothing while empty: the renderer allocates no offscreen buffer
|
|
569
|
-
* until a layer actually declares one. See `GroupDrawCommand.effects` for
|
|
570
|
-
* what a pass may read, and {@link LayerGroup} to run one chain over
|
|
571
|
-
* several layers at once instead of one chain each.
|
|
572
|
-
*/
|
|
573
|
-
effects?: readonly Effect[];
|
|
574
|
-
/**
|
|
575
|
-
* Optional hit-test for **consumer-attached** layers.
|
|
576
|
-
*
|
|
577
|
-
* Only layers registered through `CanvasExtensionApi.registerLayer` are
|
|
578
|
-
* hit-tested: `hitTestExtras` walks them last-registered-first on
|
|
579
|
-
* pointerdown, and `<SceneCanvas>` folds the result into its `affordanceAt`
|
|
580
|
-
* thunk ahead of the kit's own selection chrome. First non-null result
|
|
581
|
-
* wins; null means "I don't claim this hit, try the next layer."
|
|
582
|
-
*
|
|
583
|
-
* Layers that reach the draw stack some other way — a `Tool.overlay`, an
|
|
584
|
-
* entry in the `layers` map — are painted but never hit-tested, so defining
|
|
585
|
-
* `hitTest` on one has no effect. (The kit's own chrome doesn't need it: it
|
|
586
|
-
* goes through `buildAffordanceAt`.)
|
|
587
|
-
*
|
|
588
|
-
* Coordinates are world-space. The `data` arg is the layer's
|
|
589
|
-
* configured data slot (same as `draw`); `view` and `dims` mirror
|
|
590
|
-
* `draw`'s arguments.
|
|
591
|
-
*/
|
|
592
|
-
hitTest?: (worldX: number, worldY: number, data: TData, view: View, dims: Dims,
|
|
593
|
-
/** Chrome-caps visibility predicate. When supplied, the layer must
|
|
594
|
-
* not return a hit from any chrome element whose id reports
|
|
595
|
-
* `false`. Absent → every element is hittable. */
|
|
596
|
-
isVisible?: (id: string) => boolean) => LayerHit | null;
|
|
597
|
-
/**
|
|
598
|
-
* Called on every pointermove when no gesture is currently captured.
|
|
599
|
-
* Lets layers (e.g. HUD widgets) track hover state without participating
|
|
600
|
-
* in the drag pipeline. Coords are world-space; the layer is responsible
|
|
601
|
-
* for any further conversion (e.g. world→screen for screen-space layers)
|
|
602
|
-
* and for its own throttling.
|
|
603
|
-
*/
|
|
604
|
-
onUncapturedMove?: (worldX: number, worldY: number, evt: PointerEvent, view: View, dims: Dims) => void;
|
|
605
|
-
/**
|
|
606
|
-
* Called when the cursor leaves the canvas element. Lets layers clear
|
|
607
|
-
* any hover state they're holding.
|
|
608
|
-
*/
|
|
609
|
-
onUncapturedLeave?: () => void;
|
|
213
|
+
space: 'world' | 'screen';
|
|
214
|
+
index: number;
|
|
215
|
+
}
|
|
216
|
+
/** Everything the sink collected, ready for the overlay to draw. */
|
|
217
|
+
interface DebugSnapshot {
|
|
218
|
+
hitboxes: RecordedHitbox[];
|
|
219
|
+
handles: RecordedHandle[];
|
|
220
|
+
bounds: RecordedBounds[];
|
|
221
|
+
origins: RecordedOrigin[];
|
|
222
|
+
snap: RecordedSnap[];
|
|
223
|
+
layers: RecordedLayer[];
|
|
610
224
|
}
|
|
225
|
+
|
|
611
226
|
/**
|
|
612
|
-
*
|
|
613
|
-
*
|
|
614
|
-
*
|
|
615
|
-
*
|
|
616
|
-
* 1. `alwaysOn` — always drawn, ignores visibility map.
|
|
617
|
-
* 2. Explicit entry in `visibility` map — overrides default.
|
|
618
|
-
* 3. `layer.defaultVisible` — falls back to `true` when absent.
|
|
619
|
-
*
|
|
620
|
-
* Transform composition: world-space layers (the default; `space` unset or
|
|
621
|
-
* `'world'`) have their commands wrapped in a `kind: 'group'` with
|
|
622
|
-
* `viewToMat3(view)` before they reach the renderer. Screen-space layers
|
|
623
|
-
* (`space: 'screen'`) pass through unchanged.
|
|
624
|
-
*
|
|
625
|
-
* A layer whose `draw` throws is dropped for the frame and reported through
|
|
626
|
-
* `onLayerError` — the rest of the frame still paints.
|
|
227
|
+
* The kit version a build was compiled from, so an app can report what it is
|
|
228
|
+
* running. Substituted at build time — by `tsup.config.ts` for the published
|
|
229
|
+
* package, and by `scripts/vite-build-info.ts` for anything in this repo that
|
|
230
|
+
* bundles core's source through the workspace aliases.
|
|
627
231
|
*
|
|
628
|
-
*
|
|
629
|
-
*
|
|
630
|
-
*
|
|
631
|
-
*/
|
|
632
|
-
declare function drawLayers<TData>(layers: RenderLayer<TData>[], data: TData, visibility: Record<string, boolean>, order: string[] | undefined, view: View | undefined, dims: Dims, cache?: LayerCommandCache, onLayerError?: (failure: LayerDrawFailure) => void, groups?: readonly LayerGroup[]): DrawCommand[];
|
|
633
|
-
/**
|
|
634
|
-
* Resolve one layer's visibility: `alwaysOn` wins, then an explicit entry in
|
|
635
|
-
* `visibility`, then `defaultVisible`, defaulting to shown.
|
|
232
|
+
* Apps pair this with their own compile timestamp; the kit deliberately does
|
|
233
|
+
* not carry one, since a published package's build date says nothing about
|
|
234
|
+
* when the app embedding it was built.
|
|
636
235
|
*/
|
|
637
|
-
declare function isLayerVisible<TData>(layer: RenderLayer<TData>, visibility: Record<string, boolean>): boolean;
|
|
638
236
|
/**
|
|
639
|
-
*
|
|
640
|
-
* `drawLayers` applies them.
|
|
237
|
+
* Semver of `@weasel-js/core` as of the build.
|
|
641
238
|
*
|
|
642
|
-
*
|
|
643
|
-
* that
|
|
644
|
-
*
|
|
645
|
-
*
|
|
646
|
-
* can see.
|
|
239
|
+
* Falls back to `'0.0.0-unknown'` when core's source is imported by a bundler
|
|
240
|
+
* that hasn't been given the define — honest about not knowing rather than
|
|
241
|
+
* throwing, since nothing about version reporting should be able to break a
|
|
242
|
+
* consumer's build.
|
|
647
243
|
*/
|
|
648
|
-
declare
|
|
244
|
+
declare const VERSION: string;
|
|
245
|
+
|
|
246
|
+
/** Round `value` to the nearest multiple of `cellSize`. Returns 0 when the result would be -0. */
|
|
247
|
+
declare function roundToCell(value: number, cellSize: number): number;
|
|
248
|
+
|
|
649
249
|
/**
|
|
650
|
-
*
|
|
651
|
-
*
|
|
652
|
-
*
|
|
250
|
+
* Pointer-tracking glue that turns hover position into a grid cell, suitable
|
|
251
|
+
* for dropping straight into `createCellHighlightLayer({ getCell })`. Pairs
|
|
252
|
+
* with `gridSnapStrategy` / `createGridLayer` so the visual hover preview
|
|
253
|
+
* uses the exact same spacing as the snap behavior.
|
|
653
254
|
*
|
|
654
|
-
*
|
|
655
|
-
*
|
|
656
|
-
*
|
|
657
|
-
*
|
|
255
|
+
* Wires three things you'd otherwise glue by hand:
|
|
256
|
+
* 1. pointermove on a target element → client coords
|
|
257
|
+
* 2. client coords → world coords via your `ViewTransform`
|
|
258
|
+
* 3. world coords → integer `{col, row}` via `pointToGridCell`
|
|
658
259
|
*
|
|
659
|
-
*
|
|
660
|
-
*
|
|
661
|
-
* real re-attempt rather than a stale tree served under fresh deps.
|
|
260
|
+
* State updates only fire when the cell actually changes (not on every
|
|
261
|
+
* pointer tick). Pass `onChange` to trigger a canvas redraw on each transition.
|
|
662
262
|
*/
|
|
663
|
-
|
|
263
|
+
|
|
264
|
+
/** Options for `useGridCellHover`. */
|
|
265
|
+
interface UseGridCellHoverOptions {
|
|
266
|
+
/** Element to attach pointer listeners to (typically the canvas). */
|
|
267
|
+
ref: RefObject<HTMLElement | null>;
|
|
268
|
+
/** Read the current view transform. Called on every pointermove so it can
|
|
269
|
+
* reflect live pan/zoom without a re-binding step. */
|
|
270
|
+
view: () => ViewTransform;
|
|
271
|
+
/** Cell spacing in world units. Same value you pass to `createGridLayer`
|
|
272
|
+
* and `createCellHighlightLayer`. */
|
|
273
|
+
spacing: UnitValue;
|
|
274
|
+
/** Required if `spacing` is tagged (e.g. `{ value: 1, unit: 'ft' }`). */
|
|
275
|
+
unitSystem?: UnitSystem;
|
|
276
|
+
/** Origin the cell grid is anchored to, in world units. Default `(0, 0)`. */
|
|
277
|
+
origin?: {
|
|
278
|
+
x: number;
|
|
279
|
+
y: number;
|
|
280
|
+
};
|
|
281
|
+
/** Fires when the hovered cell changes (including to/from `null`). Use it
|
|
282
|
+
* to invalidate your layer renderer. */
|
|
283
|
+
onChange?: (cell: {
|
|
284
|
+
col: number;
|
|
285
|
+
row: number;
|
|
286
|
+
} | null) => void;
|
|
287
|
+
/** Disable the listeners without unmounting. Default `true`. */
|
|
288
|
+
enabled?: boolean;
|
|
289
|
+
}
|
|
290
|
+
/** Return shape of `useGridCellHover`. */
|
|
291
|
+
interface UseGridCellHoverReturn {
|
|
292
|
+
/** Current hovered cell, or `null` when the pointer is outside the element. */
|
|
293
|
+
cell: {
|
|
294
|
+
col: number;
|
|
295
|
+
row: number;
|
|
296
|
+
} | null;
|
|
297
|
+
/** Stable callback that returns the current cell — drop straight into
|
|
298
|
+
* `createCellHighlightLayer({ getCell })`. */
|
|
299
|
+
getCell: () => {
|
|
300
|
+
col: number;
|
|
301
|
+
row: number;
|
|
302
|
+
} | null;
|
|
303
|
+
}
|
|
304
|
+
/** Track which grid cell the pointer is over; pairs with `createCellHighlightLayer`. */
|
|
305
|
+
declare function useGridCellHover(opts: UseGridCellHoverOptions): UseGridCellHoverReturn;
|
|
664
306
|
|
|
665
307
|
/**
|
|
666
308
|
* Grid overlay — a reusable render layer that draws a world-space grid with
|
|
@@ -1375,6 +1017,9 @@ declare function meanScale(s: {
|
|
|
1375
1017
|
y: number;
|
|
1376
1018
|
}): number;
|
|
1377
1019
|
|
|
1020
|
+
/** Whether `value` is a plain object — a literal or `Object.create(null)` — from any realm. */
|
|
1021
|
+
declare function isPlainObject(value: unknown): value is Record<string, unknown>;
|
|
1022
|
+
|
|
1378
1023
|
/**
|
|
1379
1024
|
* Screen-pixel lengths in world units, per axis.
|
|
1380
1025
|
*
|
|
@@ -1502,6 +1147,7 @@ declare function useDropZone<T extends HTMLElement>(opts: DropZoneOptions): (el:
|
|
|
1502
1147
|
* and missed-release recovery, teardown — belongs to `openPointerSession`.
|
|
1503
1148
|
*/
|
|
1504
1149
|
interface ThresholdDragOptions {
|
|
1150
|
+
/** Travel, in CSS pixels, that makes the press a drag. Default `DRAG_THRESHOLD_PX`. */
|
|
1505
1151
|
threshold?: number;
|
|
1506
1152
|
/** Element the session opens on. Defaults to `e.currentTarget`; a list must
|
|
1507
1153
|
* pass its container, since a grabbed row unmounting drops capture. */
|
|
@@ -1610,7 +1256,7 @@ interface DeviceProfileProviderProps {
|
|
|
1610
1256
|
* Publish one resolved profile to a subtree. `<SceneCanvas>` renders this so
|
|
1611
1257
|
* overlays, affordances, and consumer chrome all read the same object.
|
|
1612
1258
|
*/
|
|
1613
|
-
declare function DeviceProfileProvider({ value, children }: DeviceProfileProviderProps):
|
|
1259
|
+
declare function DeviceProfileProvider({ value, children }: DeviceProfileProviderProps): react.FunctionComponentElement<react.ProviderProps<DeviceProfile | null>>;
|
|
1614
1260
|
|
|
1615
1261
|
/**
|
|
1616
1262
|
* Compute the largest uniform zoom (px per content-unit) that fits a content
|
|
@@ -1837,10 +1483,9 @@ declare function actionShortcuts(action: Action, params?: Readonly<Record<string
|
|
|
1837
1483
|
* - `onMove`: update the in-scratch `currentDelta`, and publish the frame's
|
|
1838
1484
|
* poses as ephemeral overrides. No *document* writes, so the undo stack
|
|
1839
1485
|
* still sees one entry for the whole drag.
|
|
1840
|
-
* - `onEnd('commit')`: emit the final delta as transform ops and
|
|
1841
|
-
* them
|
|
1842
|
-
*
|
|
1843
|
-
* → exactly one undo entry for the whole drag.
|
|
1486
|
+
* - `onEnd('commit')`: emit the final delta as transform ops and commit
|
|
1487
|
+
* them as one batch (`commitGestureOps`) → at most one undo entry for the
|
|
1488
|
+
* whole drag, none when the binding's params make it transient.
|
|
1844
1489
|
* - `onEnd('cancel')`: drop the overrides — the document was never mutated,
|
|
1845
1490
|
* so the committed poses are the restoration.
|
|
1846
1491
|
*
|
|
@@ -1893,8 +1538,9 @@ declare const moveAction: Action & {
|
|
|
1893
1538
|
*
|
|
1894
1539
|
* Performs real anchor-relative resize math for rect-shaped poses. Reads
|
|
1895
1540
|
* `ctx.drag.affordance.anchor` to determine which corner is fixed, captures
|
|
1896
|
-
* start poses, applies per-frame bounds remapping, and commits
|
|
1897
|
-
* `
|
|
1541
|
+
* start poses, applies per-frame bounds remapping, and commits one batch on
|
|
1542
|
+
* end — labeled, transient and observed per the `resizePolicy` dep's
|
|
1543
|
+
* lifecycle fields.
|
|
1898
1544
|
*
|
|
1899
1545
|
* ## Behaviors / point-snap / expandIds — via the `resizePolicy` dep
|
|
1900
1546
|
*
|
|
@@ -1960,7 +1606,8 @@ declare const resizeAction: Action & {
|
|
|
1960
1606
|
* - Reads and writes poses through the `poseDescriptor` dep; a pose whose
|
|
1961
1607
|
* descriptor has no `withRotation`, or reports `supportsRotation` false, is
|
|
1962
1608
|
* left alone.
|
|
1963
|
-
* -
|
|
1609
|
+
* - Behaviors (`opts.behaviors`) see the first rotated node's turned pose; a
|
|
1610
|
+
* pose one returns from `onMove` sets the rotation for the whole selection.
|
|
1964
1611
|
* - No overlay rendering — deferred to Phase 7 overlay surface.
|
|
1965
1612
|
* - Shift-snap (15° quantum) is NOT wired in this phase — omitted deliberately
|
|
1966
1613
|
* to keep the invoker self-contained (would need to read shift from onMove ctx).
|
|
@@ -2211,7 +1858,8 @@ declare const cloneAction: Action & {
|
|
|
2211
1858
|
* `viewportDragPanAction` — ongoing Action descriptor for drag-to-pan the viewport.
|
|
2212
1859
|
*
|
|
2213
1860
|
* ## Bindings
|
|
2214
|
-
*
|
|
1861
|
+
* None of its own. The hand tool binds a drag to it, and a canvas that pans on
|
|
1862
|
+
* any unclaimed drag adds `dragPanContribution`.
|
|
2215
1863
|
*
|
|
2216
1864
|
* ## Design notes
|
|
2217
1865
|
* The drag delta from the dispatcher is in screen space (pixels). The pan
|
|
@@ -2459,25 +2107,34 @@ declare const editAnchorsAction: Action & {
|
|
|
2459
2107
|
* Implements lasso-select via the full pointermove stream (accumulated in
|
|
2460
2108
|
* `InvocationCtx.drag.points` by the dispatcher extension):
|
|
2461
2109
|
* - `start`: initializes vertex list from the drag-start world point.
|
|
2462
|
-
* - `onMove`: appends the current world point
|
|
2463
|
-
*
|
|
2110
|
+
* - `onMove`: appends the current world point, skipping one closer than
|
|
2111
|
+
* the binding's `params.minVertexSpacing` (default 2 world-px) to the
|
|
2112
|
+
* last vertex.
|
|
2464
2113
|
* - `onEnd('commit')`: performs hit-testing against the accumulated polygon.
|
|
2465
|
-
* Uses `dep.hitTestLasso(polygon,
|
|
2466
|
-
*
|
|
2114
|
+
* Uses `dep.hitTestLasso(polygon, mode)` when available — `mode` from the
|
|
2115
|
+
* binding's `params.mode`, default `'intersect'` — otherwise falls back to
|
|
2116
|
+
* the polygon's AABB via `dep.hitTestArea(bounds)`.
|
|
2467
2117
|
* Extends selection with shift, replaces otherwise.
|
|
2468
2118
|
* - `onEnd('cancel')`: no-op.
|
|
2469
2119
|
*
|
|
2120
|
+
* ## Behaviors
|
|
2121
|
+
*
|
|
2122
|
+
* `opts.behaviors` (`LassoSelectBehavior[]`) run over a `GestureContext`
|
|
2123
|
+
* whose `origin.get('gesture')` is the start pose, whose scratch holds the
|
|
2124
|
+
* vertices under `LASSO_VERTICES`, and whose adapter answers selection and
|
|
2125
|
+
* hit-testing from the `lassoSelect` dep. `onEnd` is first-non-undefined-wins:
|
|
2126
|
+
* `Op[]` is applied in place of the default selection, `null` aborts, and
|
|
2127
|
+
* all-`undefined` falls through to it.
|
|
2128
|
+
*
|
|
2470
2129
|
* ## Dep
|
|
2471
2130
|
*
|
|
2472
2131
|
* Requires `lassoSelect` dep from DepSchema:
|
|
2473
2132
|
* `{ hitTestLasso?(...), hitTestArea(...), getSelection(), setSelection(ids) }`
|
|
2474
2133
|
*
|
|
2475
|
-
* ## What this does NOT wire
|
|
2134
|
+
* ## What this does NOT wire
|
|
2476
2135
|
*
|
|
2477
|
-
* -
|
|
2478
|
-
*
|
|
2479
|
-
* - Transient vs. committed history modes — always transient (no undo entry),
|
|
2480
|
-
* matching `useLassoSelect`'s `defaultTransient: true` convention.
|
|
2136
|
+
* - Committed history — always transient (no undo entry); a behavior's ops
|
|
2137
|
+
* are applied the same way.
|
|
2481
2138
|
* - Debug sink recording.
|
|
2482
2139
|
*/
|
|
2483
2140
|
|
|
@@ -2785,7 +2442,7 @@ declare function defaultCommitAdapter<TPose>(scene: Scene<unknown, string, TPose
|
|
|
2785
2442
|
|
|
2786
2443
|
/** Options for `useResizePolicy`. Each omitted field falls back to the kit
|
|
2787
2444
|
* default. */
|
|
2788
|
-
interface UseResizePolicyOptions<TPose> {
|
|
2445
|
+
interface UseResizePolicyOptions<TPose> extends GestureLifecycleOptions {
|
|
2789
2446
|
constraints?: TPose extends Bounds ? BoundsConstraint<TPose>[] : never[];
|
|
2790
2447
|
pointSnap?: TPose extends Bounds ? PointSnapBehavior<TPose>[] : never[];
|
|
2791
2448
|
expandIds?: (ids: string[]) => string[];
|
|
@@ -2928,49 +2585,12 @@ declare function createVelocityTracker(): VelocityTracker;
|
|
|
2928
2585
|
* over the last 100ms — the throw speed a momentum decay starts from. */
|
|
2929
2586
|
declare function useVelocityTracker(): VelocityTracker;
|
|
2930
2587
|
|
|
2931
|
-
/**
|
|
2932
|
-
* Detects two-finger pinch on a canvas element.
|
|
2933
|
-
*
|
|
2934
|
-
* @param onPinch Called with the gesture midpoint in **client coordinates** and
|
|
2935
|
-
* a per-frame scale factor (ratio of current distance to previous frame's
|
|
2936
|
-
* distance, not cumulative from gesture start). With 3+ fingers, the first
|
|
2937
|
-
* two by insertion order are tracked.
|
|
2938
|
-
*/
|
|
2939
|
-
declare function usePinchGesture(canvasRef: React.RefObject<HTMLElement | null>, onPinch: (anchor: {
|
|
2940
|
-
x: number;
|
|
2941
|
-
y: number;
|
|
2942
|
-
}, scaleFactor: number) => void, enabled?: boolean): void;
|
|
2943
|
-
|
|
2944
2588
|
/**
|
|
2945
2589
|
* `InterpolatorFactory<View>` for camera animation — built once per animation,
|
|
2946
2590
|
* called with eased `t` each frame. Pass to `Animator.tween`'s `interpolator`.
|
|
2947
2591
|
*/
|
|
2948
2592
|
declare function interpolateView(from: View, to: View): (t: number) => View;
|
|
2949
2593
|
|
|
2950
|
-
/**
|
|
2951
|
-
* The routing types that carry an overlay, bound to the kit's `RenderLayer`.
|
|
2952
|
-
*
|
|
2953
|
-
* `@weasel-js/routing` never reads an overlay — it collects the live ones and
|
|
2954
|
-
* hands them back in scope order — so it leaves the element type open. What a
|
|
2955
|
-
* weasel canvas draws is a `RenderLayer`, and every kit call site should see
|
|
2956
|
-
* that rather than `unknown`, so core binds the parameter once, here, and
|
|
2957
|
-
* re-exports these names under the ones they have always had.
|
|
2958
|
-
*/
|
|
2959
|
-
|
|
2960
|
-
/** What a canvas overlay is, at this layer. */
|
|
2961
|
-
type Overlay = RenderLayer<unknown>;
|
|
2962
|
-
type Contribution = Contribution$1<Overlay>;
|
|
2963
|
-
type ContributionChrome = ContributionChrome$1<Overlay>;
|
|
2964
|
-
type Tool<TScratch = unknown> = Tool$1<TScratch, Overlay>;
|
|
2965
|
-
type AnyTool = AnyToolOf<Overlay>;
|
|
2966
|
-
type ToolDef<TScratch = void> = ToolDef$1<TScratch, Overlay>;
|
|
2967
|
-
type ViewportToolDef<TScratch = void> = ViewportToolDef$1<TScratch, Overlay>;
|
|
2968
|
-
type ToolsApi = ToolsApi$1<Overlay>;
|
|
2969
|
-
type UseToolsOptions = UseToolsOptions$1<Overlay>;
|
|
2970
|
-
declare function defineTool<TScratch = void>(def: ToolDef<TScratch>): Tool<TScratch>;
|
|
2971
|
-
declare function defineViewportTool<TScratch = void>(def: ViewportToolDef<TScratch>): Tool<TScratch>;
|
|
2972
|
-
declare const useTools: (opts: UseToolsOptions) => ToolsApi;
|
|
2973
|
-
|
|
2974
2594
|
/** Options for `useKeybindings`. */
|
|
2975
2595
|
interface UseKeybindingsOptions {
|
|
2976
2596
|
/** Skip all wiring. Useful for touch apps or test isolation. */
|
|
@@ -2982,7 +2602,7 @@ interface UseKeybindingsOptions {
|
|
|
2982
2602
|
/**
|
|
2983
2603
|
* Gate for keyboard tool activation: return false to refuse a tool the
|
|
2984
2604
|
* active mode doesn't allow. `<SceneCanvas>` wires this from
|
|
2985
|
-
* `
|
|
2605
|
+
* its `modes` registry + each tool's `eligibility.capabilities`, using the same predicate
|
|
2986
2606
|
* `ToolPalette` uses to grey a button out — so the grey-out becomes a
|
|
2987
2607
|
* guarantee rather than a hint.
|
|
2988
2608
|
*
|
|
@@ -3029,9 +2649,6 @@ interface ToolPrefBase<K extends string, Value> {
|
|
|
3029
2649
|
}
|
|
3030
2650
|
/** How a schema-driven UI should present a number pref. */
|
|
3031
2651
|
type ToolPrefNumberControl = 'input' | 'slider';
|
|
3032
|
-
/** How a schema-driven UI should show a number pref's value. `compact`
|
|
3033
|
-
* abbreviates from a thousand up, as in `2.0M`. */
|
|
3034
|
-
type ToolPrefNumberFormat = 'plain' | 'compact';
|
|
3035
2652
|
/** How a schema-driven UI should present a boolean pref. */
|
|
3036
2653
|
type ToolPrefBooleanControl = 'checkbox' | 'switch' | 'toggle';
|
|
3037
2654
|
/** How a schema-driven UI should present a string pref. */
|
|
@@ -3071,12 +2688,26 @@ interface ToolPrefNumber extends ToolPrefBase<'number', number> {
|
|
|
3071
2688
|
max?: number;
|
|
3072
2689
|
step?: number;
|
|
3073
2690
|
control?: ToolPrefNumberControl;
|
|
3074
|
-
|
|
2691
|
+
/** How the value shows, speaks and reads back when typed — `compact()`
|
|
2692
|
+
* reads `2.00M`. Presentation only: the stored value stays a number. */
|
|
2693
|
+
display?: Display;
|
|
3075
2694
|
unit?: ToolPrefNumberUnit;
|
|
3076
2695
|
}
|
|
2696
|
+
/**
|
|
2697
|
+
* Stored-value bridge for a boolean leaf whose field is not a boolean — the
|
|
2698
|
+
* flag counterpart of {@link ToolPrefEnumEncoding}. `TextStyle.fontStyle` is
|
|
2699
|
+
* the case: it stores `'italic'`, and the control is an Italic toggle.
|
|
2700
|
+
*/
|
|
2701
|
+
interface ToolPrefBooleanEncoding {
|
|
2702
|
+
/** Whether `stored` reads as on. */
|
|
2703
|
+
read: (stored: unknown, siblings: Record<string, unknown> | undefined) => boolean;
|
|
2704
|
+
/** What to store for `on`. `undefined` removes the field. */
|
|
2705
|
+
write: (on: boolean, siblings: Record<string, unknown> | undefined) => unknown;
|
|
2706
|
+
}
|
|
3077
2707
|
/** An on/off pref. */
|
|
3078
2708
|
interface ToolPrefBoolean extends ToolPrefBase<'boolean', boolean> {
|
|
3079
2709
|
control?: ToolPrefBooleanControl;
|
|
2710
|
+
encoding?: ToolPrefBooleanEncoding;
|
|
3080
2711
|
}
|
|
3081
2712
|
/** A free-text pref. */
|
|
3082
2713
|
interface ToolPrefString extends ToolPrefBase<'string', string> {
|
|
@@ -3104,8 +2735,16 @@ interface ToolPrefEnumEncoding<T extends string = string> {
|
|
|
3104
2735
|
/** What to store for `option`. `undefined` removes the field. */
|
|
3105
2736
|
write: (option: T, siblings: Record<string, unknown> | undefined) => unknown;
|
|
3106
2737
|
}
|
|
3107
|
-
/** A pref with a fixed set of labeled choices.
|
|
3108
|
-
|
|
2738
|
+
/** A pref with a fixed set of labeled choices. `default` is `undefined` only
|
|
2739
|
+
* for a {@link ToolPrefEnum.clearable} leaf, whose absence is a value. */
|
|
2740
|
+
interface ToolPrefEnum<T extends string = string> extends ToolPrefBase<'enum', T | undefined> {
|
|
2741
|
+
/**
|
|
2742
|
+
* The field may hold none of the options, and that absence is a state of
|
|
2743
|
+
* its own rather than a missing value — a script that is neither super nor
|
|
2744
|
+
* sub. A toggle control then lets the chosen segment be clicked off, which
|
|
2745
|
+
* removes the field.
|
|
2746
|
+
*/
|
|
2747
|
+
clearable?: boolean;
|
|
3109
2748
|
/** `short` is the label a segmented control uses when a full one would not
|
|
3110
2749
|
* fit — a capital or two. `icon` names a glyph in the host UI's set
|
|
3111
2750
|
* (weasel-ui resolves it against `ICON_PATHS`) and outranks `short` where
|
|
@@ -3136,207 +2775,84 @@ interface ToolPrefColor extends ToolPrefBase<'color', string> {
|
|
|
3136
2775
|
alpha?: boolean;
|
|
3137
2776
|
}
|
|
3138
2777
|
/**
|
|
3139
|
-
* Open leaf: any node with a `kind` outside the built-ins. Schema-driven
|
|
3140
|
-
* UIs (weasel-ui `PrefsForm` / `SelectionPanel`) dispatch it to an
|
|
3141
|
-
* app-supplied renderer. Deliberately NOT index-signatured so concrete
|
|
3142
|
-
* app interfaces stay assignable. Mirrors weasel-ui's `PrefCustom`.
|
|
3143
|
-
*/
|
|
3144
|
-
type ToolPrefCustom = ToolPrefBase<string, unknown>;
|
|
3145
|
-
/**
|
|
3146
|
-
* A whole `FillStyle`, not a color inside one. Use it wherever the value is
|
|
3147
|
-
* the tagged paint union — a solid color, a pattern, a gradient — rather
|
|
3148
|
-
* than a hex string.
|
|
3149
|
-
*
|
|
3150
|
-
* Addressing `…fill.color` instead reads `undefined` off a gradient (so the
|
|
3151
|
-
* control shows its default and claims the text is black) and writes a
|
|
3152
|
-
* hybrid `{ fill: 'gradient', stops, color }` that the renderer's structural
|
|
3153
|
-
* `'color' in paint` checks then paint flat solid. The union has to be
|
|
3154
|
-
* edited as a union.
|
|
3155
|
-
*/
|
|
3156
|
-
interface ToolPrefPaint extends ToolPrefBase<'paint', unknown> {
|
|
3157
|
-
/** Offer an opacity control alongside the color. */
|
|
3158
|
-
alpha?: boolean;
|
|
3159
|
-
}
|
|
3160
|
-
/**
|
|
3161
|
-
* A leaf whose value is one object, with its own fields hanging off it.
|
|
3162
|
-
*
|
|
3163
|
-
* A compound value — a stroke, a shadow, a pattern spec — could be described
|
|
3164
|
-
* as several sibling leaves addressing into it (`data.stroke.width`,
|
|
3165
|
-
* `data.stroke.cap`). It shouldn't be: each control would then write one field
|
|
3166
|
-
* of a value it can only half see, and writing into something that is not an
|
|
3167
|
-
* object yet corrupts it. Here the fields are `children` of one leaf, and
|
|
3168
|
-
* every edit commits the parent object whole.
|
|
3169
|
-
*
|
|
3170
|
-
* `children` paths are relative to the object. They are ordinary leaves, so a
|
|
3171
|
-
* field that is itself a union (a stroke's `paint`) declares the kind that
|
|
3172
|
-
* edits that union. A child may also be a {@link ToolPrefGroup}, which
|
|
3173
|
-
* organises the fields under a heading without contributing to the path —
|
|
3174
|
-
* the same rule group keys follow at the top level. A `TextStyle` needs it:
|
|
3175
|
-
* its character and paragraph fields belong to one value but read as two
|
|
3176
|
-
* lists.
|
|
3177
|
-
*/
|
|
3178
|
-
interface ToolPrefObject extends ToolPrefBase<'object', unknown> {
|
|
3179
|
-
children: Record<string, ToolPrefLeaf | ToolPrefGroup>;
|
|
3180
|
-
/**
|
|
3181
|
-
* Lift a non-object value into the object form, for a consumer field that
|
|
3182
|
-
* may also be held as a scalar. Called before a child edit is applied;
|
|
3183
|
-
* without it a scalar-valued leaf shows its children empty and refuses the
|
|
3184
|
-
* edit.
|
|
3185
|
-
*/
|
|
3186
|
-
fromScalar?: (value: unknown) => Record<string, unknown>;
|
|
3187
|
-
}
|
|
3188
|
-
/** One built-in pref leaf. `ToolPrefLeaf` widens this to include
|
|
3189
|
-
* app-defined kinds. */
|
|
3190
|
-
type ToolPref = ToolPrefNumber | ToolPrefBoolean | ToolPrefString | ToolPrefEnum | ToolPrefColor | ToolPrefPaint | ToolPrefObject;
|
|
3191
|
-
/**
|
|
3192
|
-
* The built-in kinds, as a table. A kind added to {@link ToolPrefKind} is a
|
|
3193
|
-
* compile error here, and from here it is one in every renderer's `never`
|
|
3194
|
-
* guard — the only thing standing between a new kind and rendering as
|
|
3195
|
-
* nothing in four places at once.
|
|
3196
|
-
*/
|
|
3197
|
-
declare const TOOL_PREF_KINDS: Record<ToolPrefKind, true>;
|
|
3198
|
-
/**
|
|
3199
|
-
* Narrows a leaf to the built-in union, so a renderer's switch discriminates
|
|
3200
|
-
* on {@link ToolPrefKind} instead of the open `string` that
|
|
3201
|
-
* {@link ToolPrefCustom} widens `kind` to. An app-defined kind answers false
|
|
3202
|
-
* and belongs to the renderer's custom-renderer path.
|
|
3203
|
-
*/
|
|
3204
|
-
declare function isBuiltinToolPref(leaf: ToolPrefLeaf): leaf is ToolPref;
|
|
3205
|
-
/** Built-in or app-defined leaf. */
|
|
3206
|
-
type ToolPrefLeaf = ToolPref | ToolPrefCustom;
|
|
3207
|
-
/** Nestable group: branch nodes a tool can use to organize its prefs. */
|
|
3208
|
-
interface ToolPrefGroup {
|
|
3209
|
-
/** Heading for the group's rows. **Empty means no heading** — for a group
|
|
3210
|
-
* that exists to organise, not to name: one whose children are themselves
|
|
3211
|
-
* groups carrying the labels a reader needs. Give it a name whenever the
|
|
3212
|
-
* name is the referent (a `Border` group over `Top` / `Right` / `Bottom`
|
|
3213
|
-
* reads as nothing without it). */
|
|
3214
|
-
name: string;
|
|
3215
|
-
description?: string;
|
|
3216
|
-
children: Record<string, ToolPrefLeaf | ToolPrefGroup>;
|
|
3217
|
-
}
|
|
3218
|
-
|
|
3219
|
-
/**
|
|
3220
|
-
* `DebugSink`, `HitShape` and `HandleKind` are declared in
|
|
3221
|
-
* `@weasel-js/routing` — `ToolCtx.debug` carries a sink, so routing has to
|
|
3222
|
-
* name the type. Re-exported here, beside the overlay that reads one.
|
|
3223
|
-
*/
|
|
3224
|
-
|
|
3225
|
-
/** One bit per debug feature; absent keys are off. */
|
|
3226
|
-
interface DebugConfig {
|
|
3227
|
-
hitboxes?: boolean;
|
|
3228
|
-
handles?: boolean;
|
|
3229
|
-
bounds?: boolean;
|
|
3230
|
-
origins?: boolean;
|
|
3231
|
-
snap?: boolean;
|
|
3232
|
-
layers?: boolean;
|
|
3233
|
-
/** Render each tracked node's id as a label at the top-left of its
|
|
3234
|
-
* bounds. Pulls from the same `recordBounds` stream `bounds` uses, so
|
|
3235
|
-
* no extra sink calls are required to enable. */
|
|
3236
|
-
ids?: boolean;
|
|
3237
|
-
/** Rolling FPS counter rendered in the top-left corner of the canvas.
|
|
3238
|
-
* Tracks the rate at which the debug overlay's draw callback runs;
|
|
3239
|
-
* this matches the canvas's effective repaint rate. */
|
|
3240
|
-
fps?: boolean;
|
|
3241
|
-
/** Optional per-feature color overrides; falls back to the default theme. */
|
|
3242
|
-
theme?: Partial<DebugTheme>;
|
|
3243
|
-
/** Optional per-feature line-width / dash overrides; falls back to
|
|
3244
|
-
* {@link DEFAULT_DEBUG_STROKES}. */
|
|
3245
|
-
strokes?: Partial<DebugStrokes>;
|
|
3246
|
-
}
|
|
3247
|
-
/** The name of one debug-overlay feature — the keys of {@link DebugConfig}
|
|
3248
|
-
* that toggle a visualization. */
|
|
3249
|
-
type DebugFeature = 'hitboxes' | 'handles' | 'bounds' | 'origins' | 'snap' | 'layers' | 'ids' | 'fps';
|
|
3250
|
-
/** Colors the debug overlay draws with, one entry per feature. */
|
|
3251
|
-
interface DebugTheme {
|
|
3252
|
-
hitboxFill: string;
|
|
3253
|
-
hitboxStroke: string;
|
|
3254
|
-
handle: string;
|
|
3255
|
-
bounds: string;
|
|
3256
|
-
origin: string;
|
|
3257
|
-
snap: string;
|
|
3258
|
-
layerText: string;
|
|
3259
|
-
layerTextBg: string;
|
|
3260
|
-
/** Color for the per-node id label rendered when `config.ids` is on. */
|
|
3261
|
-
idText: string;
|
|
3262
|
-
/** Foreground / background for the FPS panel. */
|
|
3263
|
-
fpsText: string;
|
|
3264
|
-
fpsTextBg: string;
|
|
3265
|
-
}
|
|
3266
|
-
/** Line width and dash pattern for one stroked debug feature. An empty (or
|
|
3267
|
-
* omitted) `dash` is a solid line. */
|
|
3268
|
-
interface DebugStroke {
|
|
3269
|
-
width: number;
|
|
3270
|
-
dash?: readonly number[];
|
|
3271
|
-
}
|
|
3272
|
-
/** The stroked half of the debug overlay's appearance, split from
|
|
3273
|
-
* {@link DebugTheme} because only some features draw a line at all — text
|
|
3274
|
-
* panels and filled origin dots take color and nothing else. */
|
|
3275
|
-
interface DebugStrokes {
|
|
3276
|
-
hitbox: DebugStroke;
|
|
3277
|
-
bounds: DebugStroke;
|
|
3278
|
-
handle: DebugStroke;
|
|
3279
|
-
/** Rejected snap candidates only; accepted ones paint as a filled dot. */
|
|
3280
|
-
snap: DebugStroke;
|
|
3281
|
-
}
|
|
3282
|
-
/** A hit region tested during the current frame. */
|
|
3283
|
-
interface RecordedHitbox {
|
|
3284
|
-
id: string;
|
|
3285
|
-
kind: 'body' | 'handle' | 'rotation' | 'anchor';
|
|
3286
|
-
shape: HitShape;
|
|
3287
|
-
}
|
|
3288
|
-
/** A handle drawn during the current frame, and where. */
|
|
3289
|
-
interface RecordedHandle {
|
|
3290
|
-
id: string;
|
|
3291
|
-
position: {
|
|
3292
|
-
x: number;
|
|
3293
|
-
y: number;
|
|
3294
|
-
};
|
|
3295
|
-
kind: HandleKind;
|
|
3296
|
-
}
|
|
3297
|
-
/** A node's bounds as computed during the current frame. */
|
|
3298
|
-
interface RecordedBounds {
|
|
3299
|
-
id: string;
|
|
3300
|
-
bounds: {
|
|
3301
|
-
x: number;
|
|
3302
|
-
y: number;
|
|
3303
|
-
width: number;
|
|
3304
|
-
height: number;
|
|
3305
|
-
};
|
|
3306
|
-
}
|
|
3307
|
-
/** A node's transform origin as used during the current frame. */
|
|
3308
|
-
interface RecordedOrigin {
|
|
3309
|
-
id: string;
|
|
3310
|
-
point: {
|
|
3311
|
-
x: number;
|
|
3312
|
-
y: number;
|
|
3313
|
-
};
|
|
3314
|
-
}
|
|
3315
|
-
/** A snap candidate considered during the current gesture, and whether it
|
|
3316
|
-
* won. Unlike the other records these survive across frames, until the
|
|
3317
|
-
* gesture ends. */
|
|
3318
|
-
interface RecordedSnap {
|
|
3319
|
-
point: {
|
|
3320
|
-
x: number;
|
|
3321
|
-
y: number;
|
|
3322
|
-
};
|
|
3323
|
-
accepted: boolean;
|
|
2778
|
+
* Open leaf: any node with a `kind` outside the built-ins. Schema-driven
|
|
2779
|
+
* UIs (weasel-ui `PrefsForm` / `SelectionPanel`) dispatch it to an
|
|
2780
|
+
* app-supplied renderer. Deliberately NOT index-signatured so concrete
|
|
2781
|
+
* app interfaces stay assignable. Mirrors weasel-ui's `PrefCustom`.
|
|
2782
|
+
*/
|
|
2783
|
+
type ToolPrefCustom = ToolPrefBase<string, unknown>;
|
|
2784
|
+
/**
|
|
2785
|
+
* A whole `FillStyle`, not a color inside one. Use it wherever the value is
|
|
2786
|
+
* the tagged paint union — a solid color, a pattern, a gradient — rather
|
|
2787
|
+
* than a hex string.
|
|
2788
|
+
*
|
|
2789
|
+
* Addressing `…fill.color` instead reads `undefined` off a gradient (so the
|
|
2790
|
+
* control shows its default and claims the text is black) and writes a
|
|
2791
|
+
* hybrid `{ fill: 'gradient', stops, color }` that the renderer's structural
|
|
2792
|
+
* `'color' in paint` checks then paint flat solid. The union has to be
|
|
2793
|
+
* edited as a union.
|
|
2794
|
+
*/
|
|
2795
|
+
interface ToolPrefPaint extends ToolPrefBase<'paint', unknown> {
|
|
2796
|
+
/** Offer an opacity control alongside the color. */
|
|
2797
|
+
alpha?: boolean;
|
|
3324
2798
|
}
|
|
3325
|
-
/**
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
2799
|
+
/**
|
|
2800
|
+
* A leaf whose value is one object, with its own fields hanging off it.
|
|
2801
|
+
*
|
|
2802
|
+
* A compound value — a stroke, a shadow, a pattern spec — could be described
|
|
2803
|
+
* as several sibling leaves addressing into it (`data.stroke.width`,
|
|
2804
|
+
* `data.stroke.cap`). It shouldn't be: each control would then write one field
|
|
2805
|
+
* of a value it can only half see, and writing into something that is not an
|
|
2806
|
+
* object yet corrupts it. Here the fields are `children` of one leaf, and
|
|
2807
|
+
* every edit commits the parent object whole.
|
|
2808
|
+
*
|
|
2809
|
+
* `children` paths are relative to the object. They are ordinary leaves, so a
|
|
2810
|
+
* field that is itself a union (a stroke's `paint`) declares the kind that
|
|
2811
|
+
* edits that union. A child may also be a {@link ToolPrefGroup}, which
|
|
2812
|
+
* organises the fields under a heading without contributing to the path —
|
|
2813
|
+
* the same rule group keys follow at the top level. A `TextStyle` needs it:
|
|
2814
|
+
* its character and paragraph fields belong to one value but read as two
|
|
2815
|
+
* lists.
|
|
2816
|
+
*/
|
|
2817
|
+
interface ToolPrefObject extends ToolPrefBase<'object', unknown> {
|
|
2818
|
+
children: Record<string, ToolPrefLeaf | ToolPrefGroup>;
|
|
2819
|
+
/**
|
|
2820
|
+
* Lift a non-object value into the object form, for a consumer field that
|
|
2821
|
+
* may also be held as a scalar. Called before a child edit is applied;
|
|
2822
|
+
* without it a scalar-valued leaf shows its children empty and refuses the
|
|
2823
|
+
* edit.
|
|
2824
|
+
*/
|
|
2825
|
+
fromScalar?: (value: unknown) => Record<string, unknown>;
|
|
3331
2826
|
}
|
|
3332
|
-
/**
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
2827
|
+
/** One built-in pref leaf. `ToolPrefLeaf` widens this to include
|
|
2828
|
+
* app-defined kinds. */
|
|
2829
|
+
type ToolPref = ToolPrefNumber | ToolPrefBoolean | ToolPrefString | ToolPrefEnum | ToolPrefColor | ToolPrefPaint | ToolPrefObject;
|
|
2830
|
+
/**
|
|
2831
|
+
* The built-in kinds, as a table. A kind added to {@link ToolPrefKind} is a
|
|
2832
|
+
* compile error here, and from here it is one in every renderer's `never`
|
|
2833
|
+
* guard — the only thing standing between a new kind and rendering as
|
|
2834
|
+
* nothing in four places at once.
|
|
2835
|
+
*/
|
|
2836
|
+
declare const TOOL_PREF_KINDS: Record<ToolPrefKind, true>;
|
|
2837
|
+
/**
|
|
2838
|
+
* Narrows a leaf to the built-in union, so a renderer's switch discriminates
|
|
2839
|
+
* on {@link ToolPrefKind} instead of the open `string` that
|
|
2840
|
+
* {@link ToolPrefCustom} widens `kind` to. An app-defined kind answers false
|
|
2841
|
+
* and belongs to the renderer's custom-renderer path.
|
|
2842
|
+
*/
|
|
2843
|
+
declare function isBuiltinToolPref(leaf: ToolPrefLeaf): leaf is ToolPref;
|
|
2844
|
+
/** Built-in or app-defined leaf. */
|
|
2845
|
+
type ToolPrefLeaf = ToolPref | ToolPrefCustom;
|
|
2846
|
+
/** Nestable group: branch nodes a tool can use to organize its prefs. */
|
|
2847
|
+
interface ToolPrefGroup {
|
|
2848
|
+
/** Heading for the group's rows. **Empty means no heading** — for a group
|
|
2849
|
+
* that exists to organise, not to name: one whose children are themselves
|
|
2850
|
+
* groups carrying the labels a reader needs. Give it a name whenever the
|
|
2851
|
+
* name is the referent (a `Border` group over `Top` / `Right` / `Bottom`
|
|
2852
|
+
* reads as nothing without it). */
|
|
2853
|
+
name: string;
|
|
2854
|
+
description?: string;
|
|
2855
|
+
children: Record<string, ToolPrefLeaf | ToolPrefGroup>;
|
|
3340
2856
|
}
|
|
3341
2857
|
|
|
3342
2858
|
/** Options for `useSelectTool`: how a point resolves to nodes, how a click
|
|
@@ -3391,11 +2907,6 @@ interface UseSelectToolOptions<TPose> {
|
|
|
3391
2907
|
/** Whether a node's `layer` reaches the screen in the view this tool picks
|
|
3392
2908
|
* for. Ignored when `pickEvery` is supplied. */
|
|
3393
2909
|
layerIsPainted?: (layer: string) => boolean;
|
|
3394
|
-
/** Move-action options. The move gesture is dispatcher-routed,
|
|
3395
|
-
* so only `behaviors` is consumed here — threaded into the move binding's
|
|
3396
|
-
* `opts.behaviors`. Other `UseMoveOptions` fields are accepted for API shape
|
|
3397
|
-
* but not read by this tool. */
|
|
3398
|
-
move?: UseMoveOptions<TPose>;
|
|
3399
2910
|
/**
|
|
3400
2911
|
* When this returns true, a Shift/Meta extend-click must NOT change the
|
|
3401
2912
|
* node selection.
|
|
@@ -3410,16 +2921,6 @@ interface UseSelectToolOptions<TPose> {
|
|
|
3410
2921
|
* clicking a different node exits edit mode as usual.
|
|
3411
2922
|
*/
|
|
3412
2923
|
extendClickLocked?: () => boolean;
|
|
3413
|
-
/** Optional debug sink. Reserved for future overlay/affordance hitbox
|
|
3414
|
-
* recording. */
|
|
3415
|
-
debug?: DebugSink;
|
|
3416
|
-
/** Reparent-on-drop behavior for drag-to-move. `'off'` (default)
|
|
3417
|
-
* preserves translate-only commits. `'top'` lands the moved nodes at
|
|
3418
|
-
* the top of the container under the drop point. `'above'` lands them
|
|
3419
|
-
* immediately above the hit sibling in z-order (falls back to `'top'`
|
|
3420
|
-
* semantics when the hit is itself a container). Requires the
|
|
3421
|
-
* `nodeAtPoint` dep to be registered (sourced by `<SceneCanvas>`). */
|
|
3422
|
-
reparentOnDrop?: 'off' | 'top' | 'above';
|
|
3423
2924
|
}
|
|
3424
2925
|
/** Intersection of the move + area-select adapter interfaces.
|
|
3425
2926
|
* Resize and rotate run through `resizeAction` / `rotateAction`. */
|
|
@@ -3430,17 +2931,96 @@ type SelectAdapter<TNode extends {
|
|
|
3430
2931
|
* - `select.pick` classifies the press (pointerDown) — it runs the tool's own
|
|
3431
2932
|
* pickBest/pickEvery so click semantics (selection replace, extend,
|
|
3432
2933
|
* deferred collapse) live in one place.
|
|
3433
|
-
* - drag
|
|
3434
|
-
* (
|
|
3435
|
-
*
|
|
3436
|
-
* -
|
|
3437
|
-
*
|
|
3438
|
-
* overlay layer (driven by areaSelectAction's `overlay()`).
|
|
2934
|
+
* - an empty drag marquees (`areaSelect`) and a click on empty clears the
|
|
2935
|
+
* selection (`clearSelection`); the marquee renders via the dispatcher
|
|
2936
|
+
* overlay layer, driven by areaSelectAction's `overlay()`.
|
|
2937
|
+
* - moving and transforming the selection are not the tool's: they are the
|
|
2938
|
+
* ambient bindings in `selectionContributions.ts`.
|
|
3439
2939
|
*/
|
|
3440
2940
|
declare function useSelectTool<TNode extends {
|
|
3441
2941
|
id: string;
|
|
3442
2942
|
}, TPose>(adapter: SelectAdapter<TNode, TPose>, options: UseSelectToolOptions<TPose>): Tool<null>;
|
|
3443
2943
|
|
|
2944
|
+
/** Option surface for the `rotate` action. */
|
|
2945
|
+
|
|
2946
|
+
/** Options for the `rotate` action. `selectionTransformBindings` threads
|
|
2947
|
+
* them into the rotation handle's binding. */
|
|
2948
|
+
interface UseRotateOptions<TPose> {
|
|
2949
|
+
/** Behaviors are typed against the pose shape; typed `never` for a pose
|
|
2950
|
+
* without a numeric `rotation`. `onMove` sees the first rotated node's
|
|
2951
|
+
* turned pose, and a pose it returns sets the rotation for the whole
|
|
2952
|
+
* selection. */
|
|
2953
|
+
behaviors?: TPose extends RotatedPose ? RotateBehavior<TPose>[] : never;
|
|
2954
|
+
/** History label for the committed rotation. Default `'Rotate'`. */
|
|
2955
|
+
rotateLabel?: string;
|
|
2956
|
+
/** Commit without an undo entry (`scene.untracked`), bypassing the
|
|
2957
|
+
* consumer `applyOps` hook. Unset, a behavior's `defaultTransient` decides. */
|
|
2958
|
+
transient?: boolean;
|
|
2959
|
+
/** Fired when the rotation starts, with the ids it turns. */
|
|
2960
|
+
onGestureStart?: (ids: string[]) => void;
|
|
2961
|
+
/** Fired once per `onGestureStart`: `true` when the rotation wrote to the
|
|
2962
|
+
* document, `false` on cancel, a behavior abort, or no net turn. */
|
|
2963
|
+
onGestureEnd?: (committed: boolean) => void;
|
|
2964
|
+
/** Multi-selection pivot mode. Default `'union'`.
|
|
2965
|
+
* - `'each'`: each item rotates around its own center.
|
|
2966
|
+
* - `'union'`: each item rotates around the selection's union center;
|
|
2967
|
+
* item centers orbit the union center while also gaining the same
|
|
2968
|
+
* rotation delta.
|
|
2969
|
+
* Has no effect on single-id gestures. */
|
|
2970
|
+
pivot?: 'each' | 'union';
|
|
2971
|
+
}
|
|
2972
|
+
|
|
2973
|
+
/**
|
|
2974
|
+
* The ambient bindings that act on the selection: moving it, cloning it, and
|
|
2975
|
+
* resizing or rotating it from its handles. They belong to the selection, not
|
|
2976
|
+
* to the select tool, so they run under any tool that does not claim the
|
|
2977
|
+
* gesture itself. `<SceneCanvas features>` installs them as the `move` and
|
|
2978
|
+
* `transform` presets.
|
|
2979
|
+
*/
|
|
2980
|
+
|
|
2981
|
+
/** Options for {@link selectionMoveContribution}. */
|
|
2982
|
+
interface SelectionMoveOptions<TPose = unknown> {
|
|
2983
|
+
/** Move-action options: `behaviors` become the move bindings'
|
|
2984
|
+
* `opts.behaviors`, everything else their `opts.params`. */
|
|
2985
|
+
move?: UseMoveOptions<TPose>;
|
|
2986
|
+
/** Reparent-on-drop behavior for drag-to-move. `'off'` (default) keeps
|
|
2987
|
+
* translate-only commits. `'top'` lands the moved nodes at the top of the
|
|
2988
|
+
* container under the drop point; `'above'` lands them immediately above the
|
|
2989
|
+
* hit sibling. Requires the `nodeAtPoint` dep (`<SceneCanvas>` sources it). */
|
|
2990
|
+
reparentOnDrop?: 'off' | 'top' | 'above';
|
|
2991
|
+
}
|
|
2992
|
+
/** Id of the entry {@link selectionMoveContribution} builds. */
|
|
2993
|
+
declare const SELECTION_MOVE_ID = "selection.move";
|
|
2994
|
+
/** Id of the entry {@link selectionTransformContribution} builds. */
|
|
2995
|
+
declare const SELECTION_TRANSFORM_ID = "selection.transform";
|
|
2996
|
+
/** Drag a body to move the selection; Alt-drag to clone it. */
|
|
2997
|
+
declare function selectionMoveBindings<TPose>(options?: SelectionMoveOptions<TPose>): GestureBinding[];
|
|
2998
|
+
/** Options for {@link selectionTransformContribution}. Resize takes its
|
|
2999
|
+
* options through the `resizePolicy` dep (`useResizePolicy`), not here. */
|
|
3000
|
+
interface SelectionTransformOptions<TPose = unknown> {
|
|
3001
|
+
/** Rotate-action options: `behaviors` become the rotate binding's
|
|
3002
|
+
* `opts.behaviors`, everything else its `opts.params`. */
|
|
3003
|
+
rotate?: UseRotateOptions<TPose>;
|
|
3004
|
+
}
|
|
3005
|
+
/** Drag a resize handle to resize the selection, the rotation handle to rotate it. */
|
|
3006
|
+
declare function selectionTransformBindings<TPose>(options?: SelectionTransformOptions<TPose>): GestureBinding[];
|
|
3007
|
+
/** An always-live entry carrying {@link selectionMoveBindings}. Add it to a
|
|
3008
|
+
* canvas's ambient list; `<SceneCanvas features={['move']}>` does. */
|
|
3009
|
+
declare function selectionMoveContribution<TPose>(options?: SelectionMoveOptions<TPose>): Contribution;
|
|
3010
|
+
/** An always-live entry carrying {@link selectionTransformBindings}. Add it
|
|
3011
|
+
* to a canvas's ambient list; `<SceneCanvas features={['transform']}>` does. */
|
|
3012
|
+
declare function selectionTransformContribution<TPose>(options?: SelectionTransformOptions<TPose>): Contribution;
|
|
3013
|
+
/** Id of the entry {@link areaSelectContribution} builds. */
|
|
3014
|
+
declare const AREA_SELECT_ID = "selection.areaSelect";
|
|
3015
|
+
/** A press on empty canvas: no hit, and not on chrome over it — the rotation
|
|
3016
|
+
* handle and the outer half of a resize handle sit off the body. */
|
|
3017
|
+
declare const onEmptyCanvas: (hit: unknown, body?: string) => boolean;
|
|
3018
|
+
/** An always-live entry that marquee-selects on a drag across empty canvas,
|
|
3019
|
+
* under any tool that does not claim the drag itself. No preset installs it:
|
|
3020
|
+
* the select tool already marquees, and a canvas that wants it under every
|
|
3021
|
+
* tool adds this to its ambient list. */
|
|
3022
|
+
declare function areaSelectContribution(): Contribution;
|
|
3023
|
+
|
|
3444
3024
|
/**
|
|
3445
3025
|
* Pick the topmost id from a body-hit list, using whatever signal the
|
|
3446
3026
|
* adapter exposes.
|
|
@@ -3524,6 +3104,14 @@ interface HandScratch {
|
|
|
3524
3104
|
*/
|
|
3525
3105
|
declare function useHandTool(opts?: UseHandToolOptions): Tool<HandScratch | null>;
|
|
3526
3106
|
|
|
3107
|
+
/** Id of the entry {@link dragPanContribution} builds. */
|
|
3108
|
+
declare const DRAG_PAN_ID = "viewport.dragPanBinding";
|
|
3109
|
+
/** An always-live entry that pans the view on a drag no tool claims. No preset
|
|
3110
|
+
* installs it: the hand tool pans, space-held or chosen, and a canvas that
|
|
3111
|
+
* should pan on a plain drag — a viewer, a map — adds this to its ambient
|
|
3112
|
+
* list. `params` are `viewport.dragPan`'s, as the hand tool passes them. */
|
|
3113
|
+
declare function dragPanContribution(params?: DragPanParams): Contribution;
|
|
3114
|
+
|
|
3527
3115
|
/** Text tool. Drag-rect insertion is owned end-to-end by the dispatcher's
|
|
3528
3116
|
* `insertAction` (kind: `'text'`); click-on-selected-text-node enters edit
|
|
3529
3117
|
* mode via the `enterTextEdit` action.
|
|
@@ -3585,10 +3173,17 @@ declare namespace useTextTool {
|
|
|
3585
3173
|
readonly default: false;
|
|
3586
3174
|
};
|
|
3587
3175
|
script: {
|
|
3588
|
-
kind:
|
|
3176
|
+
kind: "enum";
|
|
3589
3177
|
name: string;
|
|
3590
3178
|
description: string;
|
|
3179
|
+
control: "toggle";
|
|
3180
|
+
clearable: true;
|
|
3591
3181
|
default: undefined;
|
|
3182
|
+
options: {
|
|
3183
|
+
value: string;
|
|
3184
|
+
label: string;
|
|
3185
|
+
icon: string;
|
|
3186
|
+
}[];
|
|
3592
3187
|
};
|
|
3593
3188
|
textTransform: {
|
|
3594
3189
|
kind: "enum";
|
|
@@ -3919,34 +3514,22 @@ interface LinePoint {
|
|
|
3919
3514
|
*/
|
|
3920
3515
|
declare function useLineTool(): Tool<null>;
|
|
3921
3516
|
|
|
3922
|
-
/** Option surface for the `lasso-select` action.
|
|
3923
|
-
*
|
|
3924
|
-
* Lives in a sibling file (not `lassoSelect.ts`) so the type contract stays
|
|
3925
|
-
* stable even after the legacy `useLassoSelect` hook is gone.
|
|
3926
|
-
* Consumers should import from here directly; `lassoSelect.ts`
|
|
3927
|
-
* re-exports the same symbol for back-compat. */
|
|
3517
|
+
/** Option surface for the `lasso-select` action. */
|
|
3928
3518
|
|
|
3929
3519
|
/** Options for the `lasso-select` action. */
|
|
3930
3520
|
interface UseLassoSelectOptions {
|
|
3931
3521
|
behaviors?: LassoSelectBehavior[];
|
|
3932
|
-
/** When set, overrides any behavior's `defaultTransient`. */
|
|
3933
|
-
transient?: boolean;
|
|
3934
|
-
/** Label used when transient is false and the hook falls back to applyOps. Default 'Lasso select'. */
|
|
3935
|
-
label?: string;
|
|
3936
|
-
onGestureStart?: () => void;
|
|
3937
|
-
onGestureEnd?: (committed: boolean) => void;
|
|
3938
3522
|
/** Skip vertices closer than this many world-px to the previous one.
|
|
3939
3523
|
* Default 2. Set 0 to record every move sample. */
|
|
3940
3524
|
minVertexSpacing?: number;
|
|
3941
|
-
/** Optional debug sink; receives the live polygon AABB on every move. */
|
|
3942
|
-
debug?: DebugSink;
|
|
3943
3525
|
}
|
|
3944
3526
|
|
|
3945
3527
|
/** Options for `useLassoTool` — the lasso-select action's options plus the
|
|
3946
3528
|
* tool's own hit mode and activation key. */
|
|
3947
|
-
interface UseLassoToolOptions extends
|
|
3948
|
-
/** Hit mode
|
|
3949
|
-
*
|
|
3529
|
+
interface UseLassoToolOptions extends UseLassoSelectOptions {
|
|
3530
|
+
/** Hit mode for the action's own selection commit, which runs when no
|
|
3531
|
+
* behavior claims the gesture. A behavior carries its own, as
|
|
3532
|
+
* `selectFromLasso({ mode })` does. Default 'intersect'. */
|
|
3950
3533
|
mode?: LassoHitMode;
|
|
3951
3534
|
/** Override the default keybinding (`{ key: 'L' }`). Pass `null` to omit. */
|
|
3952
3535
|
keybinding?: ToolKeybinding | null;
|
|
@@ -4798,6 +4381,13 @@ interface CanvasSurfaceHelpers {
|
|
|
4798
4381
|
* are split so a per-view set can be built independently of the surface's,
|
|
4799
4382
|
* not to make layers ask for one. */
|
|
4800
4383
|
interface CanvasHelpers<TPose> extends CanvasViewHelpers<TPose>, CanvasSurfaceHelpers {
|
|
4384
|
+
/**
|
|
4385
|
+
* The view this draw is for: a `<CanvasView>` id, or `null` for the
|
|
4386
|
+
* surface's own camera. One layer array paints every view, so a layer that
|
|
4387
|
+
* belongs in some views and not others — a minimap's indicator — declines
|
|
4388
|
+
* the rest by this id.
|
|
4389
|
+
*/
|
|
4390
|
+
readonly viewId: string | null;
|
|
4801
4391
|
}
|
|
4802
4392
|
|
|
4803
4393
|
/**
|
|
@@ -5286,12 +4876,14 @@ type LayerSlotValue<TNode extends {
|
|
|
5286
4876
|
}, TPose> = StandardSlotConfig<TNode, TPose> | CustomLayerEntry | null;
|
|
5287
4877
|
/** The canvas's render stack, as named slots. The standard slots (grid,
|
|
5288
4878
|
* scene, selection overlay, cell highlight) can be configured, replaced with
|
|
5289
|
-
* a layer of your own, or switched off; further keys add custom layers.
|
|
4879
|
+
* a layer of your own, or switched off; further keys add custom layers.
|
|
4880
|
+
* `TSceneSlot` is what the scene slot accepts: `<SceneCanvas>` takes a
|
|
4881
|
+
* partial config and fills the rest from its defaults. */
|
|
5290
4882
|
type LayersMap<TNode extends {
|
|
5291
4883
|
id: string;
|
|
5292
|
-
}, TPose
|
|
4884
|
+
}, TPose, TSceneSlot = SceneSlotConfig<TNode, TPose>> = {
|
|
5293
4885
|
grid?: GridSlotConfig | null;
|
|
5294
|
-
scene?:
|
|
4886
|
+
scene?: TSceneSlot | null;
|
|
5295
4887
|
/** Selection-overlay slot. Canvas constructs the layer from a
|
|
5296
4888
|
* `SelectionOverlaySlotConfig`; pass a `CustomLayerEntry` (`{ layer }`) to
|
|
5297
4889
|
* supply a pre-built layer (e.g. from `<SceneCanvas>`). */
|
|
@@ -5302,7 +4894,7 @@ type LayersMap<TNode extends {
|
|
|
5302
4894
|
* is set. */
|
|
5303
4895
|
cellHighlight?: CustomLayerEntry | null;
|
|
5304
4896
|
} & {
|
|
5305
|
-
[customKey: string]: LayerSlotValue<TNode, TPose> | undefined;
|
|
4897
|
+
[customKey: string]: LayerSlotValue<TNode, TPose> | TSceneSlot | undefined;
|
|
5306
4898
|
};
|
|
5307
4899
|
/**
|
|
5308
4900
|
* What `<SceneCanvas selectionMode>` lets the canvas do to the selection.
|
|
@@ -5366,6 +4958,11 @@ interface CanvasProps<TNode extends {
|
|
|
5366
4958
|
* `subscribeFrame` callback, still waits for a frame — painting it in place
|
|
5367
4959
|
* would recurse. */
|
|
5368
4960
|
syncPaint?: boolean;
|
|
4961
|
+
/** External state the paint reads that no layer declares — typically what
|
|
4962
|
+
* an `alphaFor` consults. Each source is subscribed while mounted and
|
|
4963
|
+
* repaints the canvas when it notifies. A layer that reads outside state
|
|
4964
|
+
* declares it on `RenderLayer.subscribe` instead. */
|
|
4965
|
+
redrawOn?: readonly RedrawSource[];
|
|
5369
4966
|
/**
|
|
5370
4967
|
* Combined adapter for scene-slot rendering, bounds computation, and
|
|
5371
4968
|
* move/resize/rotate gesture math. Optional — bare-Canvas consumers that
|
|
@@ -5433,9 +5030,7 @@ interface CanvasProps<TNode extends {
|
|
|
5433
5030
|
* Requires `inputElement`: with no element of its own there is nowhere for
|
|
5434
5031
|
* pointer input, focus or the cursor to live, and nothing renders.
|
|
5435
5032
|
*
|
|
5436
|
-
* N canvases can then share one GL context and one buffer.
|
|
5437
|
-
* own `<WeaselProvider isolate>` — under a shared `<ActionsProvider>` only
|
|
5438
|
-
* the newest responds to input and the rest go silently dead.
|
|
5033
|
+
* N canvases can then share one GL context and one buffer.
|
|
5439
5034
|
*/
|
|
5440
5035
|
paintInto?: {
|
|
5441
5036
|
canvas: HTMLCanvasElement | null;
|
|
@@ -5449,14 +5044,14 @@ interface CanvasProps<TNode extends {
|
|
|
5449
5044
|
*/
|
|
5450
5045
|
inputElement?: HTMLElement | null;
|
|
5451
5046
|
className?: string;
|
|
5452
|
-
style?:
|
|
5047
|
+
style?: react__default.CSSProperties;
|
|
5453
5048
|
tabIndex?: number;
|
|
5454
5049
|
/** Fired when the canvas element gains focus. The canvas is focusable by
|
|
5455
5050
|
* default (`tabIndex` 0), so consumers driving focus-dependent chrome —
|
|
5456
5051
|
* a focus ring, a "keyboard shortcuts active" hint — need to observe it. */
|
|
5457
|
-
onFocus?:
|
|
5052
|
+
onFocus?: react__default.FocusEventHandler<HTMLCanvasElement>;
|
|
5458
5053
|
/** Fired when the canvas element loses focus. */
|
|
5459
|
-
onBlur?:
|
|
5054
|
+
onBlur?: react__default.FocusEventHandler<HTMLCanvasElement>;
|
|
5460
5055
|
/**
|
|
5461
5056
|
* When `true` (default), the canvas element receives focus on `pointerdown`
|
|
5462
5057
|
* so keyboard events (tool hotkeys, undo/redo) are captured without a
|
|
@@ -5506,7 +5101,7 @@ interface CanvasProps<TNode extends {
|
|
|
5506
5101
|
* Useful for custom layers that render scene content outside of the standard
|
|
5507
5102
|
* slot system and need to stay in sync with gesture previews.
|
|
5508
5103
|
*/
|
|
5509
|
-
helpersRef?:
|
|
5104
|
+
helpersRef?: react__default.MutableRefObject<CanvasHelpers<TPose> | null>;
|
|
5510
5105
|
/**
|
|
5511
5106
|
* Debug overlay configuration.
|
|
5512
5107
|
* - `undefined` (default): read `?debug=…` from the URL.
|
|
@@ -5520,7 +5115,7 @@ interface CanvasProps<TNode extends {
|
|
|
5520
5115
|
debug?: DebugConfig | false;
|
|
5521
5116
|
/** Test-only escape hatch: writes the live debug sink to this ref so tests
|
|
5522
5117
|
* can call `snapshot()` after a render. No effect when debug is off. */
|
|
5523
|
-
debugSinkRef?:
|
|
5118
|
+
debugSinkRef?: react__default.MutableRefObject<(DebugSink & {
|
|
5524
5119
|
snapshot(): DebugSnapshot;
|
|
5525
5120
|
}) | null>;
|
|
5526
5121
|
/**
|
|
@@ -5757,43 +5352,63 @@ declare function sceneToAdapter<TData, TLayer extends string, TPose>(scene: Scen
|
|
|
5757
5352
|
*/
|
|
5758
5353
|
declare function useSceneAdapter<TData, TLayer extends string, TPose>(scene: Scene<TData, TLayer, TPose>, options?: SceneToAdapterOptions<TData, TLayer, TPose>): SceneCanvasAdapter<TData, TLayer, TPose>;
|
|
5759
5354
|
|
|
5760
|
-
/**
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
* even after the legacy `useRotate` hook is gone.
|
|
5764
|
-
* Consumers should import from here directly; `rotate.ts` re-exports the
|
|
5765
|
-
* same symbols for back-compat. */
|
|
5766
|
-
|
|
5767
|
-
/** Options for the `rotate` action. */
|
|
5768
|
-
interface UseRotateOptions<TPose> {
|
|
5769
|
-
/** Behaviors are typed against the pose shape; the kit ships none yet
|
|
5770
|
-
* (rotation snap behaviors are deferred). For non-rect TPose, behaviors
|
|
5771
|
-
* are typed `never` for a pose without a numeric `rotation`. */
|
|
5772
|
-
behaviors?: TPose extends RotatedPose ? RotateBehavior<TPose>[] : never;
|
|
5773
|
-
rotateLabel?: string;
|
|
5774
|
-
/** Reserved; rotate is never transient in practice. Ignored. */
|
|
5775
|
-
transient?: boolean;
|
|
5776
|
-
onGestureStart?: (id: string) => void;
|
|
5777
|
-
onGestureEnd?: (committed: boolean) => void;
|
|
5778
|
-
/** Optional debug sink. When supplied, records the rotation-handle
|
|
5779
|
-
* position + circular hitbox at gesture start. Tree-shakes via
|
|
5780
|
-
* optional-chain when omitted. */
|
|
5781
|
-
debug?: DebugSink;
|
|
5782
|
-
/** World-pixel distance from the AABB top edge to the rotation handle.
|
|
5783
|
-
* Used for debug-recording the handle position. Default
|
|
5784
|
-
* `DEFAULT_ROTATION_HANDLE_DISTANCE`. */
|
|
5785
|
-
rotationHandleDistance?: number;
|
|
5786
|
-
/** Hit-test radius for the rotation handle, in screen pixels. Used for
|
|
5787
|
-
* the recorded debug hitbox circle. Default `8`. */
|
|
5788
|
-
handleHitRadius?: number;
|
|
5789
|
-
/** Multi-selection pivot mode. Default `'union'`.
|
|
5790
|
-
* - `'each'`: each item rotates around its own center.
|
|
5791
|
-
* - `'union'`: each item rotates around the selection's union center;
|
|
5792
|
-
* item centers orbit the union center while also gaining the same
|
|
5793
|
-
* rotation delta.
|
|
5794
|
-
* Has no effect on single-id gestures. */
|
|
5795
|
-
pivot?: 'each' | 'union';
|
|
5355
|
+
/** Reads the surface's deps from inside `SurfaceContribution.attach`. */
|
|
5356
|
+
interface ContributionDepReader {
|
|
5357
|
+
get<K extends DepName>(name: K): DepSchema[K] | undefined;
|
|
5796
5358
|
}
|
|
5359
|
+
/**
|
|
5360
|
+
* A feature a surface installs in one step. Every role is optional: `bindings`,
|
|
5361
|
+
* `actions`, `deps`, `overlay` and `presentation` from `Contribution`, plus
|
|
5362
|
+
* the two below. Installing it installs every role it declares, and removing
|
|
5363
|
+
* it removes them.
|
|
5364
|
+
*/
|
|
5365
|
+
interface SurfaceContribution extends Contribution {
|
|
5366
|
+
/** Views this entry adds to the surface, as `<SceneCanvas views>` takes. */
|
|
5367
|
+
views?: readonly CanvasViewProps[];
|
|
5368
|
+
/**
|
|
5369
|
+
* Runs once the surface mounts; returns its teardown. For what the roles
|
|
5370
|
+
* above cannot say — a registered (hit-testable) layer, a subscription.
|
|
5371
|
+
*
|
|
5372
|
+
* Keyed by the function's identity, so a contribution built once (in a
|
|
5373
|
+
* `useMemo`, or at module scope) attaches once however often the host
|
|
5374
|
+
* re-renders.
|
|
5375
|
+
*/
|
|
5376
|
+
attach?: (api: CanvasExtensionApi, deps: ContributionDepReader) => () => void;
|
|
5377
|
+
}
|
|
5378
|
+
/**
|
|
5379
|
+
* Concatenate contribution bundles into one registry, preserving order. Throws
|
|
5380
|
+
* on a duplicate entry id, dep name or view id — two features answering for
|
|
5381
|
+
* the same name is a bug in whichever was added second.
|
|
5382
|
+
*/
|
|
5383
|
+
declare function mergeContributions<T extends SurfaceContribution>(...bundles: readonly (readonly T[])[]): T[];
|
|
5384
|
+
|
|
5385
|
+
/**
|
|
5386
|
+
* The behavior presets `<SceneCanvas features>` composes. A bare canvas renders
|
|
5387
|
+
* its scene and keeps a selection nothing sets; every behavior beyond that is
|
|
5388
|
+
* turned on by naming a preset here.
|
|
5389
|
+
*/
|
|
5390
|
+
/** A behavior preset for `<SceneCanvas features>`. `draw` names every other
|
|
5391
|
+
* one. */
|
|
5392
|
+
type Feature = 'view' | 'pick' | 'move' | 'transform' | 'edit' | 'arrange' | 'paths' | 'ingest' | 'draw';
|
|
5393
|
+
/** Every preset except `draw`, which only abbreviates them. */
|
|
5394
|
+
type BaseFeature = Exclude<Feature, 'draw'>;
|
|
5395
|
+
/** Every preset `<SceneCanvas features>` accepts, `draw` last. */
|
|
5396
|
+
declare const SCENE_CANVAS_FEATURES: readonly Feature[];
|
|
5397
|
+
/**
|
|
5398
|
+
* The kit-standard actions each preset registers.
|
|
5399
|
+
*
|
|
5400
|
+
* Every id `useStandardActions` knows appears under exactly one preset, except
|
|
5401
|
+
* the ones in {@link TOOL_DRIVEN_ACTION_IDS}. `move` and `transform` also bring
|
|
5402
|
+
* the ambient bindings that route drags to their actions, and `pick` brings the
|
|
5403
|
+
* select tool; this table is only the registration half.
|
|
5404
|
+
*/
|
|
5405
|
+
declare const FEATURE_ACTION_IDS: Readonly<Record<BaseFeature, readonly string[]>>;
|
|
5406
|
+
/**
|
|
5407
|
+
* Kit-standard actions no preset registers: they belong to the tools that bind
|
|
5408
|
+
* them. A canvas registers each one whenever a tool it carries names it in a
|
|
5409
|
+
* binding — `insert` with any shape tool, `enterTextEdit` with the text tool.
|
|
5410
|
+
*/
|
|
5411
|
+
declare const TOOL_DRIVEN_ACTION_IDS: readonly string[];
|
|
5797
5412
|
|
|
5798
5413
|
/**
|
|
5799
5414
|
* The kit's built-in shape kinds — one table, every other spelling derived.
|
|
@@ -5802,7 +5417,7 @@ interface UseRotateOptions<TPose> {
|
|
|
5802
5417
|
* questions of the same set: the interactions layer decides whether
|
|
5803
5418
|
* `insertAction` can paint a live preview for a kind, and the canvas layer
|
|
5804
5419
|
* decides which shape tools `useBuiltinShapeTools` mounts and what
|
|
5805
|
-
* `
|
|
5420
|
+
* `BUILTIN_TOOL_IDS` / `defaultNodeRouting` / `defaultNodeProperties` enumerate.
|
|
5806
5421
|
*
|
|
5807
5422
|
* This module imports nothing on purpose: `useBuiltinShapeTools` imports the
|
|
5808
5423
|
* package barrel, so anything barrel-reachable that needs these lists at
|
|
@@ -5823,7 +5438,7 @@ interface ShapeKindDescriptor {
|
|
|
5823
5438
|
/**
|
|
5824
5439
|
* Declaration order is the enumeration order of every derived list —
|
|
5825
5440
|
* `KIT_SHAPE_KINDS`, and through it `defaultNodeRouting` /
|
|
5826
|
-
* `defaultNodeProperties` / `
|
|
5441
|
+
* `defaultNodeProperties` / `BUILTIN_TOOL_IDS`.
|
|
5827
5442
|
*/
|
|
5828
5443
|
declare const SHAPE_KINDS: {
|
|
5829
5444
|
readonly rect: {
|
|
@@ -6064,30 +5679,28 @@ declare function defaultDrawOne<TData, TLayer extends string, TPose>(node: Node$
|
|
|
6064
5679
|
* number they always got. Kit-internal use sites multiply by
|
|
6065
5680
|
* `DeviceProfile.targetScale`. */
|
|
6066
5681
|
declare const DEFAULT_HANDLE_SIZE: 8;
|
|
5682
|
+
/** `<SceneCanvas layers>`: a {@link LayersMap} whose scene slot may be partial,
|
|
5683
|
+
* since the defaults fill in whatever it leaves out. */
|
|
5684
|
+
type SceneCanvasLayers<TNode extends {
|
|
5685
|
+
id: string;
|
|
5686
|
+
}, TPose> = LayersMap<TNode, TPose, Partial<SceneSlotConfig<TNode, TPose>>>;
|
|
6067
5687
|
/** Built-in tool ids that aren't shape tools — the ones with no entry in
|
|
6068
5688
|
* the `core/shapeKinds` table. */
|
|
6069
5689
|
declare const NON_SHAPE_BUILTIN_TOOLS: readonly ["select", "hand"];
|
|
6070
5690
|
/** Built-in tool ids SceneCanvas knows how to mount when no `tools` prop
|
|
6071
|
-
* is supplied
|
|
5691
|
+
* is supplied, via `defaultTools`. */
|
|
6072
5692
|
type BuiltinToolId = (typeof NON_SHAPE_BUILTIN_TOOLS)[number] | BuiltinShapeToolId;
|
|
6073
|
-
/**
|
|
6074
|
-
|
|
6075
|
-
type ToolBundle = 'minimal' | 'standard' | 'exhaustive';
|
|
6076
|
-
/** Tool-id contents of each named `ToolBundle`. Public so consumers (e.g.
|
|
6077
|
-
* the Bundle Inspector) can introspect the same map SceneCanvas uses to
|
|
6078
|
-
* expand `toolBundle` without mirroring it. The `src/index.barrel.test.ts`
|
|
6079
|
-
* parity gate enforces that every `ToolBundle` id appears here with a
|
|
6080
|
-
* non-empty tool list. */
|
|
6081
|
-
declare const BUNDLE_TOOLS: Record<ToolBundle, readonly BuiltinToolId[]>;
|
|
5693
|
+
/** Every built-in tool id, shape tools included. */
|
|
5694
|
+
declare const BUILTIN_TOOL_IDS: readonly BuiltinToolId[];
|
|
6082
5695
|
/** Minimal hit descriptor passed to `onDoubleClick`. Contains the fields
|
|
6083
5696
|
* modality dispatch needs; extends as the kit's `Hit` type evolves. */
|
|
6084
5697
|
interface SceneCanvasHit {
|
|
6085
5698
|
id: string;
|
|
6086
5699
|
kind: string;
|
|
6087
5700
|
}
|
|
6088
|
-
/** Props for `<SceneCanvas>`.
|
|
6089
|
-
*
|
|
6090
|
-
*
|
|
5701
|
+
/** Props for `<SceneCanvas>`. A scene is the only thing it needs. With nothing
|
|
5702
|
+
* else it renders that scene and keeps a selection no input sets; `features`
|
|
5703
|
+
* turns behavior on by preset, and the rest configures what those turn on. */
|
|
6091
5704
|
type SceneCanvasProps<TData, TLayer extends string, TPose> = Omit<CanvasProps<Node$1<TData, TLayer, TPose>, TPose>, 'adapter' | 'moveOptions' | 'resizeOptions' | 'rotateOptions' | 'snap' | 'pickEvery' | 'boundsOf' | 'handleHitRadius' | 'selection' | 'selectionOptions' | 'tools' | 'layers' | 'onBackgroundClick' | 'getIsVisible' | 'contentVersion' | 'layerVisibility' | 'layerOrder'> & {
|
|
6092
5705
|
/** A `Scene` (typically from `useScene`) — or a `SerializedScene`
|
|
6093
5706
|
* JSON object, which SceneCanvas bakes into a Scene internally on
|
|
@@ -6108,10 +5721,11 @@ type SceneCanvasProps<TData, TLayer extends string, TPose> = Omit<CanvasProps<No
|
|
|
6108
5721
|
nodes: ReadonlyArray<unknown>;
|
|
6109
5722
|
};
|
|
6110
5723
|
/** Layer configuration. When omitted, SceneCanvas applies kit defaults
|
|
6111
|
-
* (a scene slot that paints `node.data.
|
|
6112
|
-
* selection overlay).
|
|
6113
|
-
* defaults; pass `slot: null` to suppress a
|
|
6114
|
-
|
|
5724
|
+
* (a scene slot that paints `node.data.fill` rects + a default
|
|
5725
|
+
* selection overlay). A partial scene or selection-overlay config is
|
|
5726
|
+
* spread over that slot's defaults; pass `slot: null` to suppress a
|
|
5727
|
+
* default explicitly. */
|
|
5728
|
+
layers?: SceneCanvasLayers<Node$1<TData, TLayer, TPose>, TPose>;
|
|
6115
5729
|
/** Layout strategies keyed by container node id (or a resolver). Forwarded
|
|
6116
5730
|
* to `sceneToAdapter` so `useMove`'s layout pass runs on configured
|
|
6117
5731
|
* containers (reflow on enter, reparent + reflow on commit). */
|
|
@@ -6271,25 +5885,53 @@ type SceneCanvasProps<TData, TLayer extends string, TPose> = Omit<CanvasProps<No
|
|
|
6271
5885
|
* Default `'single'`.
|
|
6272
5886
|
*/
|
|
6273
5887
|
selectionMode?: CanvasSelectionMode;
|
|
5888
|
+
/**
|
|
5889
|
+
* Behavior presets to turn on, composable in any combination. A canvas
|
|
5890
|
+
* with none renders its scene and keeps a selection (the `selection` API
|
|
5891
|
+
* works) that no input sets: no tools, no standard actions or their keys,
|
|
5892
|
+
* no clipboard, no drop or paste, and no selection chrome. The dispatcher
|
|
5893
|
+
* is still mounted, so bindings a consumer adds work.
|
|
5894
|
+
*
|
|
5895
|
+
* - `view` — wheel pan and zoom, pinch, the zoom keys, and the hand tool
|
|
5896
|
+
* (H, or hold Space). Passing `viewport` implies it.
|
|
5897
|
+
* - `pick` — the select tool, as the initial active tool and Escape's
|
|
5898
|
+
* return target: click to pick, drag on empty to marquee, click on empty
|
|
5899
|
+
* to clear; and the selection outline.
|
|
5900
|
+
* - `move` — drag a body to move it, Alt-drag to clone it. Ambient, so it
|
|
5901
|
+
* runs under any tool that does not claim the drag.
|
|
5902
|
+
* - `transform` — resize and rotation handles, drawn and bound.
|
|
5903
|
+
* - `edit` — undo/redo, delete, duplicate, group/ungroup, nudge,
|
|
5904
|
+
* select-all, Escape, cancel-gesture, cut/copy/paste, fill and stroke,
|
|
5905
|
+
* and their keys.
|
|
5906
|
+
* - `arrange` — align, distribute, reorder, flip.
|
|
5907
|
+
* - `paths` — pathfinder operations, path-edit entry and anchor editing.
|
|
5908
|
+
* - `ingest` — dropped and pasted content (Cmd/Ctrl+V arrives as a paste).
|
|
5909
|
+
* - `draw` — all of the above.
|
|
5910
|
+
*
|
|
5911
|
+
* Tools add the actions they bind — a shape tool brings `insert` — so
|
|
5912
|
+
* `defaultTools` composes with any preset. `actions` then adds, overrides
|
|
5913
|
+
* or removes on top of what the presets registered.
|
|
5914
|
+
*/
|
|
5915
|
+
features?: readonly Feature[];
|
|
6274
5916
|
/** Extra tools or overrides keyed by id, or a full `ToolsApi` takeover.
|
|
6275
5917
|
*
|
|
6276
5918
|
* **Patch form** (`Record<string, AnyTool | true | false>`): merged
|
|
6277
|
-
* into the built-in registry on top of whatever `defaultTools`
|
|
6278
|
-
* `
|
|
5919
|
+
* into the built-in registry on top of whatever `defaultTools` and
|
|
5920
|
+
* `features` already selected.
|
|
6279
5921
|
* - `true` pulls in the built-in for this id (`'pen'`, `'lasso'`,
|
|
6280
|
-
* `'hand'`, …)
|
|
6281
|
-
* for `toolBundle: 'minimal'` + `tools={{ pen: true }}`. Unknown
|
|
5922
|
+
* `'hand'`, …), the same as listing it in `defaultTools`. Unknown
|
|
6282
5923
|
* built-in ids warn in dev and are ignored.
|
|
6283
5924
|
* - `AnyTool` adds a new id or replaces an existing one
|
|
6284
5925
|
* (dev-only warning on replace).
|
|
6285
5926
|
* - `false` omits a bundled tool entirely.
|
|
6286
5927
|
* Auto-wiring (keybindings, dispatcher, action registry) still runs.
|
|
6287
5928
|
*
|
|
6288
|
-
* **Takeover form** (`ToolsApi`): the internal
|
|
6289
|
-
*
|
|
6290
|
-
*
|
|
6291
|
-
*
|
|
6292
|
-
* to opt
|
|
5929
|
+
* **Takeover form** (`ToolsApi`): the internal registry is bypassed and
|
|
5930
|
+
* this `tools` value is forwarded to Canvas as-is — the consumer owns
|
|
5931
|
+
* active-slot management, and `pick`'s select tool is theirs to supply.
|
|
5932
|
+
* Every other preset still applies. Keybindings are still auto-wired
|
|
5933
|
+
* against the supplied registry; pass `enableKeybindings={false}` to opt
|
|
5934
|
+
* out. */
|
|
6293
5935
|
tools?: ToolsApi | Record<string, AnyTool | true | false>;
|
|
6294
5936
|
/**
|
|
6295
5937
|
* Auto-wire keyboard shortcuts. Default `true`. When `false`, SceneCanvas
|
|
@@ -6322,51 +5964,43 @@ type SceneCanvasProps<TData, TLayer extends string, TPose> = Omit<CanvasProps<No
|
|
|
6322
5964
|
*/
|
|
6323
5965
|
onToolsCreated?: (tools: ToolsApi) => void;
|
|
6324
5966
|
/**
|
|
6325
|
-
*
|
|
6326
|
-
*
|
|
6327
|
-
*
|
|
6328
|
-
* `
|
|
6329
|
-
*
|
|
6330
|
-
*/
|
|
6331
|
-
toolBundle?: ToolBundle;
|
|
6332
|
-
/**
|
|
6333
|
-
* Which built-in tools SceneCanvas registers in its internal `useTools`.
|
|
6334
|
-
* Default: `['select']` (plus `'hand'` when the
|
|
6335
|
-
* `viewport` feature is on). Pass a smaller array to slim — e.g.
|
|
6336
|
-
* `['select']` for move-only. Wins over `toolBundle` when both are
|
|
6337
|
-
* passed. Ignored when the consumer supplies their own `tools` prop.
|
|
5967
|
+
* Built-in tools SceneCanvas registers in its internal `useTools`, on top
|
|
5968
|
+
* of the ones presets bring (`select` from `pick`, `hand` from `view`).
|
|
5969
|
+
* Default: none. Each tool also registers the kit actions it binds, so
|
|
5970
|
+
* `['rect']` brings `insert`. Ignored when the consumer supplies their own
|
|
5971
|
+
* `tools` prop.
|
|
6338
5972
|
*/
|
|
6339
5973
|
defaultTools?: readonly BuiltinToolId[];
|
|
6340
5974
|
/** Per-tool option overrides for the built-in shape/lasso/clone tools.
|
|
6341
5975
|
* Each entry is a narrow subset of the underlying hook's options
|
|
6342
5976
|
* surface — `lasso.mode`, `clone.cloneSelection`, etc. */
|
|
6343
5977
|
toolOptions?: BuiltinToolOptions;
|
|
6344
|
-
/** Initial active-slot tool id. Default: `'select'
|
|
6345
|
-
* registered
|
|
6346
|
-
*
|
|
6347
|
-
*
|
|
6348
|
-
*
|
|
5978
|
+
/** Initial active-slot tool id. Default: `'select'` when it is
|
|
5979
|
+
* registered, otherwise none — a canvas can run on ambient bindings
|
|
5980
|
+
* alone. Must be one of the registered tools. The lasso demo starts with
|
|
5981
|
+
* `initialActiveTool="lasso"`. Ignored when the consumer supplies their
|
|
5982
|
+
* own `tools` prop. */
|
|
6349
5983
|
initialActiveTool?: string;
|
|
6350
|
-
/** Always-on
|
|
6351
|
-
*
|
|
6352
|
-
*
|
|
6353
|
-
*
|
|
6354
|
-
|
|
6355
|
-
|
|
5984
|
+
/** Always-on entries to register alongside the internal tools — every one
|
|
5985
|
+
* a `SurfaceContribution`, whose views, deps, overlay, bindings, actions
|
|
5986
|
+
* and `attach` all install from this one list, and uninstall when the
|
|
5987
|
+
* entry leaves it. A tool is a contribution too, so one can go here. If
|
|
5988
|
+
* you supply your own `tools` prop, this is ignored — wire `ambient`
|
|
5989
|
+
* through your own `useTools` call instead. */
|
|
5990
|
+
ambient?: readonly SurfaceContribution[];
|
|
5991
|
+
/** Configures the `view` preset, and implies it: passing this turns
|
|
5992
|
+
* `view` on.
|
|
6356
5993
|
*
|
|
6357
5994
|
* - `inertia` and `animatedZoom` are opt-in: pass `true` for defaults or
|
|
6358
5995
|
* an object to tune. Omitted means off.
|
|
6359
5996
|
* - `pan` (wheel pan), `zoom` (Cmd+wheel + Cmd+=/-/0) and `pinchZoom`
|
|
6360
|
-
* (two-finger pinch) are
|
|
6361
|
-
*
|
|
6362
|
-
*
|
|
6363
|
-
*
|
|
6364
|
-
*
|
|
5997
|
+
* (two-finger pinch) are on under `view`; pass `false` to disable one.
|
|
5998
|
+
* All three are wired by registering the kit's `viewport.*` action
|
|
5999
|
+
* descriptors with the actions registry — disabling via the `actions`
|
|
6000
|
+
* prop (`actions: { 'viewport.wheelPan': null }`) also works and runs
|
|
6001
|
+
* after this.
|
|
6365
6002
|
*
|
|
6366
|
-
*
|
|
6367
|
-
* pan, Cmd+wheel/key zoom and pinch zoom remain wired (canvas-first
|
|
6368
|
-
* default). Pass `{ pan: false, zoom: false, pinchZoom: false }` to opt
|
|
6369
|
-
* out entirely. */
|
|
6003
|
+
* Without `view`, none of them are wired. */
|
|
6370
6004
|
viewport?: {
|
|
6371
6005
|
inertia?: boolean | {
|
|
6372
6006
|
friction?: number;
|
|
@@ -6468,10 +6102,16 @@ type SceneCanvasProps<TData, TLayer extends string, TPose> = Omit<CanvasProps<No
|
|
|
6468
6102
|
*/
|
|
6469
6103
|
views?: readonly CanvasViewProps[];
|
|
6470
6104
|
/**
|
|
6471
|
-
* Children rendered alongside the canvas
|
|
6472
|
-
*
|
|
6105
|
+
* Children rendered alongside the canvas, inside its input scope (e.g.
|
|
6106
|
+
* shortcuts overlays, probes).
|
|
6473
6107
|
*/
|
|
6474
6108
|
children?: ReactNode;
|
|
6109
|
+
/**
|
|
6110
|
+
* A yoke to join, from `useYoke()`: canvases on one yoke share the
|
|
6111
|
+
* active tool, the gesture in flight and history. Omitted, this canvas
|
|
6112
|
+
* keeps its own.
|
|
6113
|
+
*/
|
|
6114
|
+
yoke?: Yoke;
|
|
6475
6115
|
/**
|
|
6476
6116
|
* Chrome-caps visibility overrides, keyed by chrome id (`selection.outline`,
|
|
6477
6117
|
* `selection.rotation-handle`, `gesture.marquee`, …). Each entry is a
|
|
@@ -6486,20 +6126,14 @@ type SceneCanvasProps<TData, TLayer extends string, TPose> = Omit<CanvasProps<No
|
|
|
6486
6126
|
*/
|
|
6487
6127
|
chromeVisibility?: VisibilityRules;
|
|
6488
6128
|
/**
|
|
6489
|
-
*
|
|
6490
|
-
*
|
|
6491
|
-
*
|
|
6492
|
-
*
|
|
6493
|
-
*
|
|
6494
|
-
*
|
|
6495
|
-
* Threading this through enables mode-aware chrome (selection outline,
|
|
6496
|
-
* resize handles, rotation handle are off in path-edit mode) and the
|
|
6497
|
-
* dispatcher's eligibility filter in later phases.
|
|
6129
|
+
* The app's mode registry (`createModeRegistry` in `@weasel-js/modes`).
|
|
6130
|
+
* The canvas reads the active mode from it to gate chrome, tool
|
|
6131
|
+
* activation and the dispatcher's eligibility filter, repaints when it
|
|
6132
|
+
* switches, and hands every registered mode to the dev-time route-conflict
|
|
6133
|
+
* check. Omitted, the canvas behaves as the kit's normal mode and nothing
|
|
6134
|
+
* revokes anchor editing.
|
|
6498
6135
|
*/
|
|
6499
|
-
|
|
6500
|
-
id: string;
|
|
6501
|
-
allowedCapabilities: ReadonlySet<string>;
|
|
6502
|
-
};
|
|
6136
|
+
modes?: ModeRegistry;
|
|
6503
6137
|
/**
|
|
6504
6138
|
* Override detected device facts. Merged over what `matchMedia` reports;
|
|
6505
6139
|
* `targetScale` is re-derived from the merged `coarsePointer` unless you
|
|
@@ -6617,22 +6251,23 @@ type SceneCanvasProps<TData, TLayer extends string, TPose> = Omit<CanvasProps<No
|
|
|
6617
6251
|
*/
|
|
6618
6252
|
onDoubleClick?: (hit: SceneCanvasHit | null) => void;
|
|
6619
6253
|
};
|
|
6620
|
-
declare function SceneCanvasInner<TData, TLayer extends string, TPose>(props: SceneCanvasProps<TData, TLayer, TPose>, ref:
|
|
6254
|
+
declare function SceneCanvasInner<TData, TLayer extends string, TPose>(props: SceneCanvasProps<TData, TLayer, TPose>, ref: react__default.ForwardedRef<SceneCanvasApi>): react__default.JSX.Element;
|
|
6621
6255
|
/**
|
|
6622
6256
|
* The canvas component: renders a `Scene` and wires the interaction stack
|
|
6623
6257
|
* around it.
|
|
6624
6258
|
*
|
|
6625
|
-
*
|
|
6626
|
-
*
|
|
6627
|
-
*
|
|
6628
|
-
*
|
|
6629
|
-
*
|
|
6259
|
+
* Mounted bare it renders the scene, keeps a selection no input sets, and
|
|
6260
|
+
* runs a gesture dispatcher for whatever bindings the consumer adds. The
|
|
6261
|
+
* `features` presets turn the kit's behavior on — `features={['draw']}` is the
|
|
6262
|
+
* whole editor: tools, standard actions and their keys, selection chrome,
|
|
6263
|
+
* undo. This is the intended entry point; the lower-level primitives it
|
|
6264
|
+
* composes are not part of the public surface.
|
|
6630
6265
|
*
|
|
6631
6266
|
* Its ref exposes a `SceneCanvasApi` for the imperative operations that do not
|
|
6632
6267
|
* fit a prop (view control, hit queries, redraw requests).
|
|
6633
6268
|
*/
|
|
6634
6269
|
declare const SceneCanvas: <TData, TLayer extends string, TPose>(props: SceneCanvasProps<TData, TLayer, TPose> & {
|
|
6635
|
-
ref?:
|
|
6270
|
+
ref?: react__default.Ref<SceneCanvasApi>;
|
|
6636
6271
|
}) => ReturnType<typeof SceneCanvasInner>;
|
|
6637
6272
|
|
|
6638
6273
|
/** Which of the host's edges the panel is held against, per axis. */
|
|
@@ -6730,7 +6365,7 @@ interface CursorCoordsHudProps {
|
|
|
6730
6365
|
}
|
|
6731
6366
|
/** Debug overlay showing the pointer's client and world coordinates and the
|
|
6732
6367
|
* current frame rate, pinned to the canvas's top-right corner. */
|
|
6733
|
-
declare function CursorCoordsHud({ canvasRef, anchorRef, viewRef, offset }: CursorCoordsHudProps):
|
|
6368
|
+
declare function CursorCoordsHud({ canvasRef, anchorRef, viewRef, offset }: CursorCoordsHudProps): react.JSX.Element | null;
|
|
6734
6369
|
|
|
6735
6370
|
/** Props for `<PickHud>`. */
|
|
6736
6371
|
interface PickHudProps {
|
|
@@ -6754,7 +6389,7 @@ interface PickHudProps {
|
|
|
6754
6389
|
}
|
|
6755
6390
|
/** Debug overlay listing every node under the pointer, with the one a click
|
|
6756
6391
|
* would actually select shown in bold. */
|
|
6757
|
-
declare function PickHud({ canvasRef, anchorRef, viewRef, pickEvery, pickBest, offset }: PickHudProps):
|
|
6392
|
+
declare function PickHud({ canvasRef, anchorRef, viewRef, pickEvery, pickBest, offset }: PickHudProps): react.JSX.Element | null;
|
|
6758
6393
|
|
|
6759
6394
|
/**
|
|
6760
6395
|
* imageCache — the kit's per-`src` image loader + cache.
|
|
@@ -7122,9 +6757,7 @@ declare function resolveOverlays(overlays: Iterable<OngoingOverlay>): ResolvedOv
|
|
|
7122
6757
|
* (`<SceneViewCanvas>` / `<MinimapCanvas>`). Given a `<canvas>`, a `Scene`,
|
|
7123
6758
|
* a `View`, and a per-node `drawOne`, render one frame.
|
|
7124
6759
|
*
|
|
7125
|
-
*
|
|
7126
|
-
* (`docs/superpowers/specs/2026-05-31-detached-minimap-design.md`). The full
|
|
7127
|
-
* `<SceneCanvas>` render pipeline does much more than this (slots, layer
|
|
6760
|
+
* The full `<SceneCanvas>` render pipeline does much more than this (slots, layer
|
|
7128
6761
|
* ordering, debug sinks, tool overlays). The helper deliberately re-implements
|
|
7129
6762
|
* the small subset needed for a non-interactive scene view rather than
|
|
7130
6763
|
* refactoring `<SceneCanvas>` to share code — the spec calls for that
|
|
@@ -7279,7 +6912,7 @@ interface SceneViewCanvasProps<TData, TLayer extends string, TPose> {
|
|
|
7279
6912
|
* pointer listeners or call `toBlob` for snapshots through this. */
|
|
7280
6913
|
canvasRef?: Ref<HTMLCanvasElement>;
|
|
7281
6914
|
}
|
|
7282
|
-
declare function SceneViewCanvasInner<TData, TLayer extends string, TPose>(props: SceneViewCanvasProps<TData, TLayer, TPose>):
|
|
6915
|
+
declare function SceneViewCanvasInner<TData, TLayer extends string, TPose>(props: SceneViewCanvasProps<TData, TLayer, TPose>): react.JSX.Element;
|
|
7283
6916
|
/**
|
|
7284
6917
|
* Pointer-inert read-only scene view. See `SceneViewCanvasProps` for the
|
|
7285
6918
|
* full surface and the module docstring for the rendering model.
|
|
@@ -7600,17 +7233,121 @@ interface MinimapCanvasProps<TData, TLayer extends string, TPose> {
|
|
|
7600
7233
|
className?: string;
|
|
7601
7234
|
/** Forwarded ref to the underlying `<canvas>`. */
|
|
7602
7235
|
canvasRef?: Ref<HTMLCanvasElement>;
|
|
7236
|
+
/** The view id this minimap publishes its pointer under. Default
|
|
7237
|
+
* `'minimap'`. */
|
|
7238
|
+
id?: string;
|
|
7603
7239
|
}
|
|
7604
|
-
declare function MinimapCanvasInner<TData, TLayer extends string, TPose>(props: MinimapCanvasProps<TData, TLayer, TPose>): react_jsx_runtime.JSX.Element;
|
|
7605
7240
|
/**
|
|
7606
7241
|
* Opinionated minimap. See `MinimapCanvasProps` for the full surface and
|
|
7607
|
-
* the module docstring for the rendering /
|
|
7242
|
+
* the module docstring for the rendering / input model.
|
|
7243
|
+
*
|
|
7244
|
+
* Its dispatcher, actions and deps are its own, so it never competes with
|
|
7245
|
+
* the main canvas for input. The pointer store is shared when one is in scope.
|
|
7608
7246
|
*
|
|
7609
7247
|
* `forwardRef` is not used because the component is generic over
|
|
7610
7248
|
* `<TData, TLayer, TPose>` and React's `forwardRef` erases generics. The
|
|
7611
7249
|
* `canvasRef` prop is the plain-prop equivalent.
|
|
7612
7250
|
*/
|
|
7613
|
-
declare
|
|
7251
|
+
declare function MinimapCanvas<TData, TLayer extends string, TPose>(props: MinimapCanvasProps<TData, TLayer, TPose>): react.JSX.Element;
|
|
7252
|
+
|
|
7253
|
+
/**
|
|
7254
|
+
* A minimap over a `<SceneCanvas>`, written as one `SurfaceContribution`: a
|
|
7255
|
+
* view through a fit camera, the pan that moves the main camera from inside
|
|
7256
|
+
* it, the visible-rect indicator, and a linked crosshair.
|
|
7257
|
+
*/
|
|
7258
|
+
|
|
7259
|
+
/** Options for {@link createLinkedCursorContribution}. */
|
|
7260
|
+
interface LinkedCursorOptions {
|
|
7261
|
+
/** Entry id. Default `'linked-cursor'`. */
|
|
7262
|
+
id?: string;
|
|
7263
|
+
/** Views on this surface the crosshair may paint in. Default `[null]`, the
|
|
7264
|
+
* surface's own camera — the main canvas beside a detached minimap. */
|
|
7265
|
+
views?: readonly (string | null)[];
|
|
7266
|
+
}
|
|
7267
|
+
/**
|
|
7268
|
+
* The linked crosshair alone: this surface paints the pointer's position
|
|
7269
|
+
* whenever the pointer is over some other view — another surface under the
|
|
7270
|
+
* same `<PointerContextProvider>`, such as a detached `<MinimapCanvas>`.
|
|
7271
|
+
*
|
|
7272
|
+
* A surface carrying `createMinimapContribution` already has one, in both its
|
|
7273
|
+
* views; this is for a surface without.
|
|
7274
|
+
*/
|
|
7275
|
+
declare function createLinkedCursorContribution(opts?: LinkedCursorOptions): SurfaceContribution;
|
|
7276
|
+
/** Options for {@link createMinimapContribution}. */
|
|
7277
|
+
interface MinimapContributionOptions<TData = unknown, TLayer extends string = string, TPose = unknown> {
|
|
7278
|
+
/** View and entry id. Default `'minimap'`. */
|
|
7279
|
+
id?: string;
|
|
7280
|
+
/** Where the minimap paints, in CSS pixels from the canvas top-left. A
|
|
7281
|
+
* function is re-read every frame, so it can follow the canvas's size. */
|
|
7282
|
+
rect: ViewRect | ((outer: View, dims: Dims) => ViewRect);
|
|
7283
|
+
/** What the minimap frames. Default `'scene'`, the union of leaf poses. */
|
|
7284
|
+
fit?: MinimapFit<TData, TLayer, TPose>;
|
|
7285
|
+
/** The surface layers the minimap paints. Default: all of them. */
|
|
7286
|
+
layers?: (surface: readonly RenderLayer<unknown>[]) => readonly RenderLayer<unknown>[];
|
|
7287
|
+
/** Ground painted before the minimap's layers, so the main canvas does not
|
|
7288
|
+
* show through. */
|
|
7289
|
+
background?: string;
|
|
7290
|
+
/** The visible-rect indicator's stroke. */
|
|
7291
|
+
indicatorStyle?: IndicatorStyle;
|
|
7292
|
+
}
|
|
7293
|
+
/**
|
|
7294
|
+
* A minimap inside a `<SceneCanvas>`, installed with one entry:
|
|
7295
|
+
*
|
|
7296
|
+
* ```tsx
|
|
7297
|
+
* const minimap = useMemo(() => createMinimapContribution({ rect: { x: 8, y: 8, w: 160, h: 110 } }), []);
|
|
7298
|
+
* <SceneCanvas ambient={[minimap]} … />
|
|
7299
|
+
* ```
|
|
7300
|
+
*
|
|
7301
|
+
* Press in it to center the main camera on that point, drag to keep it there.
|
|
7302
|
+
* It shows the main camera's visible rect, and a crosshair where the pointer is
|
|
7303
|
+
* over the other view. Build it once — each instance keeps the live state its
|
|
7304
|
+
* layers read.
|
|
7305
|
+
*/
|
|
7306
|
+
declare function createMinimapContribution<TData = unknown, TLayer extends string = string, TPose = unknown>(opts: MinimapContributionOptions<TData, TLayer, TPose>): SurfaceContribution;
|
|
7307
|
+
|
|
7308
|
+
/**
|
|
7309
|
+
* The minimap's input: press to recenter the main camera on a world point,
|
|
7310
|
+
* drag to keep it there. Both read `rootView` — never `view`, which inside the
|
|
7311
|
+
* minimap's own view answers the minimap's camera.
|
|
7312
|
+
*/
|
|
7313
|
+
|
|
7314
|
+
declare const MINIMAP_CENTER = "minimap.center";
|
|
7315
|
+
declare const MINIMAP_PAN = "minimap.pan";
|
|
7316
|
+
/** Move `root` so world point (`x`, `y`) sits at the center of its host,
|
|
7317
|
+
* keeping its scale. A no-op while the host is unmeasured. */
|
|
7318
|
+
declare function centerRootOn(root: ViewApi, x: number, y: number): void;
|
|
7319
|
+
/** Recenter the main camera on the pressed world point. */
|
|
7320
|
+
declare function minimapCenterAction(): Action;
|
|
7321
|
+
/** Keep the main camera centered on the pointer's world point while dragging.
|
|
7322
|
+
* Pair it with `minimap.center` on `pointerDown`, which handles the press.
|
|
7323
|
+
* A recenter lands the moment it is computed, so there is nothing to commit
|
|
7324
|
+
* and a cancel ends where a release does. */
|
|
7325
|
+
declare function minimapPanAction(): Action;
|
|
7326
|
+
|
|
7327
|
+
/**
|
|
7328
|
+
* The minimap's chrome: the main camera's visible rect, drawn in the minimap,
|
|
7329
|
+
* and the linked crosshair, drawn in every view the pointer is not over.
|
|
7330
|
+
*/
|
|
7331
|
+
|
|
7332
|
+
/** The halo's color: dark enough to separate the accent from any content. */
|
|
7333
|
+
declare const CROSSHAIR_HALO = "rgba(0, 0, 0, 0.6)";
|
|
7334
|
+
/** An axis-aligned rect, `{ x, y, w, h }`. */
|
|
7335
|
+
interface CrosshairRect {
|
|
7336
|
+
x: number;
|
|
7337
|
+
y: number;
|
|
7338
|
+
w: number;
|
|
7339
|
+
h: number;
|
|
7340
|
+
}
|
|
7341
|
+
/**
|
|
7342
|
+
* The linked crosshair at (`x`, `y`) as rects in the caller's units, where one
|
|
7343
|
+
* screen pixel is `unitsPerPx` of them: four halo rects to paint first, then
|
|
7344
|
+
* four bars. A painter with no weasel renderer — a 2D canvas — draws the same
|
|
7345
|
+
* crosshair from these.
|
|
7346
|
+
*/
|
|
7347
|
+
declare function crosshairRects(x: number, y: number, unitsPerPx: number): {
|
|
7348
|
+
halo: CrosshairRect[];
|
|
7349
|
+
bars: CrosshairRect[];
|
|
7350
|
+
};
|
|
7614
7351
|
|
|
7615
7352
|
/** Plain RGBA raster — structurally `ImageData`-compatible ({ width, height,
|
|
7616
7353
|
* data }), deliberately free of printer/dpi/physical-unit concepts. */
|
|
@@ -7772,74 +7509,21 @@ declare function SelectionContextProviderIfRoot({ children, }: {
|
|
|
7772
7509
|
*/
|
|
7773
7510
|
declare function usePublishSelection(ids: readonly NodeId[], kinds?: readonly (string | undefined)[]): void;
|
|
7774
7511
|
|
|
7775
|
-
/**
|
|
7776
|
-
* @experimental
|
|
7777
|
-
* PointerContext — a tiny ambient context that publishes the world-space
|
|
7778
|
-
* position of the canvas pointer, refreshed on every `pointermove` over
|
|
7779
|
-
* the canvas. Cleared (set to `null`) on `pointerleave`.
|
|
7780
|
-
*
|
|
7781
|
-
* Why ref-based and not state-based: cursor moves fire dozens of times per
|
|
7782
|
-
* second; routing those through React state would re-render every consumer
|
|
7783
|
-
* in the tree. The context exposes a stable `pointerRef` whose `.current`
|
|
7784
|
-
* is mutated directly by the publisher, plus a thunk `getDropPoint()` that
|
|
7785
|
-
* reads it on demand. Consumers (e.g. `useClipboard`) pull via the thunk
|
|
7786
|
-
* inside their callbacks — no subscription, no re-render.
|
|
7787
|
-
*
|
|
7788
|
-
* `<SceneCanvas>` publishes automatically. `useClipboardOps` consumes when
|
|
7789
|
-
* the caller didn't pass an explicit `getDropPoint` option. Other future
|
|
7790
|
-
* hit-on-cursor consumers (drop-zone hover, context-menu anchor) can reuse
|
|
7791
|
-
* the same context.
|
|
7792
|
-
*/
|
|
7793
|
-
|
|
7794
|
-
/** @experimental World-space pointer position, or `null` when the pointer
|
|
7795
|
-
* isn't over the publishing canvas. */
|
|
7796
|
-
type PointerWorldPos = {
|
|
7797
|
-
worldX: number;
|
|
7798
|
-
worldY: number;
|
|
7799
|
-
} | null;
|
|
7800
|
-
/** @experimental */
|
|
7801
|
-
interface PointerContextValue {
|
|
7802
|
-
/** Live ref — mutate to publish, read for the latest snapshot. The
|
|
7803
|
-
* identity is stable for the lifetime of the provider. */
|
|
7804
|
-
readonly pointerRef: MutableRefObject<PointerWorldPos>;
|
|
7805
|
-
/** Convenience thunk equivalent to `() => pointerRef.current`. Stable
|
|
7806
|
-
* identity for the lifetime of the provider; safe to pass to hooks. */
|
|
7807
|
-
readonly getDropPoint: () => PointerWorldPos;
|
|
7808
|
-
}
|
|
7809
|
-
/**
|
|
7810
|
-
* @experimental
|
|
7811
|
-
* Wrap the part of the React tree that should share a pointer-position
|
|
7812
|
-
* context. Usually placed at the demo / app root, alongside
|
|
7813
|
-
* `<ActionsProvider>` and `<SelectionContextProvider>`.
|
|
7814
|
-
*
|
|
7815
|
-
* Most consumers don't need to mount this directly — `<SceneCanvas>` mounts
|
|
7816
|
-
* an internal provider when no parent provider is in scope, so child hooks
|
|
7817
|
-
* (`useClipboard` without an explicit `getDropPoint`) read the canvas's
|
|
7818
|
-
* tracked pointer for free.
|
|
7819
|
-
*/
|
|
7820
|
-
declare function PointerContextProvider({ children }: {
|
|
7821
|
-
children: ReactNode;
|
|
7822
|
-
}): ReactNode;
|
|
7823
|
-
/** @experimental Read the surrounding pointer-context value, or `null` when
|
|
7824
|
-
* no provider is in scope. */
|
|
7825
|
-
declare function usePointerContext(): PointerContextValue | null;
|
|
7826
|
-
|
|
7827
7512
|
/** Mount a `<PointerContextProvider>` only when none is already in scope. */
|
|
7828
7513
|
declare function PointerProviderIfRoot({ children }: {
|
|
7829
7514
|
children: ReactNode;
|
|
7830
|
-
}):
|
|
7515
|
+
}): react.JSX.Element;
|
|
7831
7516
|
|
|
7832
|
-
/** Mount an `<ActionsProvider>` only when none is already in scope
|
|
7833
|
-
* nesting canvases share one action registry instead of shadowing it. */
|
|
7517
|
+
/** Mount an `<ActionsProvider>` only when none is already in scope. */
|
|
7834
7518
|
declare function ActionsProviderIfRoot({ children }: {
|
|
7835
7519
|
children: ReactNode;
|
|
7836
|
-
}):
|
|
7520
|
+
}): react.JSX.Element;
|
|
7837
7521
|
|
|
7838
7522
|
/** Mount a `<DepRegistryProvider>` only when none is already in scope, so a
|
|
7839
7523
|
* consumer's dep sources are not shadowed by a nested canvas. */
|
|
7840
7524
|
declare function DepRegistryProviderIfRoot({ children }: {
|
|
7841
7525
|
children: ReactNode;
|
|
7842
|
-
}):
|
|
7526
|
+
}): react.JSX.Element;
|
|
7843
7527
|
|
|
7844
7528
|
interface WeaselProviderProps {
|
|
7845
7529
|
children: ReactNode;
|
|
@@ -7864,7 +7548,7 @@ interface WeaselProviderProps {
|
|
|
7864
7548
|
* state has to be shared by things outside a canvas: a toolbar, a property
|
|
7865
7549
|
* panel, or two canvases that should agree on the selection.
|
|
7866
7550
|
*/
|
|
7867
|
-
declare function WeaselProvider({ children, isolate }: WeaselProviderProps):
|
|
7551
|
+
declare function WeaselProvider({ children, isolate }: WeaselProviderProps): react.JSX.Element;
|
|
7868
7552
|
|
|
7869
7553
|
/** Options for `useCanvasFocus`. */
|
|
7870
7554
|
interface UseCanvasFocusOptions {
|
|
@@ -7923,6 +7607,33 @@ interface GateLayerOptions<TData> {
|
|
|
7923
7607
|
* without the layer knowing anything about focus. */
|
|
7924
7608
|
declare function gateLayer<TData>(opts: GateLayerOptions<TData>): RenderLayer<TData>;
|
|
7925
7609
|
|
|
7610
|
+
/** Options for {@link workspaceTintLayer}. */
|
|
7611
|
+
interface WorkspaceTintLayerOptions {
|
|
7612
|
+
registry: ModeRegistry;
|
|
7613
|
+
/** The page, in world coordinates. When given, the tint covers only the
|
|
7614
|
+
* workspace around it, each strip fading toward the page edge if the mode
|
|
7615
|
+
* names a gradient. Without it the tint covers the whole canvas. */
|
|
7616
|
+
page?: () => Rect | null;
|
|
7617
|
+
/** Opacity for every mode's tint, in place of its `workspace.intensity`. */
|
|
7618
|
+
intensity?: number;
|
|
7619
|
+
id?: string;
|
|
7620
|
+
label?: string;
|
|
7621
|
+
}
|
|
7622
|
+
/**
|
|
7623
|
+
* A screen-space layer painting the active mode's `WorkspaceVisual`: nothing in
|
|
7624
|
+
* a mode without a tint, otherwise a wash at the mode's intensity, bottom-up or
|
|
7625
|
+
* top-down when the mode names a gradient. It subscribes to the registry, so a
|
|
7626
|
+
* mode switch repaints it.
|
|
7627
|
+
*/
|
|
7628
|
+
declare function workspaceTintLayer(opts: WorkspaceTintLayerOptions): RenderLayer<unknown>;
|
|
7629
|
+
/** A world-space layer drawing a `ModeDecorations`' active painter. It
|
|
7630
|
+
* subscribes to the decorations, so a mode switch or a new painter repaints
|
|
7631
|
+
* it. */
|
|
7632
|
+
declare function modeDecorationLayer(decorations: ModeDecorations, opts?: {
|
|
7633
|
+
id?: string;
|
|
7634
|
+
label?: string;
|
|
7635
|
+
}): RenderLayer<unknown>;
|
|
7636
|
+
|
|
7926
7637
|
/**
|
|
7927
7638
|
* Z-ordered child renderer — replaces the manual `for (id of getChildren()) ...`
|
|
7928
7639
|
* pattern with a `RenderLayer` factory that consumes an `OrderedAdapter`.
|
|
@@ -8595,6 +8306,9 @@ interface UseTextEditOptions {
|
|
|
8595
8306
|
* `UseTextEditReturn.selection`.
|
|
8596
8307
|
*/
|
|
8597
8308
|
isEditorChrome?: (el: Element) => boolean;
|
|
8309
|
+
/** What Escape does to the edit: `'cancel'` (the default) drops it,
|
|
8310
|
+
* `'commit'` keeps the text as Enter would. */
|
|
8311
|
+
escape?: 'cancel' | 'commit';
|
|
8598
8312
|
}
|
|
8599
8313
|
/** Options for `useTextEdit().startEdit`. */
|
|
8600
8314
|
interface StartEditOptions {
|
|
@@ -8794,6 +8508,8 @@ interface UseSceneTextEditOptions<TData> {
|
|
|
8794
8508
|
* the character controls.
|
|
8795
8509
|
*/
|
|
8796
8510
|
isEditorChrome?: (el: Element) => boolean;
|
|
8511
|
+
/** Forwarded to `useTextEdit`: what Escape does to the edit. */
|
|
8512
|
+
escape?: 'cancel' | 'commit';
|
|
8797
8513
|
}
|
|
8798
8514
|
/** Return shape extends `UseTextEditReturn` with an `onDoubleClick`
|
|
8799
8515
|
* binding for the canvas container. Double-clicking inside a text
|
|
@@ -9039,6 +8755,19 @@ declare function isMeshGradientFill(fill: FillStyle | null | undefined): fill is
|
|
|
9039
8755
|
* `color` — a mesh seeded from a solid has to show *something* curved, or
|
|
9040
8756
|
* switching kind looks like nothing happened. */
|
|
9041
8757
|
declare function seedMeshPatch(color: string): MeshGradientFill;
|
|
8758
|
+
/**
|
|
8759
|
+
* A stop list as a mesh: one full-height band per gap between neighboring
|
|
8760
|
+
* stops, colored left to right. The bands blend exactly the way the ramp
|
|
8761
|
+
* does, so a horizontal gradient survives the switch unchanged. A zero-width
|
|
8762
|
+
* gap is a hard break and gets no band.
|
|
8763
|
+
*/
|
|
8764
|
+
declare function meshFromStops(stops: readonly GradStop[]): MeshGradientFill;
|
|
8765
|
+
/**
|
|
8766
|
+
* A mesh read as a stop list: every patch's top edge — corner 0 to corner 1 —
|
|
8767
|
+
* placed by its `x` across the mesh's horizontal extent. The inverse of
|
|
8768
|
+
* `meshFromStops`, and for any other mesh the ramp across its top.
|
|
8769
|
+
*/
|
|
8770
|
+
declare function meshStops(mesh: MeshGradientFill): GradStop[];
|
|
9042
8771
|
/**
|
|
9043
8772
|
* The `<defs>` entry for a mesh paint, in weasel's own namespace.
|
|
9044
8773
|
*
|
|
@@ -9486,6 +9215,10 @@ interface SetPathArgs {
|
|
|
9486
9215
|
* history's coalesce window. Pass an explicit key to opt out. */
|
|
9487
9216
|
declare function createSetPathOp(args: SetPathArgs): Op;
|
|
9488
9217
|
|
|
9218
|
+
/** Rebuilds an op from its serialized `args`. */
|
|
9219
|
+
type OpFactory = (args: unknown) => Op;
|
|
9220
|
+
/** Every registered op factory, keyed by op name, in registration order. */
|
|
9221
|
+
declare const opFactoryRegistry: Reflection<OpFactory>;
|
|
9489
9222
|
/** Register an op-factory builder under a stable name. The builder receives
|
|
9490
9223
|
* the serialized `args` and must return an `Op` equivalent to one freshly
|
|
9491
9224
|
* constructed at the original call site (`apply` and `invert` behave the
|
|
@@ -9693,8 +9426,8 @@ interface PointInPathOptions {
|
|
|
9693
9426
|
declare function pointInPath(path: Path, x: number, y: number, opts?: PointInPathOptions): boolean;
|
|
9694
9427
|
|
|
9695
9428
|
/**
|
|
9696
|
-
* Path-vs-geometry hit-test helpers
|
|
9697
|
-
*
|
|
9429
|
+
* Path-vs-geometry hit-test helpers: pure functions covering path-vs-point,
|
|
9430
|
+
* path-vs-rect, and path-vs-polygon in both directions.
|
|
9698
9431
|
*
|
|
9699
9432
|
* `RectPath` short-circuits to AABB arithmetic. A `PolygonPath` is treated as
|
|
9700
9433
|
* its filled region: whether a point is inside comes from `pointInPath`, so
|
|
@@ -9721,13 +9454,8 @@ declare function pathIntersectsPolygon(path: Path, polygon: readonly Point2[], o
|
|
|
9721
9454
|
* `pathContainsPoint` from `pathHitTest.ts` to get a closed-region
|
|
9722
9455
|
* pick distance (0 inside, stroke-distance outside).
|
|
9723
9456
|
*
|
|
9724
|
-
*
|
|
9725
|
-
*
|
|
9726
|
-
* curve and reduce to point-to-segment over the polyline approximation —
|
|
9727
|
-
* cheap and accurate to ~1 px for typical edit-tool sampling counts.
|
|
9728
|
-
* Quadratic beziers fall through to the cubic sampler via equivalence.
|
|
9729
|
-
*
|
|
9730
|
-
* RectPath short-circuits to AABB-perimeter math: O(1).
|
|
9457
|
+
* A polygon path defers to geom's `nearestOnPath`; a RectPath short-circuits
|
|
9458
|
+
* to AABB-perimeter math.
|
|
9731
9459
|
*/
|
|
9732
9460
|
|
|
9733
9461
|
/** Closest Euclidean distance from (px, py) to the boundary of `path`.
|
|
@@ -9981,22 +9709,37 @@ declare function decomposePath(parent: Path, world: Path): Path;
|
|
|
9981
9709
|
* single subpath comes back as a one-element array. */
|
|
9982
9710
|
declare function splitSubpaths(path: PolygonPath): PolygonPath[];
|
|
9983
9711
|
|
|
9984
|
-
/** Options for `
|
|
9985
|
-
interface
|
|
9986
|
-
/**
|
|
9712
|
+
/** Options for `splitPathBySegment`. */
|
|
9713
|
+
interface SplitBySegmentOptions {
|
|
9714
|
+
/**
|
|
9715
|
+
* Flattening tolerance for the check that decides whether contours cross
|
|
9716
|
+
* each other. Only a path whose contours do cross is flattened (see
|
|
9717
|
+
* `splitPathBySegment`).
|
|
9718
|
+
*/
|
|
9987
9719
|
flattenTolerance?: number;
|
|
9988
9720
|
}
|
|
9989
9721
|
/**
|
|
9990
|
-
* Split `path` along the finite segment a
|
|
9722
|
+
* Split `path` along the finite segment a→b into closed pieces (Knife).
|
|
9723
|
+
*
|
|
9724
|
+
* Only chords the segment crosses end to end are cut: a stretch of the segment
|
|
9725
|
+
* that starts or stops inside the fill cuts nothing, and nothing beyond the
|
|
9726
|
+
* segment's ends is touched, so a concave shape splits exactly where the
|
|
9727
|
+
* stroke crosses it. Curves are split at the crossing parameters by de
|
|
9728
|
+
* Casteljau subdivision, so every piece traces the original boundary exactly
|
|
9729
|
+
* and keeps its quadratic and cubic segments; the new edges along the cut are
|
|
9730
|
+
* straight lines.
|
|
9731
|
+
*
|
|
9732
|
+
* Each connected piece the cut produces is returned as its own path, holes
|
|
9733
|
+
* included. Contours the segment misses entirely are returned together as one
|
|
9734
|
+
* final piece. A single chord that does not disconnect the shape (across a
|
|
9735
|
+
* ring, say) returns one slit piece.
|
|
9736
|
+
*
|
|
9737
|
+
* A path whose contours cross each other or themselves is first resolved into
|
|
9738
|
+
* non-overlapping rings by a polygon union, which flattens its curves.
|
|
9991
9739
|
*
|
|
9992
|
-
* Returns `null`
|
|
9993
|
-
* (>=2 proper crossings) and both half-planes yield non-empty area. Otherwise
|
|
9994
|
-
* returns one `PolygonPath` per side of the line. Beziers are flattened
|
|
9995
|
-
* (see `pathIntersect`). The infinite line is used *within* a gated shape, so a
|
|
9996
|
-
* concave shape only partly crossed may be cut at far-side crossings - accepted
|
|
9997
|
-
* (see spec non-goals).
|
|
9740
|
+
* Returns `null` when no chord is cut.
|
|
9998
9741
|
*/
|
|
9999
|
-
declare function
|
|
9742
|
+
declare function splitPathBySegment(path: Path, a: Point, b: Point, opts?: SplitBySegmentOptions): Path[] | null;
|
|
10000
9743
|
|
|
10001
9744
|
/**
|
|
10002
9745
|
* AABB union over a heterogeneous set of `Path` poses. Returns the
|
|
@@ -10380,6 +10123,15 @@ interface PaintKindEntry {
|
|
|
10380
10123
|
colorOf(paint: FillStyle): string | undefined;
|
|
10381
10124
|
/** Editor slot. */
|
|
10382
10125
|
Editor?: ComponentType<PaintKindEditorProps>;
|
|
10126
|
+
/**
|
|
10127
|
+
* The stop list this paint reads as. With `fromStops`, it is what makes a
|
|
10128
|
+
* kind a gradient: `listGradientKinds` returns the kinds carrying both, and
|
|
10129
|
+
* `switchGradientKind` converts between any two of them through the list.
|
|
10130
|
+
*/
|
|
10131
|
+
stopsOf?(paint: FillStyle): GradStop[];
|
|
10132
|
+
/** A paint of this kind built from a stop list, in `bounds` units. The
|
|
10133
|
+
* converse of `stopsOf`; supply both or neither. */
|
|
10134
|
+
fromStops?(stops: GradStop[]): FillStyle;
|
|
10383
10135
|
/**
|
|
10384
10136
|
* Render slot: bind program, uniforms and textures for `fill` and return the
|
|
10385
10137
|
* bound program; `null` declines the paint.
|
|
@@ -10405,6 +10157,8 @@ interface PaintKindEntry {
|
|
|
10405
10157
|
*/
|
|
10406
10158
|
toSvg?(id: string, fill: FillStyle): string;
|
|
10407
10159
|
}
|
|
10160
|
+
/** Every registered paint kind, with the overrides each displaced. */
|
|
10161
|
+
declare const paintKindRegistry: Reflection<PaintKindEntry>;
|
|
10408
10162
|
/**
|
|
10409
10163
|
* A consumer's own paint, typed as a `FillStyle`.
|
|
10410
10164
|
*
|
|
@@ -10417,12 +10171,27 @@ interface PaintKindEntry {
|
|
|
10417
10171
|
declare function asPaint<T extends {
|
|
10418
10172
|
fill: string;
|
|
10419
10173
|
}>(paint: T): FillStyle;
|
|
10420
|
-
/** Register a paint kind. Returns a disposer that removes it.
|
|
10174
|
+
/** Register a paint kind. Returns a disposer that removes it. Re-registering an
|
|
10175
|
+
* existing id is an override; disposing it uncovers whatever it displaced. */
|
|
10421
10176
|
declare function registerPaintKind(entry: PaintKindEntry): () => void;
|
|
10422
10177
|
/** The entry for `kind`, or `undefined`. */
|
|
10423
10178
|
declare function getPaintKind(kind: string | undefined): PaintKindEntry | undefined;
|
|
10424
10179
|
/** Every registered kind, built-ins first, in registration order. */
|
|
10425
10180
|
declare function listPaintKinds(): readonly PaintKindEntry[];
|
|
10181
|
+
/** Every registered gradient kind — the ones that read as and build from a
|
|
10182
|
+
* stop list — in registration order. */
|
|
10183
|
+
declare function listGradientKinds(): readonly PaintKindEntry[];
|
|
10184
|
+
/**
|
|
10185
|
+
* `paint` retargeted to gradient kind `kind`, or `undefined` when either side
|
|
10186
|
+
* is not a gradient kind.
|
|
10187
|
+
*
|
|
10188
|
+
* Between two of the stop gradients this is `withGradientKind`, which carries
|
|
10189
|
+
* the geometry. Any other pair goes through the stop list — `stopsOf` on the
|
|
10190
|
+
* way out, `fromStops` on the way in — keeping `interpolate` and `opacity`.
|
|
10191
|
+
* Lossy wherever the kinds hold different information; an editor that wants a
|
|
10192
|
+
* switch to be undoable should keep the original paint.
|
|
10193
|
+
*/
|
|
10194
|
+
declare function switchGradientKind(paint: FillStyle, kind: PaintKind): FillStyle | undefined;
|
|
10426
10195
|
/** The registry entry for a paint, or `undefined` when its kind is unknown. */
|
|
10427
10196
|
declare function paintKindOf(fill: FillStyle): PaintKindEntry | undefined;
|
|
10428
10197
|
/** @internal Test helper — do not call from product code. */
|
|
@@ -10476,11 +10245,18 @@ interface MarkerEntry {
|
|
|
10476
10245
|
/** `'auto'` (default) follows the line; a number is a fixed angle in
|
|
10477
10246
|
* radians, ignoring the line — SVG's `orient="<angle>"`. */
|
|
10478
10247
|
orient?: 'auto' | number;
|
|
10248
|
+
/** The stroke fields `path` reads besides `ctx.size` — `[]` for a shape
|
|
10249
|
+
* drawn from size alone. Declared, a head is reused across stroke objects
|
|
10250
|
+
* whose listed fields are equal; omitted, only across frames that pass the
|
|
10251
|
+
* same stroke object, since `path` might read any of it. */
|
|
10252
|
+
reads?: readonly (keyof Stroke)[];
|
|
10479
10253
|
/** Emits the `<marker>` def. Consumed by `@weasel-js/svg`. */
|
|
10480
10254
|
toSvg?(id: string, entry: MarkerEntry): string;
|
|
10481
10255
|
}
|
|
10482
|
-
/**
|
|
10483
|
-
|
|
10256
|
+
/** Every registered marker, with the overrides each displaced. */
|
|
10257
|
+
declare const markerRegistry: Reflection<MarkerEntry>;
|
|
10258
|
+
/** Register a marker. Returns a disposer. Re-registering an existing id is an
|
|
10259
|
+
* override; disposing it uncovers whatever it displaced rather than deleting the key. */
|
|
10484
10260
|
declare function registerMarker(entry: MarkerEntry): () => void;
|
|
10485
10261
|
/** The entry for `key`, or `undefined`. */
|
|
10486
10262
|
declare function getMarker(key: string | undefined): MarkerEntry | undefined;
|
|
@@ -10499,15 +10275,17 @@ declare function _resetMarkersForTests(): void;
|
|
|
10499
10275
|
* line ends.
|
|
10500
10276
|
*/
|
|
10501
10277
|
|
|
10502
|
-
/** The size of one marker unit, in the same world units as `strokeWidth`.
|
|
10503
|
-
|
|
10278
|
+
/** The size of one marker unit, in the same world units as `strokeWidth`.
|
|
10279
|
+
* `scale` is the view scale a `{ px }` size resolves against, as a `{ px }`
|
|
10280
|
+
* stroke width does. */
|
|
10281
|
+
declare function resolveMarkerSize(ref: MarkerRef, strokeWidth: number, scale?: number): number;
|
|
10504
10282
|
declare function markerKeyOf(ref: MarkerRef): string;
|
|
10505
10283
|
/**
|
|
10506
10284
|
* How far back the ribbon stops for `ref`, in world units. Zero for an absent
|
|
10507
10285
|
* marker, an unregistered key, or an open head — never throws, because an
|
|
10508
10286
|
* unknown key is a data problem and dropping the head is the graceful answer.
|
|
10509
10287
|
*/
|
|
10510
|
-
declare function markerInset(ref: MarkerRef | undefined, strokeWidth: number): number;
|
|
10288
|
+
declare function markerInset(ref: MarkerRef | undefined, strokeWidth: number, scale?: number): number;
|
|
10511
10289
|
/** The start and end insets a stroke asks for. `markerMid` never insets —
|
|
10512
10290
|
* trimming at an interior vertex would cut the line in two. */
|
|
10513
10291
|
declare function strokeInsets(stroke: Stroke, strokeWidth: number): {
|
|
@@ -10554,22 +10332,6 @@ interface MarkerSiteRequest {
|
|
|
10554
10332
|
}
|
|
10555
10333
|
declare function markerSites(pl: Polyline, want: MarkerSiteRequest): MarkerSite[];
|
|
10556
10334
|
|
|
10557
|
-
/**
|
|
10558
|
-
* Turning a stroke's markers into draw commands.
|
|
10559
|
-
*
|
|
10560
|
-
* Separate `PathDrawCommand`s rather than triangles appended to the stroke
|
|
10561
|
-
* ribbon: an entry may carry a fill and an outline at once, or a paint that
|
|
10562
|
-
* differs from the line's, neither of which one mesh can express — and folding
|
|
10563
|
-
* them in would drag the whole marker vocabulary into the ribbon cache key.
|
|
10564
|
-
*/
|
|
10565
|
-
|
|
10566
|
-
/**
|
|
10567
|
-
* Every marker command for `path` under `stroke`. `strokeWidth` is the already
|
|
10568
|
-
* width-resolved stroke width; `flattenTolerance` matches what the ribbon used,
|
|
10569
|
-
* so markers land on the same flattened vertices the stroke did.
|
|
10570
|
-
*/
|
|
10571
|
-
declare function markerDrawCommands(path: Path, stroke: Stroke, strokeWidth: number, flattenTolerance: number | undefined): PathDrawCommand[];
|
|
10572
|
-
|
|
10573
10335
|
/**
|
|
10574
10336
|
* The kit's built-in stroke-marker vocabulary.
|
|
10575
10337
|
*
|
|
@@ -10780,7 +10542,8 @@ type ModKey = keyof ModifierState;
|
|
|
10780
10542
|
* ...so the gesture applies the same delta to every dragged id.
|
|
10781
10543
|
*
|
|
10782
10544
|
* The pose-shape-aware delta extraction lives here — gestures stay pose-shape
|
|
10783
|
-
* agnostic. Default projection
|
|
10545
|
+
* agnostic. Default projection reads a rect's `{x, y}` or a Path's bounds
|
|
10546
|
+
* origin, matching `gridSnapStrategy`'s own default.
|
|
10784
10547
|
* Pass `origin` for exotic poses.
|
|
10785
10548
|
*/
|
|
10786
10549
|
declare function snap<TPose>(strategy: SnapStrategy<TPose>, opts?: {
|
|
@@ -11253,10 +11016,11 @@ interface SelectFromLassoOptions {
|
|
|
11253
11016
|
/** Hit mode for `hitTestLasso`. Default 'intersect'. */
|
|
11254
11017
|
mode?: LassoHitMode;
|
|
11255
11018
|
}
|
|
11256
|
-
/**
|
|
11257
|
-
*
|
|
11258
|
-
* gesture start. Tiny / degenerate lassos behave like a click —
|
|
11259
|
-
* preserve, with shift).
|
|
11019
|
+
/** A lasso behavior (`useLassoTool({ behaviors })`): replace selection with
|
|
11020
|
+
* polygon hits in its own `mode`, or extend the existing selection when shift
|
|
11021
|
+
* is held at gesture start. Tiny / degenerate lassos behave like a click —
|
|
11022
|
+
* clear (or preserve, with shift). Hits come from the gesture adapter's
|
|
11023
|
+
* `hitTestLasso`, which under `lassoSelectAction` is the `lassoSelect` dep. */
|
|
11260
11024
|
declare function selectFromLasso(opts?: SelectFromLassoOptions): LassoSelectBehavior;
|
|
11261
11025
|
|
|
11262
11026
|
/** Edge or center the selection should align to within the selection's visual
|
|
@@ -12075,32 +11839,32 @@ interface IconProps {
|
|
|
12075
11839
|
/** Classic cursor-arrow shape — filled silhouette pointing top-left to
|
|
12076
11840
|
* bottom-right with the diagonal "tail" along the lower edge. Used for
|
|
12077
11841
|
* `useSelectTool`. */
|
|
12078
|
-
declare function SelectIcon({ className, size }: IconProps):
|
|
11842
|
+
declare function SelectIcon({ className, size }: IconProps): react.JSX.Element;
|
|
12079
11843
|
|
|
12080
11844
|
/** Freeform marquee — outlined irregular loop with a short tail
|
|
12081
11845
|
* suggesting "the lasso closed where you released the pointer." Used
|
|
12082
11846
|
* for `useLassoTool`. */
|
|
12083
|
-
declare function LassoIcon({ className, size }: IconProps):
|
|
11847
|
+
declare function LassoIcon({ className, size }: IconProps): react.JSX.Element;
|
|
12084
11848
|
|
|
12085
11849
|
/** Outlined rectangle with a small crosshair at the upper-left corner,
|
|
12086
11850
|
* signaling "this is a drawing tool, not just a shape." Used for the
|
|
12087
11851
|
* rectangle insertion tool (`useInsertTool` today, future `useRectTool`). */
|
|
12088
|
-
declare function RectIcon({ className, size }: IconProps):
|
|
11852
|
+
declare function RectIcon({ className, size }: IconProps): react.JSX.Element;
|
|
12089
11853
|
|
|
12090
11854
|
/** Outlined ellipse. Used for the ellipse insertion tool. */
|
|
12091
|
-
declare function EllipseIcon({ className, size }: IconProps):
|
|
11855
|
+
declare function EllipseIcon({ className, size }: IconProps): react.JSX.Element;
|
|
12092
11856
|
|
|
12093
11857
|
/** Framed picture with a sun and mountain — the conventional "image" glyph.
|
|
12094
11858
|
* Used for the image insertion tool (`useImageTool`). */
|
|
12095
|
-
declare function ImageIcon({ className, size }: IconProps):
|
|
11859
|
+
declare function ImageIcon({ className, size }: IconProps): react.JSX.Element;
|
|
12096
11860
|
|
|
12097
11861
|
/** Eyedropper — diagonal stem running from upper-right (bulb) to
|
|
12098
11862
|
* lower-left (tip), with a small squared bulb cap at the top. Used
|
|
12099
11863
|
* for the eyedropper / color-picker tool. */
|
|
12100
|
-
declare function EyedropperIcon({ className, size }: IconProps):
|
|
11864
|
+
declare function EyedropperIcon({ className, size }: IconProps): react.JSX.Element;
|
|
12101
11865
|
|
|
12102
11866
|
/** Diagonal line. Used for the line insertion tool. */
|
|
12103
|
-
declare function LineIcon({ className, size }: IconProps):
|
|
11867
|
+
declare function LineIcon({ className, size }: IconProps): react.JSX.Element;
|
|
12104
11868
|
|
|
12105
11869
|
/** `LineIcon`'s diagonal with a filled head, so the two read as one tool with
|
|
12106
11870
|
* and without the marker. Used for the arrow insertion tool.
|
|
@@ -12109,82 +11873,82 @@ declare function LineIcon({ className, size }: IconProps): react_jsx_runtime.JSX
|
|
|
12109
11873
|
* under antialiasing and the notch disappears, leaving a blob. Its base
|
|
12110
11874
|
* corners are `tip ∓ 5.6·d ± 2.1·d⊥` — computed, and the shaft stops half a
|
|
12111
11875
|
* unit inside the base so its round cap hides under the fill. */
|
|
12112
|
-
declare function ArrowIcon({ className, size }: IconProps):
|
|
11876
|
+
declare function ArrowIcon({ className, size }: IconProps): react.JSX.Element;
|
|
12113
11877
|
|
|
12114
11878
|
/** Outlined hexagon. Used for the polygon insertion tool. */
|
|
12115
|
-
declare function PolygonIcon({ className, size }: IconProps):
|
|
11879
|
+
declare function PolygonIcon({ className, size }: IconProps): react.JSX.Element;
|
|
12116
11880
|
|
|
12117
11881
|
/** Outlined five-point star. Used for the star insertion tool. */
|
|
12118
|
-
declare function StarIcon({ className, size }: IconProps):
|
|
11882
|
+
declare function StarIcon({ className, size }: IconProps): react.JSX.Element;
|
|
12119
11883
|
|
|
12120
11884
|
/** Slanted pencil pointing toward the upper-right corner. Used for the
|
|
12121
11885
|
* freehand pencil insertion tool. */
|
|
12122
|
-
declare function PencilIcon({ className, size }: IconProps):
|
|
11886
|
+
declare function PencilIcon({ className, size }: IconProps): react.JSX.Element;
|
|
12123
11887
|
|
|
12124
11888
|
/** Serif "T" — top bar + stem + small bottom serif. Used for
|
|
12125
11889
|
* `useTextTool`. Visually consistent with the layer-list text icon. */
|
|
12126
|
-
declare function TextIcon({ className, size }: IconProps):
|
|
11890
|
+
declare function TextIcon({ className, size }: IconProps): react.JSX.Element;
|
|
12127
11891
|
|
|
12128
11892
|
/** Pen nib — angled filled body with a pointed tip and a small ink dot
|
|
12129
11893
|
* at the very tip, plus a short "control" handle extending out the
|
|
12130
11894
|
* back. Used for `usePenTool`. */
|
|
12131
|
-
declare function PenIcon({ className, size }: IconProps):
|
|
11895
|
+
declare function PenIcon({ className, size }: IconProps): react.JSX.Element;
|
|
12132
11896
|
|
|
12133
11897
|
/** Open hand — rounded palm with four upward fingers (variable length)
|
|
12134
11898
|
* and a thumb stub. Used for `useHandTool` (viewport pan). */
|
|
12135
|
-
declare function HandIcon({ className, size }: IconProps):
|
|
11899
|
+
declare function HandIcon({ className, size }: IconProps): react.JSX.Element;
|
|
12136
11900
|
|
|
12137
11901
|
/** Placeholder for tools without `presentation.icon`. A circle with "?"
|
|
12138
11902
|
* inside — readable, debuggable, not hidden. */
|
|
12139
|
-
declare function UnknownIcon({ className, size }: IconProps):
|
|
11903
|
+
declare function UnknownIcon({ className, size }: IconProps): react.JSX.Element;
|
|
12140
11904
|
|
|
12141
11905
|
/** Icon for the union operation: two overlapping circles merged into one filled shape. */
|
|
12142
|
-
declare function UnionIcon():
|
|
11906
|
+
declare function UnionIcon(): react.JSX.Element;
|
|
12143
11907
|
/** Icon for the intersect operation: only the overlap of two circles filled. */
|
|
12144
|
-
declare function IntersectIcon():
|
|
11908
|
+
declare function IntersectIcon(): react.JSX.Element;
|
|
12145
11909
|
/** Icon for the subtract operation: the front circle removed from the back one. */
|
|
12146
|
-
declare function SubtractIcon():
|
|
11910
|
+
declare function SubtractIcon(): react.JSX.Element;
|
|
12147
11911
|
/** Icon for the exclude operation: both circles filled except their overlap. */
|
|
12148
|
-
declare function ExcludeIcon():
|
|
11912
|
+
declare function ExcludeIcon(): react.JSX.Element;
|
|
12149
11913
|
/** Icon for the divide operation: two circles split into their separate regions. */
|
|
12150
|
-
declare function DivideIcon():
|
|
11914
|
+
declare function DivideIcon(): react.JSX.Element;
|
|
12151
11915
|
/** Icon for the crop operation: the back shape clipped to the front one. */
|
|
12152
|
-
declare function CropIcon():
|
|
11916
|
+
declare function CropIcon(): react.JSX.Element;
|
|
12153
11917
|
|
|
12154
11918
|
/** Cut: scissors. */
|
|
12155
|
-
declare function CutIcon():
|
|
11919
|
+
declare function CutIcon(): react.JSX.Element;
|
|
12156
11920
|
/** Copy: a document peeking out behind another. */
|
|
12157
|
-
declare function CopyIcon():
|
|
11921
|
+
declare function CopyIcon(): react.JSX.Element;
|
|
12158
11922
|
/** Paste: a clipboard with a filled clip. */
|
|
12159
|
-
declare function PasteIcon():
|
|
11923
|
+
declare function PasteIcon(): react.JSX.Element;
|
|
12160
11924
|
/** Duplicate: the source outlined, the copy filled. */
|
|
12161
|
-
declare function DuplicateIcon():
|
|
11925
|
+
declare function DuplicateIcon(): react.JSX.Element;
|
|
12162
11926
|
/** Group: corner brackets framing two filled rects. */
|
|
12163
|
-
declare function GroupIcon():
|
|
11927
|
+
declare function GroupIcon(): react.JSX.Element;
|
|
12164
11928
|
/** Ungroup: two filled rects escaping a frame broken to two dashed corners. */
|
|
12165
|
-
declare function UngroupIcon():
|
|
11929
|
+
declare function UngroupIcon(): react.JSX.Element;
|
|
12166
11930
|
/** Bring forward: two stacked rects, the front one filled. */
|
|
12167
|
-
declare function BringForwardIcon():
|
|
11931
|
+
declare function BringForwardIcon(): react.JSX.Element;
|
|
12168
11932
|
/** Bring to front: three stacked rects, the frontmost filled. */
|
|
12169
|
-
declare function BringToFrontIcon():
|
|
11933
|
+
declare function BringToFrontIcon(): react.JSX.Element;
|
|
12170
11934
|
/** Send backward: two stacked rects, the rear one filled. */
|
|
12171
|
-
declare function SendBackwardIcon():
|
|
11935
|
+
declare function SendBackwardIcon(): react.JSX.Element;
|
|
12172
11936
|
/** Send to back: three stacked rects, the rearmost filled. */
|
|
12173
|
-
declare function SendToBackIcon():
|
|
11937
|
+
declare function SendToBackIcon(): react.JSX.Element;
|
|
12174
11938
|
/** Flip horizontal: an outlined and a filled chevron either side of a dashed vertical axis. */
|
|
12175
|
-
declare function FlipXIcon():
|
|
11939
|
+
declare function FlipXIcon(): react.JSX.Element;
|
|
12176
11940
|
/** Flip vertical: an outlined and a filled chevron either side of a dashed horizontal axis. */
|
|
12177
|
-
declare function FlipYIcon():
|
|
11941
|
+
declare function FlipYIcon(): react.JSX.Element;
|
|
12178
11942
|
|
|
12179
|
-
declare function AlignLeftIcon():
|
|
12180
|
-
declare function AlignRightIcon():
|
|
12181
|
-
declare function AlignTopIcon():
|
|
12182
|
-
declare function AlignBottomIcon():
|
|
12183
|
-
declare function AlignCenterXIcon():
|
|
12184
|
-
declare function AlignCenterYIcon():
|
|
11943
|
+
declare function AlignLeftIcon(): react.JSX.Element;
|
|
11944
|
+
declare function AlignRightIcon(): react.JSX.Element;
|
|
11945
|
+
declare function AlignTopIcon(): react.JSX.Element;
|
|
11946
|
+
declare function AlignBottomIcon(): react.JSX.Element;
|
|
11947
|
+
declare function AlignCenterXIcon(): react.JSX.Element;
|
|
11948
|
+
declare function AlignCenterYIcon(): react.JSX.Element;
|
|
12185
11949
|
|
|
12186
|
-
declare function DistributeHorizontalIcon():
|
|
12187
|
-
declare function DistributeVerticalIcon():
|
|
11950
|
+
declare function DistributeHorizontalIcon(): react.JSX.Element;
|
|
11951
|
+
declare function DistributeVerticalIcon(): react.JSX.Element;
|
|
12188
11952
|
|
|
12189
11953
|
/**
|
|
12190
11954
|
* @experimental
|
|
@@ -12201,11 +11965,11 @@ interface ActionGlyphProps extends IconProps {
|
|
|
12201
11965
|
fillOpacity?: number;
|
|
12202
11966
|
}
|
|
12203
11967
|
/** @experimental Undo: a straight run returning in a half circle, arrowhead on the run. */
|
|
12204
|
-
declare function UndoIcon(p: ActionGlyphProps):
|
|
11968
|
+
declare function UndoIcon(p: ActionGlyphProps): react.JSX.Element;
|
|
12205
11969
|
/** @experimental Redo: the undo glyph mirrored. */
|
|
12206
|
-
declare function RedoIcon(p: ActionGlyphProps):
|
|
11970
|
+
declare function RedoIcon(p: ActionGlyphProps): react.JSX.Element;
|
|
12207
11971
|
/** @experimental Delete: a lidded trash can. */
|
|
12208
|
-
declare function DeleteIcon(p: ActionGlyphProps):
|
|
11972
|
+
declare function DeleteIcon(p: ActionGlyphProps): react.JSX.Element;
|
|
12209
11973
|
|
|
12210
11974
|
/**
|
|
12211
11975
|
* @experimental
|
|
@@ -12246,4 +12010,4 @@ interface InsertOverlayStyle {
|
|
|
12246
12010
|
lineWidth?: number;
|
|
12247
12011
|
}
|
|
12248
12012
|
|
|
12249
|
-
export { ACTION_GLYPHS, ANCHOR_HIT_BASE_PX, type ActionGlyphProps, type ActionShortcut, ActionsProviderIfRoot, type Affordance, type AffordanceBinding, type AffordanceRegion, type AffordanceRegionHit, type AlignAdapter, type AlignAnchor, AlignBottomIcon, AlignCenterXIcon, AlignCenterYIcon, type AlignEdge, AlignLeftIcon, type AlignMatchResult, type AlignMoveArgs, AlignRightIcon, AlignTopIcon, type AlignmentBehaviorBase, type AnchorHit, type AnchorScratch, type AnchorState, type AnimateOnSetPoseOptions, AnimationHandle, Animator, type AnyTool, AreaSelectAdapter, type ArrayAdapter, type ArrayAdapterConfig, ArrowIcon, BUILTIN_MARKERS, BUNDLE_TOOLS, type BakedMesh, type BindRigOptions, BooleansAdapter, BoundsConstraint, BringForwardIcon, BringToFrontIcon, type BuildChromeCtxArgs, type BuiltinShapeToolId, type BuiltinToolId, type BuiltinToolOptions, CURVE_REPS, type CanvasExtensionApi, type CanvasFocusReturn, type CanvasHelpers, type CanvasProps, type CanvasSelectionMode, type CanvasSize, type CanvasSizeSnapshot, type CanvasSurfaceHelpers, CanvasView, type CanvasViewHandle, type CanvasViewHelpers, type CanvasViewProps, type CellHighlightLayerOpts, type ChromeCtx, type ChromeId, type ChromeState, type ClampBounds, ClipboardSnapshot, type CoalescedCtx, type ColorInterpolate, ColorOverrideRegistry, type CommonAffordanceScratch, type ComposeSelectionPoseOpts, type ComputeFitViewOptions, type Condition, ContentHandlerEntry, type Contribution, type ContributionChrome, CopyIcon, type CornerResizeAffordanceOptions, type CornerResizeScratch, type CreateChildrenLayerOpts, type CreateParallaxLayerOpts, type CreatePathEditingOverlayLayerOptions, type CreatePathLayerOpts, type CreatePenPreviewLayerOptions, type CreateTextLayerOpts, type CreateTiledLayerOpts, type CreateViewResolverOpts, type CreateViewportLayerOpts, CropIcon, CursorCoordsHud, type CursorCoordsHudProps, type CurveRepKind, type CurveRepresentation, type CustomLayerEntry, type CustomPaintContext, CutIcon, type CycleHandle, type CycleVertexColorsOptions, DEFAULT_DEBUG_STROKES, DEFAULT_DEBUG_THEME, DEFAULT_FILL_COLOR, DEFAULT_GUIDE_TOLERANCE_PX, DEFAULT_HANDLE_SIZE, DEFAULT_MAX_ZOOM, DEFAULT_MIN_ZOOM, DEFAULT_PALETTE, DEFAULT_ROTATION_HANDLE_DISTANCE, DEFAULT_SHAPE_FILL, DEFAULT_STROKE_COLOR, type DebugConfig, type DebugFeature, type DebugSnapshot, type DebugStroke, type DebugStrokes, type DebugTheme, type DefaultTextData, DeleteIcon, DepRegistryProviderIfRoot, type DeriveAlignmentGuidesOptions, DerivedDep, DeviceProfileProvider, type DeviceProfileProviderProps, type Dims, type Discriminator, type DistributeAdapter, type DistributeAxis, DistributeHorizontalIcon, type DistributeMode, DistributeVerticalIcon, DivideIcon, type DragGestureController, type DragGestureCtx, type DragGestureEndCtx, type DragGesturePhase, type DragGesturePoint, type DragHandleOptions, type DragPanParams, type DragPayload, type DragRadialController, type DragRadialCtx, type DragRadialEndCtx, type DragRadialPoint, type DragRadialState, type DragRectBounds, type DragRectController, type DragRectCtx, type DragRectEndCtx, type DragRectPoint, DrawCommand, type DropZoneOptions, DuplicateIcon, EasingSpec, Effect, EllipseIcon, ExcludeIcon, EyedropperIcon, FALLBACK_FIT_VIEW, type FeedDelta, type FeedNode, type FillPoseBox, type FitTextPoseOptions, type FlagKey, FlipXIcon, FlipYIcon, type FreeformOptions, GHOST_STROKE, type GateLayerOptions, GeometryProjection, type GesturePreviewSource, type GestureSource, GlMat3, type GridLayerOpts, type GridSlotConfig, GroupIcon, Guide, type GuideSnapOptions, type GuidesLayerOpts, HANDLE_BASE_PX, HandIcon, InertiaConfig as HandToolInertiaConfig, type HandleDragEnd, type HandleDragPoint, type HeadlessCanvasLike, type HostAnchorAlign, type HostAnchorInput, type HostAnchorOffset, type HostAnchorStyle, IDENTITY_JOINT, type IconProps, ImageIcon, type ImageNodeData, type ImageRasterSize, type ImageStatus, type IndicatorStyle, InertiaConfig, InsertAdapter, InsertBehavior, InsertExtras, type InsertNodeFactory, type InsertOp, type InsertOverlayStyle, type InsertPreviewExtent, type InsertPreviewGeometry, type InsertPreviewLike, type InsertPreviewOverlay, IntersectIcon, type Joint, type JointTransform, KIT_SHAPE_KINDS, KIT_STANDARD_ACTION_IDS, type KeyModifiers, type KeyState, type KeyStateAttachOptions, type LabelOptions, LassoHitMode, LassoIcon, LassoSelectAdapter, LassoSelectBehavior, type LayerCommandCache, type LayerDrawFailure, LayerEnumerableAdapter, type LayerGroup, type LayerHit, type LayerSlotValue, type LayersMap, LayoutDropTargetMode, LayoutSnap, LayoutStrategy, type LifecycleAnimation, LineIcon, type LinePoint, MESH_BAKE_SIZE, MESH_GRADIENT_KIND, MIXED, MOVE_ANCHORS, type MarkerCtx, type MarkerEntry, type MarkerPaint, type MarkerSite, type MarkerSiteRequest, type MeshGradientFill, type MeshPatch, type MeshPoint, MinimapCanvas, type MinimapCanvasProps, type MinimapFit, type Mixed, type MomentumOptions, MoveAdapter, MoveBehavior, type NestedHitOpts, type NestedHitTester, type NodeClientRect, type NodeInk, type NodeInkCtx, type NodeOverlayFrame, type NodePaintCtx, type NodeProperties, type NodePropertiesEntry, type NodeRouting, type NodeRoutingEntry, type NodeShapeEntry, type NodeSilhouetteCtx, type OpenFilePickerOptions, OrderedAdapter, OriginProjection, type OverlayPoint, type OverlayVisibilityId, PAINTED_CURSOR_LAYER_ID, PATH_ANCHOR_CHROME_ID, type PaintBindContext, type PaintKind, type PaintKindEditorProps, type PaintKindEntry, type PaintProgram, PanBounds, type ParallaxOpts, PasteIcon, Path, type PathAnchor, type PathAnchorAffordanceOptions, PathBuilder, PathDrawCommand, type PathEditingOverlayStyle, type PathInWorldPose, type PenAnchor, PenIcon, type PenPreviewStyle, type PenScratch, type PenSubpath, PencilIcon, type PencilPoint, PickHud, type PickHudProps, type PickTopMostHitAdapter, type PinchZoomOptions, type PixelRenderPlan, type PointInPathOptions, type PointInTextPoseOpts, PointSnapBehavior, PointerContextProvider, type PointerContextValue, PointerProviderIfRoot, type PointerSample, type PointerStylusState, type PointerWorldPos, PolygonIcon, PolygonPath, type PolygonPoint, type Pose, PoseComposition, PoseDescriptor, type PoseFeed, PoseOverrides, type PoseRotation, type PoseRun, type PoseRunCtx, type PoseRunStep, type PoseSource, type PosedNode, type PressureToWidthOptions, type PreviewNode, ROTATION_HANDLE_BASE_PX, type RangeStyle, type RasterImage, type RecordedBounds, type RecordedHandle, type RecordedHitbox, type RecordedLayer, type RecordedOrigin, type RecordedSnap, RectIcon, RectPath, RectPose, RedoIcon, type RegisterNodeShapeOptions, RegisteredOp, type RenderLayer, type RenderSceneToCanvasArgs, type RenderSceneToPixelsArgs, type ReorderDirection, ResizeAdapter, type ResolvableView, type ResolvedOverlay, type Rig, type RigApply, type RigApplyContext, type RigScene, RotateAdapter, RotateBehavior, RotatedPose, type RotationAffordanceOptions, type RotationHandle, type RotationScratch, type RunStylePatch, SampledTrack, type ScalarOrXY, Scene, SceneAdapter, type SceneAdapterSelection, SceneCanvas, type SceneCanvasAdapter, type SceneCanvasApi, type SceneCanvasHit, type SceneCanvasProps, Node$1 as SceneNode, type SceneNodeClientRectOpts, SceneRegistry, type SceneSlotConfig, type SceneToAdapterOptions, SceneViewCanvas, type SceneViewCanvasProps, type SceneViewDrawOne, type SceneViewLayers, type SelectAdapter, type SelectFromLassoOptions, SelectIcon, SelectionContextProvider, SelectionContextProviderIfRoot, type SelectionContextValue, type SelectionHandleStyle, type SelectionHandlesLayerOpts, type SelectionOutlineLayerOpts, type SelectionOverlayLayerOpts, type SelectionOverlaySlotConfig, SendBackwardIcon, SendToBackIcon, SerializedScene, type SetFlagResult, type SetPathFields, ShaderProgramHandle, type ShapeCoversPointOptions, type ShapeKind, type SharedAnchor, Simulation, SimulationNode, type Skeleton, type Slew, type SlewRates, SliceDep, type SnapPattern, type SnapPointOptions, SnapStrategy, type SplitByLineOptions, type SpringPoseOptions, SpringPresetName, type SpringVertexColorsOptions, type StaggerVertexColorsOptions, type StandardSlotConfig, type StandardSlotName, StarIcon, type StarPoint, type StartEditOptions, type StyleKey, type StylusData, SubtractIcon, SvgIngestOptions, TOOL_PREF_KINDS, TextDrawCommand, type TextEditClipRect, type TextEditScreenPose, type TextEditSelection, TextIcon, type ThresholdDragHandle, type ThresholdDragOptions, type TileBleed, type TileGridOptions, type TilePatternOpts, type TilePeriod, type TileRange, type Tool, type ToolBundle, type ToolDef, type ToolPref, type ToolPrefBoolean, type ToolPrefBooleanControl, type ToolPrefColor, type ToolPrefCustom, type ToolPrefEnum, type ToolPrefEnumControl, type ToolPrefEnumEncoding, type ToolPrefGroup, type ToolPrefKind, type ToolPrefLeaf, type ToolPrefNumber, type ToolPrefNumberControl, type ToolPrefNumberFormat, type ToolPrefNumberUnit, type ToolPrefObject, type ToolPrefPaint, type ToolPrefString, type ToolPrefStringControl, type ToolsApi, type TweenPoseOptions, type TweenVertexColorsOptions, UNION_OF_CHILDREN, UndoIcon, UngroupIcon, UnionIcon, Unit, UnitEntry, UnitSystem, UnitValue, UnknownIcon, type UseAlignOptions, type UseAlignReturn, UseAnimatorOptions, type UseArrayAdapterOptions, type UseBooleansOptions, type UseBooleansReturn, type UseCanvasFocusOptions, type UseDistributeOptions, type UseDistributeReturn, type UseDragGestureOptions, type UseDragRadialOptions, type UseDragRectOptions, type UseEyedropperToolOptions, type UseGridCellHoverOptions, type UseGridCellHoverReturn, type UseGuidesReturn, type UseHandToolOptions, type UseHandleDragOptions, type UseHandleDragReturn, type UseHostAnchorOptions, type UseHoverTrackingArgs, type UseImageToolOptions, type UseKeyStateOptions, type UseKeybindingsOptions, type UseLassoSelectOptions, type UseLassoToolOptions, UseMoveOptions, type UseNodeOverlayFrameOptions, type UsePenToolOptions, type UsePointerStylusOptions, type UsePolygonToolOptions, type UsePoseRunOptions, UseResizeOptions, type UseResizePolicyOptions, type UseRotateOptions, UseSceneOptions, type UseSceneTextEditOptions, type UseSceneTextEditReturn, type UseSceneTrivialOptions, type UseSelectToolOptions, type UseSelectionOptions, UseSimulationOptions, type UseStandardActionsOptions, type UseStarToolOptions, type UseTextEditOptions, type UseTextEditReturn, type UseToolsOptions, VERSION, type VelocityTracker, VertexColorChannel, ViewAnimationOptions, type ViewRect, type ViewResolver, type ViewTarget, type ViewTransform, ViewportDims, type ViewportLayer, type ViewportToolDef, type ViewportZoomAnimateOptions, type ViewportZoomOptions, type VisibilityRules, type VisibleRaf, type VisibleRafOptions, type VisibleRafTarget, WHEEL_ZOOM_STEP, WeaselProvider, type WheelInput, type WheelPanOptions, type WheelPanOpts, ZOOM_FLOOR, type ZoomBound, type ZoomClampOpts, type ZoomFactor, _resetMarkersForTests, _resetPaintKindsForTests, actionIs, actionShortcuts, alignDeltaFor, alignInsertBehavior, alignMoveBehavior, alignResizeBehavior, always, and, animateLifecycle, animateOnSetPose, annulusSemiAxes, applyOpsTo, applyStyleToRange, areaSelectAction, arrayAdapter, asPaint, axisAlignedBounds, bakeMesh, bezierCubic, bezierQuadratic, bindRig, blendPoses, boundsOfPath, buildChromeCtx, buildSceneViewCommands, canBringForward, canHover, canSendBackward, capabilityAll, capabilityIn, capabilityIs, capabilityNot, caretIndexAt, cellAt, charOffsetToDomPosition, circlePath, clampView, clearSelectionAction, clipboardCopyAction, clipboardCutAction, clipboardPasteAction, cloneAction, coarsePointer, composeAffordanceLayer, composePath, composeSelectionPose, computeFitView, computeFitViewport, computeIndicatorCommand, computeWheelAction, cond, constrainTo45, containedThenNearest, cornerWeights, countPathAnchors, createCellHighlightLayer, createChildrenLayer, createCornerResizeAffordance, createDebugOverlayLayer, createDebugSink, createDeleteOp, createGridLayer, createGuidesLayer, createHistory, createInsertOp, createKeyState, createMoveToIndexOp, createNodeProperties, createNodeRouting, createPaintedCursorLayer, createParallaxLayer, createPathAnchorAffordances, createPathEditingOverlayLayer, createPathLayer, createPenPreviewLayer, createPoseFeed, createPoseOverrides, createReorderOp, createReparentOp, createRotationAffordance, createScene, createSelectionHandlesLayer, createSelectionOutlineLayer, createSelectionOverlayLayer, createSetDataOp, createSetLayerOp, createSetPathOp, createSetSelectionOp, createSetTextOp, createSlew, createTextLayer, createTilePattern, createTiledLayer, createTransformOp, createVelocityTracker, createViewResolver, createViewportLayer, cycleFill, cycleVertexColors, decomposePath, defaultCommitAdapter, defaultDrawOne, defaultLabelTextRenderer, defaultNodeProperties, defaultNodeRouting, defaultVisibilityRules, defineTool, defineViewportTool, definesFrame, deriveAlignmentGuides, deriveParallaxView, derivedDepOf, derivedPose, dispatchApplyBatch, dlog, documentPose, domPositionToCharOffset, domToRuns, drawLayers, drawOneLayer, dwarn, editAnchorsAction, effectivePose, effectiveRangeStyle, enterTextEditAction, enumerateAnchors, evalPatch, fillInPoseFrame, fillToBoundsFrame, findNodeShape, findShapeInk, findShapeSilhouette, fitTextPose, fitToBounds, fitZoom, flattenPreviews, focused, forEachCoalesced, freeform, gateLayer, gesturing, getAlpha01, getImageBitmap, getMarker, getNodeShapes, getPaintKind, getStylusData, gradientForBounds, gradientGeometry, guideSnapStrategy, hexToRgba, hitAffordanceRegions, hitAnchor, hitRotationHandle, hostAnchorCss, hostAnchorRect, hovering, hoveringSelected, imageStatus, inferredNodeProperties, inferredNodeRouting, insertAction, insertPreviewExtent, interpolateView, isBuiltinToolPref, isDebugEnabled, isGradientFill, isLayerPainted, isLayerVisible, isMeshGradientFill, isPatternSpec, isTensorPatch, isValidPatch, isVectorImageSrc, keySpecShortcut, lassoSelectAction, listMarkers, listPaintKinds, makePinchZoomAction, makeViewportWheelPanAction, makeViewportZoomAction, markerDrawCommands, markerInset, markerKeyOf, markerSites, matchAlignment, meanScale, mergeAlphaFromPrev, meshBounds, meshGradientXml, modeIn, modeIs, modeNot, modifierHeld, momentum, moveAction, multiActive, nearest, nearestWithin, nestedHitTester, never, nodeHasFlag, none, normalizeHex, normalizeView, normalizeZoom, not, nurbs, openFilePicker, or, paintAlpha, paintKindOf, paintWithAlpha, paintWithColor, parseColor, parseColorToRgba255, parseDebugFlags, patchBounds, patchCorner, pathContainsPoint, pathContainsPolygon, pathContainsRect, pathDistanceToPoint, pathDivide, pathExclude, pathFromD, pathInPoseFrame, pathInWorld, pathIntersect, pathIntersectsPolygon, pathIntersectsRect, pathOriginProjection, pathPoseDescriptor, pathSubtract, pathToAnchors, pathUnion, pickTopMostHit, pinchZoomAction, planPixelRender, pointInPath, pointInTextPose, poseRotationOf, prefUnit, pressureToWidth, pxExtent, rainbowVertexColors, rebuildOp, rectMarkerPath, registerMarker, registerNodeShape, registerOpFactory, registerPaintKind, registeredOpNames, renderLabel, renderSceneToCanvas, renderSceneToPixels, resizeAction, resolveColor, resolveFillPattern, resolveMarkerSize, resolveOverlays, resolvePatternSpec, resolvePreviews, resolveSkeleton, resolveVisibility, rgbaToHex, rigidRigApply, rotateAction, rotateAroundAABBCenter, rotatePathAround, rotationDegreesUnit, rotationHandle, roundRectPath, roundToCell, runsToDom, sampleGradientStops, sampleTrack, scaleDelta, scalePathToBounds, sceneFromJSON, sceneNodeClientRect, sceneSelectionStore, sceneToAdapter, screenToWorld, seedMeshPatch, selectFromLasso, selectionAtLeast, selectionEmpty, selectionIs, setFlagOverRange, shapeCoversPoint, slewToward, sliceAction, snap, snapPoint, solid, solidVertexColors, spiro, splitPathByLine, splitSubpaths, springPose, springVertexColors, squarePath, staggerVertexColors, startThresholdDrag, strokeInsets, strokeOf, strokeWith, styleAtRange, subscribeImageReady, textCommand, textCommandFromPose, textCommandFromRuns, tileGrid, tiledProject, toHex8, transformPath, translatePath, trimPolyline, tweenPose, tweenVertexColors, unionAABB, unionBounds, unionBoundsPath, unionOfChildren, unionOfChildrenVia, useAlign, useAnimator, useArrayAdapter, useAutoCenter, useBooleans, useBooleansAdapter, useCanvasFocus, useCanvasSize, useDeviceProfile, useDistribute, useDragGesture, useDragHandle, useDragRadial, useDragRect, useDropZone, useEllipseTool, useEyedropperTool, useGridCellHover, useGuides, useHandTool, useHandleDrag, useHostAnchor, useHoverTracking, useImageTool, useKeyState, useKeybindings, useLassoTool, useLineTool, useNodeOverlayFrame, usePenTool, usePencilTool, usePinchGesture, usePointerContext, usePointerStylus, usePolygonTool, usePoseCompositionDepSource, usePoseDescriptorDepSource, usePoseRun, usePublishSelection, useRectTool, useResizePolicy, useRig, useScene, useSceneAdapter, useSceneTextEdit, useSelectTool, useSelection, useSelectionContext, useSimulation, useSliceDep, useStandardActions, useStarTool, useTextEdit, useTextTool, useTools, useVelocityTracker, useVisibleRaf, viewToTransform, viewZoom, viewportDragPanAction, viewportWheelPanAction, viewportZoomAction, viewportsAt, wheelPan, wheelZoom, wheelZoomFactor, when, withAlpha01, withCoord, withGradientKind, withinPxBox, withinPxRadius, worldEditToStorage, worldToScreen, zoomAt, zoomAtLeast };
|
|
12013
|
+
export { ACTION_GLYPHS, ANCHOR_HIT_BASE_PX, AREA_SELECT_ID, type ActionGlyphProps, type ActionShortcut, ActionsProviderIfRoot, Affordance, AffordanceBinding, AffordanceRegion, type AffordanceRegionHit, type AlignAdapter, type AlignAnchor, AlignBottomIcon, AlignCenterXIcon, AlignCenterYIcon, type AlignEdge, AlignLeftIcon, type AlignMatchResult, type AlignMoveArgs, AlignRightIcon, AlignTopIcon, type AlignmentBehaviorBase, type AnchorHit, type AnchorScratch, type AnchorState, type AnimateOnSetPoseOptions, AnimationHandle, Animator, AnyTool, AreaSelectAdapter, type ArrayAdapter, type ArrayAdapterConfig, ArrowIcon, BUILTIN_MARKERS, BUILTIN_TOOL_IDS, type BakedMesh, type BindRigOptions, BooleansAdapter, BoundsConstraint, BringForwardIcon, BringToFrontIcon, type BuildChromeCtxArgs, type BuiltinShapeToolId, type BuiltinToolId, type BuiltinToolOptions, CROSSHAIR_HALO, CURVE_REPS, type CanvasExtensionApi, type CanvasFocusReturn, type CanvasHelpers, type CanvasProps, type CanvasSelectionMode, type CanvasSize, type CanvasSizeSnapshot, type CanvasSurfaceHelpers, CanvasView, type CanvasViewHandle, type CanvasViewHelpers, type CanvasViewProps, type CellHighlightLayerOpts, type ChromeCtx, type ChromeId, ChromeState, type ClampBounds, ClipboardSnapshot, type CoalescedCtx, type ColorInterpolate, ColorOverrideRegistry, CommonAffordanceScratch, type ComposeSelectionPoseOpts, type ComputeFitViewOptions, type Condition, ContentHandlerEntry, Contribution, type ContributionDepReader, CopyIcon, type CornerResizeAffordanceOptions, type CornerResizeScratch, type CreateChildrenLayerOpts, type CreateParallaxLayerOpts, type CreatePathEditingOverlayLayerOptions, type CreatePathLayerOpts, type CreatePenPreviewLayerOptions, type CreateTextLayerOpts, type CreateTiledLayerOpts, type CreateViewResolverOpts, type CreateViewportLayerOpts, CropIcon, type CrosshairRect, CursorCoordsHud, type CursorCoordsHudProps, type CurveRepKind, type CurveRepresentation, type CustomLayerEntry, CutIcon, type CycleHandle, type CycleVertexColorsOptions, DEFAULT_DEBUG_STROKES, DEFAULT_DEBUG_THEME, DEFAULT_FILL_COLOR, DEFAULT_GUIDE_TOLERANCE_PX, DEFAULT_HANDLE_SIZE, DEFAULT_MAX_ZOOM, DEFAULT_MIN_ZOOM, DEFAULT_PALETTE, DEFAULT_ROTATION_HANDLE_DISTANCE, DEFAULT_SHAPE_FILL, DEFAULT_STROKE_COLOR, DRAG_PAN_ID, type DebugConfig, type DebugFeature, type DebugSnapshot, type DebugStroke, type DebugStrokes, type DebugTheme, type DefaultTextData, DeleteIcon, DepRegistryProviderIfRoot, type DeriveAlignmentGuidesOptions, DerivedDep, DeviceProfileProvider, type DeviceProfileProviderProps, Dims, type Discriminator, type DistributeAdapter, type DistributeAxis, DistributeHorizontalIcon, type DistributeMode, DistributeVerticalIcon, DivideIcon, type DragGestureController, type DragGestureCtx, type DragGestureEndCtx, type DragGesturePhase, type DragGesturePoint, type DragHandleOptions, type DragPanParams, type DragPayload, type DragRadialController, type DragRadialCtx, type DragRadialEndCtx, type DragRadialPoint, type DragRadialState, type DragRectBounds, type DragRectController, type DragRectCtx, type DragRectEndCtx, type DragRectPoint, DrawCommand, type DropZoneOptions, DuplicateIcon, EasingSpec, EllipseIcon, ExcludeIcon, EyedropperIcon, FALLBACK_FIT_VIEW, FEATURE_ACTION_IDS, type Feature, type FeedDelta, type FeedNode, type FillPoseBox, type FitTextPoseOptions, type FlagKey, FlipXIcon, FlipYIcon, type FreeformOptions, GHOST_STROKE, type GateLayerOptions, GeometryProjection, type GesturePreviewSource, type GestureSource, GlMat3, type GridLayerOpts, type GridSlotConfig, GroupIcon, Guide, type GuideSnapOptions, type GuidesLayerOpts, HANDLE_BASE_PX, HandIcon, InertiaConfig as HandToolInertiaConfig, type HandleDragEnd, type HandleDragPoint, type HeadlessCanvasLike, type HostAnchorAlign, type HostAnchorInput, type HostAnchorOffset, type HostAnchorStyle, IDENTITY_JOINT, type IconProps, ImageIcon, type ImageNodeData, type ImageRasterSize, type ImageStatus, type IndicatorStyle, InertiaConfig, InsertAdapter, InsertBehavior, InsertExtras, type InsertNodeFactory, type InsertOp, type InsertOverlayStyle, type InsertPreviewExtent, type InsertPreviewGeometry, type InsertPreviewLike, type InsertPreviewOverlay, IntersectIcon, type Joint, type JointTransform, KIT_SHAPE_KINDS, KIT_STANDARD_ACTION_IDS, type KeyModifiers, type KeyState, type KeyStateAttachOptions, type LabelOptions, LassoHitMode, LassoIcon, LassoSelectAdapter, LassoSelectBehavior, LayerEnumerableAdapter, LayerGroup, LayerHit, type LayerSlotValue, type LayersMap, LayoutDropTargetMode, LayoutSnap, LayoutStrategy, type LifecycleAnimation, LineIcon, type LinePoint, type LinkedCursorOptions, MESH_BAKE_SIZE, MESH_GRADIENT_KIND, MINIMAP_CENTER, MINIMAP_PAN, MIXED, MOVE_ANCHORS, type MarkerCtx, type MarkerEntry, type MarkerPaint, type MarkerSite, type MarkerSiteRequest, type MeshGradientFill, type MeshPatch, type MeshPoint, MinimapCanvas, type MinimapCanvasProps, type MinimapContributionOptions, type MinimapFit, type Mixed, type MomentumOptions, MoveAdapter, MoveBehavior, type NestedHitOpts, type NestedHitTester, type NodeClientRect, type NodeInk, type NodeInkCtx, type NodeOverlayFrame, type NodePaintCtx, type NodeProperties, type NodePropertiesEntry, type NodeRouting, type NodeRoutingEntry, type NodeShapeEntry, type NodeSilhouetteCtx, type OpFactory, type OpenFilePickerOptions, OrderedAdapter, OriginProjection, type OverlayPoint, type OverlayVisibilityId, PAINTED_CURSOR_LAYER_ID, PATH_ANCHOR_CHROME_ID, type PaintBindContext, type PaintKind, type PaintKindEditorProps, type PaintKindEntry, type PaintProgram, PanBounds, type ParallaxOpts, PasteIcon, Path, type PathAnchor, type PathAnchorAffordanceOptions, PathBuilder, PathDrawCommand, type PathEditingOverlayStyle, type PathInWorldPose, type PenAnchor, PenIcon, type PenPreviewStyle, type PenScratch, type PenSubpath, PencilIcon, type PencilPoint, PickHud, type PickHudProps, type PickTopMostHitAdapter, type PinchZoomOptions, type PixelRenderPlan, type PointInPathOptions, type PointInTextPoseOpts, PointSnapBehavior, PointerProviderIfRoot, type PointerSample, type PointerStylusState, PolygonIcon, PolygonPath, type PolygonPoint, type Pose, PoseComposition, PoseDescriptor, type PoseFeed, PoseOverrides, type PoseRotation, type PoseRun, type PoseRunCtx, type PoseRunStep, type PoseSource, type PosedNode, type PressureToWidthOptions, type PreviewNode, ROTATION_HANDLE_BASE_PX, type RangeStyle, type RasterImage, type RecordedBounds, type RecordedHandle, type RecordedHitbox, type RecordedLayer, type RecordedOrigin, type RecordedSnap, RectIcon, RectPath, RectPose, RedoIcon, RedrawSource, type RegisterNodeShapeOptions, RegisteredOp, RenderLayer, type RenderSceneToCanvasArgs, type RenderSceneToPixelsArgs, type ReorderDirection, ResizeAdapter, type ResolvableView, type ResolvedOverlay, type Rig, type RigApply, type RigApplyContext, type RigScene, RotateAdapter, RotateBehavior, RotatedPose, type RotationAffordanceOptions, type RotationHandle, type RotationScratch, type RunStylePatch, SCENE_CANVAS_FEATURES, SELECTION_MOVE_ID, SELECTION_TRANSFORM_ID, SampledTrack, type ScalarOrXY, Scene, SceneAdapter, type SceneAdapterSelection, SceneCanvas, type SceneCanvasAdapter, type SceneCanvasApi, type SceneCanvasHit, type SceneCanvasLayers, type SceneCanvasProps, Node$1 as SceneNode, type SceneNodeClientRectOpts, SceneRegistry, type SceneSlotConfig, type SceneToAdapterOptions, SceneViewCanvas, type SceneViewCanvasProps, type SceneViewDrawOne, type SceneViewLayers, type SelectAdapter, type SelectFromLassoOptions, SelectIcon, SelectionContextProvider, SelectionContextProviderIfRoot, type SelectionContextValue, type SelectionHandleStyle, type SelectionHandlesLayerOpts, type SelectionMoveOptions, type SelectionOutlineLayerOpts, type SelectionOverlayLayerOpts, type SelectionOverlaySlotConfig, type SelectionTransformOptions, SendBackwardIcon, SendToBackIcon, SerializedScene, type SetFlagResult, type SetPathFields, ShaderProgramHandle, type ShapeCoversPointOptions, type ShapeKind, type SharedAnchor, Simulation, SimulationNode, type Skeleton, type Slew, type SlewRates, SliceDep, type SnapPattern, type SnapPointOptions, SnapStrategy, type SplitBySegmentOptions, type SpringPoseOptions, SpringPresetName, type SpringVertexColorsOptions, type StaggerVertexColorsOptions, type StandardSlotConfig, type StandardSlotName, StarIcon, type StarPoint, type StartEditOptions, type StyleKey, type StylusData, SubtractIcon, type SurfaceContribution, SvgIngestOptions, TOOL_DRIVEN_ACTION_IDS, TOOL_PREF_KINDS, TextDrawCommand, type TextEditClipRect, type TextEditScreenPose, type TextEditSelection, TextIcon, type ThresholdDragHandle, type ThresholdDragOptions, type TileBleed, type TileGridOptions, type TilePatternOpts, type TilePeriod, type TileRange, Tool, type ToolPref, type ToolPrefBoolean, type ToolPrefBooleanControl, type ToolPrefBooleanEncoding, type ToolPrefColor, type ToolPrefCustom, type ToolPrefEnum, type ToolPrefEnumControl, type ToolPrefEnumEncoding, type ToolPrefGroup, type ToolPrefKind, type ToolPrefLeaf, type ToolPrefNumber, type ToolPrefNumberControl, type ToolPrefNumberUnit, type ToolPrefObject, type ToolPrefPaint, type ToolPrefString, type ToolPrefStringControl, ToolsApi, type TweenPoseOptions, type TweenVertexColorsOptions, UNION_OF_CHILDREN, UndoIcon, UngroupIcon, UnionIcon, UnknownIcon, type UseAlignOptions, type UseAlignReturn, UseAnimatorOptions, type UseArrayAdapterOptions, type UseBooleansOptions, type UseBooleansReturn, type UseCanvasFocusOptions, type UseDistributeOptions, type UseDistributeReturn, type UseDragGestureOptions, type UseDragRadialOptions, type UseDragRectOptions, type UseEyedropperToolOptions, type UseGridCellHoverOptions, type UseGridCellHoverReturn, type UseGuidesReturn, type UseHandToolOptions, type UseHandleDragOptions, type UseHandleDragReturn, type UseHostAnchorOptions, type UseHoverTrackingArgs, type UseImageToolOptions, type UseKeyStateOptions, type UseKeybindingsOptions, type UseLassoSelectOptions, type UseLassoToolOptions, UseMoveOptions, type UseNodeOverlayFrameOptions, type UsePenToolOptions, type UsePointerStylusOptions, type UsePolygonToolOptions, type UsePoseRunOptions, UseResizeOptions, type UseResizePolicyOptions, type UseRotateOptions, UseSceneOptions, type UseSceneTextEditOptions, type UseSceneTextEditReturn, type UseSceneTrivialOptions, type UseSelectToolOptions, type UseSelectionOptions, UseSimulationOptions, type UseStandardActionsOptions, type UseStarToolOptions, type UseTextEditOptions, type UseTextEditReturn, VERSION, type VelocityTracker, VertexColorChannel, ViewAnimationOptions, ViewApi, type ViewRect, type ViewResolver, type ViewTarget, type ViewTransform, ViewportDims, type ViewportLayer, type ViewportZoomAnimateOptions, type ViewportZoomOptions, type VisibilityRules, type VisibleRaf, type VisibleRafOptions, type VisibleRafTarget, WHEEL_ZOOM_STEP, WeaselProvider, type WheelInput, type WheelPanOptions, type WheelPanOpts, type WorkspaceTintLayerOptions, ZOOM_FLOOR, type ZoomBound, type ZoomClampOpts, type ZoomFactor, _resetMarkersForTests, _resetPaintKindsForTests, actionIs, actionShortcuts, alignDeltaFor, alignInsertBehavior, alignMoveBehavior, alignResizeBehavior, always, and, animateLifecycle, animateOnSetPose, annulusSemiAxes, applyOpsTo, applyStyleToRange, areaSelectAction, areaSelectContribution, arrayAdapter, asPaint, axisAlignedBounds, bakeMesh, bezierCubic, bezierQuadratic, bindRig, blendPoses, boundsOfPath, buildChromeCtx, buildSceneViewCommands, canBringForward, canHover, canSendBackward, capabilityAll, capabilityIn, capabilityIs, capabilityNot, caretIndexAt, cellAt, centerRootOn, charOffsetToDomPosition, circlePath, clampView, clearSelectionAction, clipboardCopyAction, clipboardCutAction, clipboardPasteAction, cloneAction, coarsePointer, composeAffordanceLayer, composePath, composeSelectionPose, computeFitView, computeFitViewport, computeIndicatorCommand, computeWheelAction, cond, constrainTo45, containedThenNearest, cornerWeights, countPathAnchors, createCellHighlightLayer, createChildrenLayer, createCornerResizeAffordance, createDebugOverlayLayer, createDebugSink, createDeleteOp, createGridLayer, createGuidesLayer, createHistory, createInsertOp, createKeyState, createLinkedCursorContribution, createMinimapContribution, createMoveToIndexOp, createNodeProperties, createNodeRouting, createPaintedCursorLayer, createParallaxLayer, createPathAnchorAffordances, createPathEditingOverlayLayer, createPathLayer, createPenPreviewLayer, createPoseFeed, createPoseOverrides, createReorderOp, createReparentOp, createRotationAffordance, createScene, createSelectionHandlesLayer, createSelectionOutlineLayer, createSelectionOverlayLayer, createSetDataOp, createSetLayerOp, createSetPathOp, createSetSelectionOp, createSetTextOp, createSlew, createTextLayer, createTilePattern, createTiledLayer, createTransformOp, createVelocityTracker, createViewResolver, createViewportLayer, crosshairRects, cycleFill, cycleVertexColors, decomposePath, defaultCommitAdapter, defaultDrawOne, defaultLabelTextRenderer, defaultNodeProperties, defaultNodeRouting, defaultVisibilityRules, definesFrame, deriveAlignmentGuides, deriveParallaxView, derivedDepOf, derivedPose, dispatchApplyBatch, dlog, documentPose, domPositionToCharOffset, domToRuns, dragPanContribution, dwarn, editAnchorsAction, effectivePose, effectiveRangeStyle, enterTextEditAction, enumerateAnchors, evalPatch, fillInPoseFrame, fillToBoundsFrame, findNodeShape, findShapeInk, findShapeSilhouette, fitTextPose, fitToBounds, fitZoom, flattenPreviews, focused, forEachCoalesced, freeform, gateLayer, gesturing, getAlpha01, getImageBitmap, getMarker, getNodeShapes, getPaintKind, getStylusData, gradientForBounds, gradientGeometry, guideSnapStrategy, hexToRgba, hitAffordanceRegions, hitAnchor, hitRotationHandle, hostAnchorCss, hostAnchorRect, hovering, hoveringSelected, imageStatus, inferredNodeProperties, inferredNodeRouting, insertAction, insertPreviewExtent, interpolateView, isBuiltinToolPref, isDebugEnabled, isGradientFill, isMeshGradientFill, isPatternSpec, isPlainObject, isTensorPatch, isValidPatch, isVectorImageSrc, keySpecShortcut, lassoSelectAction, listGradientKinds, listMarkers, listPaintKinds, makePinchZoomAction, makeViewportWheelPanAction, makeViewportZoomAction, markerInset, markerKeyOf, markerRegistry, markerSites, matchAlignment, meanScale, mergeAlphaFromPrev, mergeContributions, meshBounds, meshFromStops, meshGradientXml, meshStops, minimapCenterAction, minimapPanAction, modeDecorationLayer, modeIn, modeIs, modeNot, modifierHeld, momentum, moveAction, multiActive, nearest, nearestWithin, nestedHitTester, never, nodeHasFlag, none, normalizeHex, normalizeView, normalizeZoom, not, nurbs, onEmptyCanvas, opFactoryRegistry, openFilePicker, or, paintAlpha, paintKindOf, paintKindRegistry, paintWithAlpha, paintWithColor, parseColor, parseColorToRgba255, parseDebugFlags, patchBounds, patchCorner, pathContainsPoint, pathContainsPolygon, pathContainsRect, pathDistanceToPoint, pathDivide, pathExclude, pathFromD, pathInPoseFrame, pathInWorld, pathIntersect, pathIntersectsPolygon, pathIntersectsRect, pathOriginProjection, pathPoseDescriptor, pathSubtract, pathToAnchors, pathUnion, pickTopMostHit, pinchZoomAction, planPixelRender, pointInPath, pointInTextPose, poseRotationOf, prefUnit, pressureToWidth, pxExtent, rainbowVertexColors, rebuildOp, rectMarkerPath, registerMarker, registerNodeShape, registerOpFactory, registerPaintKind, registeredOpNames, renderLabel, renderSceneToCanvas, renderSceneToPixels, resizeAction, resolveColor, resolveFillPattern, resolveMarkerSize, resolveOverlays, resolvePatternSpec, resolvePreviews, resolveSkeleton, resolveVisibility, rgbaToHex, rigidRigApply, rotateAction, rotateAroundAABBCenter, rotatePathAround, rotationDegreesUnit, rotationHandle, roundRectPath, roundToCell, runsToDom, sampleGradientStops, sampleTrack, scaleDelta, scalePathToBounds, sceneFromJSON, sceneNodeClientRect, sceneSelectionStore, sceneToAdapter, screenToWorld, seedMeshPatch, selectFromLasso, selectionAtLeast, selectionEmpty, selectionIs, selectionMoveBindings, selectionMoveContribution, selectionTransformBindings, selectionTransformContribution, setFlagOverRange, shapeCoversPoint, slewToward, sliceAction, snap, snapPoint, solid, solidVertexColors, spiro, splitPathBySegment, splitSubpaths, springPose, springVertexColors, squarePath, staggerVertexColors, startThresholdDrag, strokeInsets, strokeOf, strokeWith, styleAtRange, subscribeImageReady, switchGradientKind, textCommand, textCommandFromPose, textCommandFromRuns, tileGrid, tiledProject, toHex8, transformPath, translatePath, trimPolyline, tweenPose, tweenVertexColors, unionAABB, unionBounds, unionBoundsPath, unionOfChildren, unionOfChildrenVia, useAlign, useAnimator, useArrayAdapter, useAutoCenter, useBooleans, useBooleansAdapter, useCanvasFocus, useCanvasSize, useDeviceProfile, useDistribute, useDragGesture, useDragHandle, useDragRadial, useDragRect, useDropZone, useEllipseTool, useEyedropperTool, useGridCellHover, useGuides, useHandTool, useHandleDrag, useHostAnchor, useHoverTracking, useImageTool, useKeyState, useKeybindings, useLassoTool, useLineTool, useNodeOverlayFrame, usePenTool, usePencilTool, usePointerStylus, usePolygonTool, usePoseCompositionDepSource, usePoseDescriptorDepSource, usePoseRun, usePublishSelection, useRectTool, useResizePolicy, useRig, useScene, useSceneAdapter, useSceneTextEdit, useSelectTool, useSelection, useSelectionContext, useSimulation, useSliceDep, useStandardActions, useStarTool, useTextEdit, useTextTool, useVelocityTracker, useVisibleRaf, viewToTransform, viewZoom, viewportDragPanAction, viewportWheelPanAction, viewportZoomAction, viewportsAt, wheelPan, wheelZoom, wheelZoomFactor, when, withAlpha01, withCoord, withGradientKind, withinPxBox, withinPxRadius, workspaceTintLayer, worldEditToStorage, worldToScreen, zoomAt, zoomAtLeast };
|