@weasel-js/core 1.5.0 → 1.5.2
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 +501 -0
- package/dist/autoPoseDescriptor-Dr6CwNZK.d.ts +26 -0
- package/dist/{chunk-BDWAA634.js → chunk-44EWMJV2.js} +3 -3
- package/dist/{chunk-BDWAA634.js.map → chunk-44EWMJV2.js.map} +1 -1
- package/dist/{chunk-MQI4PIX3.js → chunk-H6N2JSZ3.js} +3 -3
- package/dist/{chunk-MQI4PIX3.js.map → chunk-H6N2JSZ3.js.map} +1 -1
- package/dist/chunk-HPFJUUTF.js +167 -0
- package/dist/chunk-HPFJUUTF.js.map +1 -0
- package/dist/{chunk-UCPV7JXC.js → chunk-L5YNZYEG.js} +9 -169
- package/dist/chunk-L5YNZYEG.js.map +1 -0
- package/dist/chunk-PNNZSYRD.js +318 -0
- package/dist/chunk-PNNZSYRD.js.map +1 -0
- package/dist/{chunk-MG7OXCAI.js → chunk-QEZL53V6.js} +2493 -1580
- package/dist/chunk-QEZL53V6.js.map +1 -0
- package/dist/clipboard.d.ts +1 -1
- package/dist/clone.d.ts +2 -2
- package/dist/{depSchema-nMqj_qTM.d.ts → depSchema-FKQBEfg7.d.ts} +116 -125
- package/dist/{grid-BrIa38gG.d.ts → grid-CuxXjaQV.d.ts} +22 -6
- package/dist/index.d.ts +780 -408
- package/dist/index.js +6 -4
- package/dist/insert.d.ts +3 -3
- package/dist/insert.js +2 -1
- package/dist/insert.js.map +1 -1
- package/dist/math-CeGmGPy8.d.ts +267 -0
- package/dist/math.d.ts +5 -0
- package/dist/math.js +4 -0
- package/dist/math.js.map +1 -0
- package/dist/move.d.ts +4 -4
- package/dist/move.js +3 -2
- package/dist/move.js.map +1 -1
- package/dist/{options-BDyCnrp8.d.ts → options-BPcmwYk7.d.ts} +1 -1
- package/dist/{autoPoseDescriptor-CvjflWJK.d.ts → pointSnapToGrid-CgcK2R_I.d.ts} +2 -26
- package/dist/{poseDescriptor-CGOgIgf8.d.ts → poseDescriptor-PgfVKfa0.d.ts} +1 -1
- package/dist/renderer.d.ts +7 -8
- package/dist/renderer.js +6 -4
- package/dist/resize.d.ts +5 -4
- package/dist/resize.js +3 -2
- package/dist/{types-DMyo7dnM.d.ts → types-BHGdrOcu.d.ts} +1 -1
- package/dist/{types-DtjCJA5r.d.ts → types-BdaK9PcP.d.ts} +1 -1
- package/package.json +14 -10
- package/dist/chunk-MG7OXCAI.js.map +0 -1
- package/dist/chunk-UCPV7JXC.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,40 +1,43 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { RefObject, ReactNode, Ref, MouseEvent, ComponentType
|
|
3
|
-
import { a as UnitValue, b as UnitSystem, c as Unit, U as UseMoveOptions, O as OriginProjection } from './grid-
|
|
4
|
-
export { A as ANGLE_RADIANS, I as IMPERIAL_INCHES, M as METRIC_MM, P as PIXELS, R as RECT_ORIGIN_PROJECTION, f as formatUnit, g as gridSnapStrategy, p as pointToGridCell, r as resolveUnit } from './grid-
|
|
5
|
-
import { View, NodeId, Bounds, ModifierState, PointerSessionCancelReason, DeviceProfile, Action, SelectionMode, SelectionExtendKey, SelectionApi, DepSchema, AnyToolOf, Contribution as Contribution$1, ContributionChrome as ContributionChrome$1, Tool as Tool$1, ToolDef as ToolDef$1, ViewportToolDef as ViewportToolDef$1, HitShape, HandleKind, DebugSink, ToolKeybinding, HotkeyTrigger, RuleCtx, Rule, IngestItem, OngoingOverlay, ActionsProp, OverlayRole, ResizeAnchor } from '@weasel-js/routing';
|
|
6
|
-
export { ALWAYS, Action, ActionDeps, ActionDisabledReason, ActionDispatch, ActionEnabledResult, ActionEntry, ActionPresentation, ActionsProp, ActionsRegistry, AffordanceHit, BindingOpts, BindingScope, BindingSource, BoundGesture, Bounds, BuildRuleCtxArgs, COARSE_TARGET_SCALE, ContributionRouting, DEFAULT_ALLOWED_CAPABILITIES, DEFAULT_DEVICE_PROFILE, DebugSink, DepName, DepSchema, DetectedDeviceFacts, DeviceProfile, Dispatcher, DispatcherContext, DragSample, Eligibility, EligibilityState, GestureBinding, HandleKind, HitShape, HotkeyTrigger, ImmediateInvoker, IngestItem, InputEvent, InvocationCtx, Invoker, MatchResult, 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, ToolModifiers, ToolPresentation, ToolSlot, UiOngoingControl, View, actionBindings, buildRuleCtx, clientToCanvas, createDispatcher, deleteScratch, describeRule, evaluate, evaluateEnabled, getScratch, isEditableTarget, liveScope, matchesKeyBinding, mergeContributions, openPointerSession, resolveDeviceProfile, resolveParams, scopeBindings, scratchKey, setScratch, specificity } from '@weasel-js/routing';
|
|
7
|
-
import { FillStyle, Stroke, TextureHandle, TilePatternSpec, GradientKind, GradStop, GradientFill,
|
|
8
|
-
export { FillStyle, GradStop, GradientFill, GradientKind, GradientUnits, KitMarkerKey, MarkerKey, MarkerRef, Region, STROKE_DASH_RATIOS, Stroke, StrokeAlign, StrokeDashStyle, TextureHandle, TilePatternSpec, alignedStrokeRect, dashForStrokeStyle, strokeDashStyleOf } from '@weasel-js/paint';
|
|
9
|
-
import { D as DrawCommand, E as Effect,
|
|
10
|
-
export {
|
|
2
|
+
import React__default, { RefObject, ReactNode, Ref, MutableRefObject, MouseEvent, ComponentType } from 'react';
|
|
3
|
+
import { a as UnitValue, b as UnitSystem, c as UnitEntry, d as Unit, U as UseMoveOptions, O as OriginProjection } from './grid-CuxXjaQV.js';
|
|
4
|
+
export { A as ANGLE_RADIANS, I as IMPERIAL_INCHES, M as METRIC_MM, P as PIXELS, R as RECT_ORIGIN_PROJECTION, e as UnitScale, f as formatUnit, g as gridSnapStrategy, p as pointToGridCell, r as resolveUnit, u as unitScale } from './grid-CuxXjaQV.js';
|
|
5
|
+
import { View, NodeId, Bounds, ModifierState, PointerSessionCancelReason, DeviceProfile, Action, SelectionMode, SelectionExtendKey, SelectionApi, DepSchema, AnyToolOf, Contribution as Contribution$1, ContributionChrome as ContributionChrome$1, Tool as Tool$1, ToolDef as ToolDef$1, ViewportToolDef as ViewportToolDef$1, HitShape, HandleKind, DebugSink, ToolKeybinding, HotkeyTrigger, RuleCtx, Rule, IngestItem, OngoingOverlay, ActionsProp, OverlayRole, ResizeAnchor, Point2 } from '@weasel-js/routing';
|
|
6
|
+
export { ALWAYS, Action, ActionDeps, ActionDisabledReason, ActionDispatch, ActionEnabledResult, ActionEntry, ActionPresentation, ActionsProp, ActionsRegistry, AffordanceHit, BindingOpts, BindingScope, BindingSource, BoundGesture, Bounds, BuildRuleCtxArgs, COARSE_TARGET_SCALE, ContributionRouting, DEFAULT_ALLOWED_CAPABILITIES, DEFAULT_DEVICE_PROFILE, DebugSink, DepName, DepSchema, DetectedDeviceFacts, DeviceProfile, Dispatcher, DispatcherContext, DragSample, Eligibility, EligibilityState, GestureBinding, HandleKind, HitShape, HotkeyTrigger, ImmediateInvoker, IngestItem, InputEvent, InvocationCtx, Invoker, MatchResult, 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, ToolModifiers, ToolPresentation, ToolSlot, UiOngoingControl, Point2 as Vec2, View, actionBindings, buildRuleCtx, clientToCanvas, createDispatcher, deleteScratch, describeRule, evaluate, evaluateEnabled, getScratch, isEditableTarget, liveScope, matchesKeyBinding, mergeContributions, openPointerSession, resolveDeviceProfile, resolveParams, scopeBindings, scratchKey, setScratch, specificity } from '@weasel-js/routing';
|
|
7
|
+
import { FillStyle, Stroke, TextureHandle, GradientUnits, ColorSpace, TilePatternSpec, GradientKind, GradStop, GradientFill, MarkerKey, MarkerRef } from '@weasel-js/paint';
|
|
8
|
+
export { ColorSpace, FillStyle, GradStop, GradientFill, GradientKind, GradientUnits, KitMarkerKey, MarkerKey, MarkerRef, OklchDeg, Region, STROKE_DASH_RATIOS, ScreenLength, Stroke, StrokeAlign, StrokeDashStyle, TextureHandle, TilePatternSpec, alignedStrokeRect, dashForStrokeStyle, hexToOklchDeg, lerpColorArray, lerpOklab, lerpOklch, oklabToOklch, oklabToSrgbU8, oklchDegToHex, oklchToOklab, resolveScreenLength, srgbFloatToOklab, srgbU8ToOklab, strokeDashStyleOf } from '@weasel-js/paint';
|
|
9
|
+
import { D as DrawCommand, E as Effect, w as Scene, x as RectPose, y as InertiaConfig, V as ViewAnimationOptions, N as Node$1, z as PoseComposition, A as SliceDep, B as VertexColorChannel, f as ShaderProgramHandle, F as InsertExtras, H as SerializedScene, J as GeometryProjection, K as ContentHandlerEntry, L as SvgIngestOptions, O as PanBounds, Q as Animator, U as ColorOverrideRegistry, X as UseSceneOptions, Y as SceneRegistry, Z as RegisteredOp, _ as PoseOverrides, $ as DerivedDep, a0 as ViewportDims, P as PathDrawCommand, T as TextDrawCommand, a1 as ShaderProgram, G as GlMat3, a2 as BooleansAdapter, a3 as UseAnimatorOptions, a4 as SpringPresetName, a5 as EasingSpec, a6 as AnimationHandle, a7 as SampledTrack } from './depSchema-FKQBEfg7.js';
|
|
10
|
+
export { a8 as AddLayerSpec, a9 as AddNodeSpec, aa as AnimateToBoundsOptions, ab as AreaSelectDep, ac as BezierEasing, ad as BooleanOp, ae as BooleanOpResult, af as ClipboardDep, ag as ClipboardIngestCtx, ah as ColorOverride, ai as ColorOverrideFn, aj as ContainerNode, C as CullRect, ak as DecayLoopConfig, al as DecayOptions, am as EASINGS, an as EasingFn, ao as EasingName, ap as EditAnchorsDep, aq as EventBooking, ar as EventBookingHandle, as as EventTrack, at as FitViewToBoundsOptions, a as GroupDrawCommand, au as IDENTITY_POSE_COMPOSITION, b as ImageDrawCommand, c as ImageMinification, av as IngestCtx, aw as IngestionDep, ax as InsertDep, ay as Interpolate, az as InterpolatorFactory, aA as Keyframe, aB as LassoSelectDep, aC as LayerRecord, aD as LayoutDep, aE as LeafNode, aF as LoopFactory, aG as LoopOptions, aH as NestedTimeline, aI as NodeAtPointDep, aJ as PhysicsHandle, aK as PhysicsOptions, aL as PoseAdapter, aM as PoseClosure, aN as PoseOverride, aO as RECT_POSE_COMPOSITION, aP as RIGID_POSE_COMPOSITION, R as RenderTarget, aQ as ResizePolicy, aR as SPRING_PRESETS, S as SPRITE_STRIDE, aS as SerializedNode, e as ShaderDrawCommand, g as ShaderUniform, aT as SnapDep, aU as SpringOptions, aV as SpringPreset, i as SpriteSheet, j as SpritesDrawCommand, aW as StaggerBuilder, aX as StaggerDelay, aY as StaggerFactory, aZ as StaggerOptions, a_ as StaggerPerItem, a$ as StaggerSpringPoseOptions, b0 as StaggerTweenOptions, b1 as SvgUnpacker, b2 as SystemLayerRecord, b3 as SystemLayerSpec, b4 as TextEditDep, b5 as TimelineClock, b6 as TimelineEvent, b7 as TimelineHandle, b8 as TimelineOptions, b9 as TimelineTrack, ba as Track, bb as TweenLoopOptions, bc as TweenOptions, bd as UserLayerRecord, be as VIEW_ANIMATION_KEY, bf as ViewAnimationApi, bg as ViewApi, bh as ViewChannel, bi as applyBooleanOp, bj as asNodeId, m as blur, bk as composeRectPose, bl as composeRigidPose, bm as composeWorldPose, bn as cubicBezierEasing, o as cullDrawCommands, bo as decomposeRectPose, bp as decomposeRigidPose, bq as easeIn, br as easeInBack, bs as easeInBounce, bt as easeInCirc, bu as easeInCubic, bv as easeInElastic, bw as easeInExpo, bx as easeInOut, by as easeInOutBack, bz as easeInOutBounce, bA as easeInOutCirc, bB as easeInOutCubic, bC as easeInOutElastic, bD as easeInOutExpo, bE as easeInOutQuad, bF as easeInOutQuart, bG as easeInOutQuint, bH as easeInOutSine, bI as easeInQuad, bJ as easeInQuart, bK as easeInQuint, bL as easeInSine, bM as easeOut, bN as easeOutBack, bO as easeOutBounce, bP as easeOutCirc, bQ as easeOutCubic, bR as easeOutElastic, bS as easeOutExpo, bT as easeOutQuad, bU as easeOutQuart, bV as easeOutQuint, bW as easeOutSine, bX as fitViewToBounds, p as frameRect, bY as linear, q as mat3, bZ as rebaseLocalPose, b_ as registerContentHandler, r as registerEffect, b$ as resolveEasing, c0 as resolveStrokeWidth, c1 as translateRectPose, c2 as useDecayLoop, c3 as useViewAnimation, c4 as useViewAnimationOn, v as viewToMat3, u as vignette, c5 as worldPoseLookup } from './depSchema-FKQBEfg7.js';
|
|
11
11
|
import { CursorSpec, PaintedCursorState } from '@weasel-js/cursor';
|
|
12
12
|
export { BakeOptions, CursorGlyph, CursorGlyphName, CursorGlyphSpec, CursorSpec, PaintedCursor, PaintedCursorFrame, PaintedCursorState, ResolvedCursor, bakeCursor, createPaintedCursorState, cursorFor, resolveCursor, resolveCursorTier } from '@weasel-js/cursor';
|
|
13
13
|
import { ClaimableGesture, GestureSpec } from '@weasel-js/gestures';
|
|
14
14
|
export { ClaimableGesture, ClickSpec, DragSpec, DropSpec, GestureSpec, KeyHeldSpec, KeySpec, ModSpec, MultiTouchSpec, PasteSpec, TargetSpec, WheelSpec } from '@weasel-js/gestures';
|
|
15
|
+
import { S as SimulationNode, U as UseSimulationOptions, a as Simulation, P as PathBuilder } from './math-CeGmGPy8.js';
|
|
16
|
+
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-CeGmGPy8.js';
|
|
15
17
|
import { ToolsApi as ToolsApi$1, UseToolsOptions as UseToolsOptions$1 } from '@weasel-js/routing/react';
|
|
16
|
-
export { ActionsProvider, ActionsScope, ActiveToolContextProvider, ActiveToolContextProviderIfRoot, ActiveToolContextProviderProps, ActiveToolContextValue, DepRegistry, DepRegistryProvider, UseGestureDispatcherOptions, useAction, useActionsRegistry, useActiveToolContext, useDepRegistry, useDepSource, useGestureDispatcher, useOptionalActiveToolContext, useOptionalDepRegistry } from '@weasel-js/routing/react';
|
|
17
|
-
import { B as BoundsConstraint, P as PointSnapBehavior, L as LassoSelectBehavior, R as RotateBehavior, S as SnapStrategy, M as MoveBehavior, I as InsertBehavior } from './types-
|
|
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-
|
|
19
|
-
import { P as PoseDescriptor, c as PolygonPath, a as Path, d as RotatedPose, e as
|
|
20
|
-
export { R as RECT_POSE_DESCRIPTOR, b as ROTATED_POSE_DESCRIPTOR, p as poseDescriptorForNode, t as translatePoseViaDescriptor, v as visualBoundsViaDescriptor } from './poseDescriptor-
|
|
21
|
-
import { U as UseResizeOptions } from './
|
|
22
|
-
export {
|
|
23
|
-
import { M as MoveAdapter, A as AreaSelectAdapter,
|
|
24
|
-
export { g as ContainerBounds, D as DropTarget, h as LayoutChild, i as LayoutContainer, j as LayoutDragged, S as SnapTarget } from './types-
|
|
18
|
+
export { ActionsProvider, ActionsScope, ActiveToolContextProvider, ActiveToolContextProviderIfRoot, ActiveToolContextProviderProps, ActiveToolContextValue, DepRegistry, DepRegistryProvider, DispatcherChannels, UseGestureDispatcherOptions, useAction, useActionsRegistry, useActiveToolContext, useDepRegistry, useDepSource, useGestureDispatcher, 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-BHGdrOcu.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-BHGdrOcu.js';
|
|
21
|
+
import { P as PoseDescriptor, c as PolygonPath, a as Path, d as RotatedPose, e as RectPath } from './poseDescriptor-PgfVKfa0.js';
|
|
22
|
+
export { f as PathFillRule, R as RECT_POSE_DESCRIPTOR, b as ROTATED_POSE_DESCRIPTOR, p as poseDescriptorForNode, t as translatePoseViaDescriptor, v as visualBoundsViaDescriptor } from './poseDescriptor-PgfVKfa0.js';
|
|
23
|
+
import { U as UseResizeOptions } from './pointSnapToGrid-CgcK2R_I.js';
|
|
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-CgcK2R_I.js';
|
|
25
|
+
import { M as MoveAdapter, A as AreaSelectAdapter, b as LassoHitMode, c as LassoSelectAdapter, R as ResizeAdapter, d as RotateAdapter, L as LayoutStrategy, e as LayerEnumerableAdapter, I as InsertAdapter, C as ClipboardSnapshot, O as OrderedAdapter, a as SceneAdapter, f as LayoutSnap } from './types-BdaK9PcP.js';
|
|
26
|
+
export { g as ContainerBounds, D as DropTarget, h as LayoutChild, i as LayoutContainer, j as LayoutDragged, S as SnapTarget } from './types-BdaK9PcP.js';
|
|
25
27
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
26
28
|
import { Op, HistorySelection, CreateHistoryOptions, History } from '@weasel-js/history';
|
|
27
29
|
export * from '@weasel-js/history';
|
|
28
30
|
export { Op } from '@weasel-js/history';
|
|
29
31
|
import { PlacementAlign, Rect, Mat3 } from '@weasel-js/geom';
|
|
30
32
|
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';
|
|
31
|
-
import { TextRenderer, TextPose, StyledRun, TextStyle,
|
|
33
|
+
import { TextRenderer, TextPose, StyledRun, TextStyle, TextVerticalAlign, TextPaint } from '@weasel-js/text';
|
|
32
34
|
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, SCRIPT_METRICS, StyledRun, TextAlign, TextDirection, TextLineBoxesOpts, TextPaint, TextPose, TextPoseLayout, TextPoseLayoutInput, TextRenderer, TextStyle, TextVerticalAlign, cachedLayoutRuns, createMarkdownRenderer, fontString, layoutMarkdown, layoutRuns, layoutTextPose, markdownToRuns, measureText, measureTextBounds, measuredWidth, resolveAlign, resolveRuns, resolveTextStyle, runsToMarkdown, runsToPlainText, textLineBoxes, textPoseLayoutInput, toRuns, verticalAlignOffset } from '@weasel-js/text';
|
|
33
35
|
import { G as Guide } from './types-D2tTKEU0.js';
|
|
34
|
-
export {
|
|
36
|
+
export { A as AUTO_POSE_DESCRIPTOR, i as isPathLike, a as isRectPose } from './autoPoseDescriptor-Dr6CwNZK.js';
|
|
37
|
+
export { U as UseInsertOptions } from './options-BPcmwYk7.js';
|
|
35
38
|
export { UseClipboardOpsOptions, UseClipboardOpsReturn, WEASEL_CLIPBOARD_MIME, WEASEL_CLIPBOARD_MIME_WEB, buildWeaselClipboardText, embedWeaselMetadataInSvg, extractWeaselClipboardFromSvg, parseWeaselClipboardText, sniffWeaselClipboardText, useClipboardOps } from './clipboard.js';
|
|
36
39
|
export { cloneByAltDrag } from './clone.js';
|
|
37
|
-
export { FontVariant, LocalFontOutlinesResult,
|
|
40
|
+
export { FontStyle, FontVariant, LocalFontOutlinesResult, OutlineSource, OutlineStatus, OutlineVariant, canQueryLocalFonts, enableLocalFontOutlines, hasFontOutlines, isCanvasFont, listFontOutlines, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, subscribeGlyphReady, unregisterCanvasFont, unregisterFontOutlines } from '@weasel-js/font';
|
|
38
41
|
|
|
39
42
|
/**
|
|
40
43
|
* The kit version a build was compiled from, so an app can report what it is
|
|
@@ -464,7 +467,15 @@ interface LayerDrawFailure {
|
|
|
464
467
|
interface LayerGroup {
|
|
465
468
|
/** Names the group in warnings; not a layer id and never drawn. */
|
|
466
469
|
id: string;
|
|
467
|
-
/**
|
|
470
|
+
/**
|
|
471
|
+
* Member layer ids. Order here is ignored — the render order decides.
|
|
472
|
+
*
|
|
473
|
+
* A name claims that layer and every layer under it in the `:` namespace, so
|
|
474
|
+
* `'scene'` covers the `scene:<layerId>` layers a scene with declared layers
|
|
475
|
+
* draws as — the same set `before`/`after: 'scene'` anchors against. The
|
|
476
|
+
* separator is required: `'scene'` does not reach `scenery`. A name matching
|
|
477
|
+
* no layer being drawn is warned about rather than ignored.
|
|
478
|
+
*/
|
|
468
479
|
layers: readonly string[];
|
|
469
480
|
/**
|
|
470
481
|
* Passes over the group's combined pixels, in order. A thunk is re-read on
|
|
@@ -989,128 +1000,87 @@ interface CreateParallaxLayerOpts<TData> extends ParallaxOpts {
|
|
|
989
1000
|
declare function createParallaxLayer<TData>(opts: CreateParallaxLayerOpts<TData>): RenderLayer<TData>;
|
|
990
1001
|
|
|
991
1002
|
/**
|
|
992
|
-
*
|
|
993
|
-
*
|
|
1003
|
+
* Which copies of a periodic lattice a visible range touches.
|
|
1004
|
+
*
|
|
1005
|
+
* A tiled layer's content is authored once, in the cell `[0, period)`, and the
|
|
1006
|
+
* lattice repeats it at every multiple of `period`. This answers the only
|
|
1007
|
+
* question drawing it needs: the integer copies `k` whose cell overlaps
|
|
1008
|
+
* `[visStart, visEnd]`. Copy `k` draws the authored content shifted by
|
|
1009
|
+
* `k * period`.
|
|
994
1010
|
*
|
|
995
|
-
*
|
|
1011
|
+
* `bleed` is how far the content reaches outside its own cell, in world
|
|
1012
|
+
* units — the printing term, and the same idea. Content that overhangs by
|
|
1013
|
+
* more than it declares pops in at the edge of the view instead of scrolling
|
|
1014
|
+
* in.
|
|
996
1015
|
*/
|
|
997
|
-
interface
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
/** Pin x to this value when non-null. The integrator skips x/vx for the node. */
|
|
1003
|
-
fx?: number | null;
|
|
1004
|
-
fy?: number | null;
|
|
1005
|
-
/** Array index, written by `initialize`. Some forces (e.g. forceLink) rely on it. */
|
|
1006
|
-
index?: number;
|
|
1016
|
+
interface TileRange {
|
|
1017
|
+
/** First copy index, inclusive. */
|
|
1018
|
+
from: number;
|
|
1019
|
+
/** Last copy index, inclusive. `to < from` means nothing is visible. */
|
|
1020
|
+
to: number;
|
|
1007
1021
|
}
|
|
1022
|
+
declare function tiledProject(visStart: number, visEnd: number, period: number, bleed?: number): TileRange;
|
|
1023
|
+
|
|
1008
1024
|
/**
|
|
1009
|
-
*
|
|
1010
|
-
*
|
|
1011
|
-
*
|
|
1025
|
+
* How far apart the copies sit, in world units. A bare number wraps the x
|
|
1026
|
+
* axis only — the side-scrolling backdrop this is usually reached for.
|
|
1027
|
+
* `{ x, y }` wraps both; naming one key wraps that axis alone.
|
|
1028
|
+
*
|
|
1029
|
+
* The period names the axes, so there is no separate `axis` option: two ways
|
|
1030
|
+
* to say which axes wrap is one way for them to disagree.
|
|
1012
1031
|
*/
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
}
|
|
1017
|
-
/**
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1032
|
+
type TilePeriod = number | {
|
|
1033
|
+
x?: number;
|
|
1034
|
+
y?: number;
|
|
1035
|
+
};
|
|
1036
|
+
/** How far the content reaches outside its own cell, in world units. */
|
|
1037
|
+
type TileBleed = number | {
|
|
1038
|
+
x?: number;
|
|
1039
|
+
y?: number;
|
|
1040
|
+
};
|
|
1041
|
+
/** Options for {@link createTiledLayer}. */
|
|
1042
|
+
interface CreateTiledLayerOpts<TData> {
|
|
1043
|
+
id: string;
|
|
1044
|
+
label: string;
|
|
1045
|
+
/** Layers redrawn once per visible copy. */
|
|
1046
|
+
source: RenderLayer<TData>[];
|
|
1047
|
+
/**
|
|
1048
|
+
* The lattice. A function is read per draw, so the period can follow the
|
|
1049
|
+
* camera or the canvas — "one screen wide" is a period, not a constant.
|
|
1050
|
+
*/
|
|
1051
|
+
period: TilePeriod | ((view: View, dims: Dims) => TilePeriod);
|
|
1052
|
+
/**
|
|
1053
|
+
* How far the source's content reaches outside the cell `[0, period)`, in
|
|
1054
|
+
* world units. Content that overhangs by more than it declares pops in at
|
|
1055
|
+
* the edge of the view instead of scrolling in. Default 0.
|
|
1056
|
+
*/
|
|
1057
|
+
bleed?: TileBleed;
|
|
1027
1058
|
}
|
|
1028
1059
|
/**
|
|
1029
|
-
*
|
|
1030
|
-
*
|
|
1031
|
-
*
|
|
1032
|
-
*
|
|
1033
|
-
*
|
|
1034
|
-
*
|
|
1035
|
-
*
|
|
1036
|
-
*
|
|
1037
|
-
*
|
|
1038
|
-
*
|
|
1039
|
-
*
|
|
1040
|
-
*
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
alphaDecay(value: number): this;
|
|
1052
|
-
alphaMin(): number;
|
|
1053
|
-
alphaMin(value: number): this;
|
|
1054
|
-
velocityDecay(): number;
|
|
1055
|
-
velocityDecay(value: number): this;
|
|
1056
|
-
/**
|
|
1057
|
-
* Run the tick body synchronously `iterations` times. Does NOT fire
|
|
1058
|
-
* onTick or onEnd (matches d3-force). Used for offscreen pre-warm and tests.
|
|
1059
|
-
*/
|
|
1060
|
-
tick(iterations?: number): this;
|
|
1061
|
-
isSettled(): boolean;
|
|
1062
|
-
}
|
|
1063
|
-
/** A {@link SimulationCore} running on a frame loop. */
|
|
1064
|
-
interface Simulation<TNode extends SimulationNode> extends SimulationCore<TNode> {
|
|
1065
|
-
/** Resume the RAF loop. If alpha < alphaMin, reset alpha to 1. */
|
|
1066
|
-
restart(): this;
|
|
1067
|
-
/** Cancel the RAF loop. Does not change alpha. */
|
|
1068
|
-
stop(): this;
|
|
1069
|
-
}
|
|
1070
|
-
/** What {@link SimulationCore} needs: the nodes, the forces acting on them,
|
|
1071
|
-
* and the cooling schedule. {@link UseSimulationOptions} adds the loop's. */
|
|
1072
|
-
interface SimulationOptions<TNode extends SimulationNode> {
|
|
1073
|
-
/** Mutable array of nodes. Kit + forces mutate vx/vy/x/y in place. */
|
|
1074
|
-
nodes: TNode[];
|
|
1075
|
-
/** Forces applied per tick. Each may implement `initialize` for setup. */
|
|
1076
|
-
forces?: SimulationForce<TNode>[];
|
|
1077
|
-
/** Initial alpha. Default 1. */
|
|
1078
|
-
alpha?: number;
|
|
1079
|
-
/** Settle threshold. When alpha drops below and alphaTarget is 0, onEnd fires. Default 0.001. */
|
|
1080
|
-
alphaMin?: number;
|
|
1081
|
-
/** Per-tick decay rate toward alphaTarget. Default 1 - 0.001^(1/300) ≈ 0.0228. */
|
|
1082
|
-
alphaDecay?: number;
|
|
1083
|
-
/** Target alpha. Set above alphaMin to keep sim warm (e.g. during drag). Default 0. */
|
|
1084
|
-
alphaTarget?: number;
|
|
1085
|
-
/** Friction multiplier on velocity per tick: vx *= (1 - velocityDecay). Default 0.4. */
|
|
1086
|
-
velocityDecay?: number;
|
|
1087
|
-
/** Handed to each force's `initialize`. Default `Math.random`; pass a seeded
|
|
1088
|
-
* source to make a run reproducible. */
|
|
1089
|
-
random?: () => number;
|
|
1090
|
-
}
|
|
1091
|
-
/** Default alpha decay: such that alpha drops from 1 to alphaMin (0.001) in 300 ticks. */
|
|
1092
|
-
declare const DEFAULT_ALPHA_DECAY: number;
|
|
1093
|
-
/** Alpha below which a cooling simulation is considered settled. */
|
|
1094
|
-
declare const DEFAULT_ALPHA_MIN = 0.001;
|
|
1095
|
-
/** Fraction of velocity shed each tick — friction. Higher settles sooner and
|
|
1096
|
-
* overshoots less. */
|
|
1097
|
-
declare const DEFAULT_VELOCITY_DECAY = 0.4;
|
|
1098
|
-
|
|
1099
|
-
/**
|
|
1100
|
-
* The integrator, with no clock attached.
|
|
1101
|
-
*
|
|
1102
|
-
* Velocity-Verlet over a pluggable force list, contract-compatible with
|
|
1103
|
-
* d3-force so d3's own bundled forces drop in untranslated. Nothing here
|
|
1104
|
-
* advances time: `tick()` is the only thing that moves a node, and the caller
|
|
1105
|
-
* decides how often to call it. `useSimulation` calls it once a frame; a
|
|
1106
|
-
* layout pass calls it a few hundred times in one go and reads the result.
|
|
1107
|
-
*
|
|
1108
|
-
* Splitting it out is what lets a *pure* function run a relaxation — a React
|
|
1109
|
-
* hook cannot, and the alternative was a second integrator drifting away from
|
|
1110
|
-
* this one.
|
|
1060
|
+
* Wrap source RenderLayers in a periodic lattice: the content is authored
|
|
1061
|
+
* once, in the cell `[0, period)`, and every copy of it the view can see is
|
|
1062
|
+
* drawn. Panning in either direction keeps producing copies, so the content
|
|
1063
|
+
* loops seamlessly with no state and no wrap-around bookkeeping.
|
|
1064
|
+
*
|
|
1065
|
+
* Each copy draws the source through a view shifted by `-k * period`, so a
|
|
1066
|
+
* source that culls against the view it is handed culls per copy and never
|
|
1067
|
+
* learns it is being tiled. The copy's commands are then translated by
|
|
1068
|
+
* `+k * period` in world space.
|
|
1069
|
+
*
|
|
1070
|
+
* The lattice is per layer, not per shape. Content on two different periods
|
|
1071
|
+
* is two tiled layers stacked, which keeps each source ignorant of the other
|
|
1072
|
+
* — a per-shape period would move the lattice into the source and make the
|
|
1073
|
+
* wrapper unable to cull.
|
|
1074
|
+
*
|
|
1075
|
+
* The plane is `space: 'world'`, which is what lets it be a `source` of
|
|
1076
|
+
* `createParallaxLayer`: the parallax plane hands it the derived inner view,
|
|
1077
|
+
* the lattice resolves against that, and the copies ride the plane.
|
|
1078
|
+
*
|
|
1079
|
+
* **A `space: 'screen'` source is drawn once, untiled** — it ignores the view
|
|
1080
|
+
* by definition, so every copy would land on top of the last. Same constraint
|
|
1081
|
+
* `createParallaxLayer` carries.
|
|
1111
1082
|
*/
|
|
1112
|
-
|
|
1113
|
-
declare function createSimulation<TNode extends SimulationNode>(opts: SimulationOptions<TNode>): SimulationCore<TNode>;
|
|
1083
|
+
declare function createTiledLayer<TData>(opts: CreateTiledLayerOpts<TData>): RenderLayer<TData>;
|
|
1114
1084
|
|
|
1115
1085
|
/**
|
|
1116
1086
|
* Continuous N-body simulation primitive: `createSimulation`'s integrator on a
|
|
@@ -1753,6 +1723,66 @@ declare function computeFitViewport(viewportW: number, viewportH: number, conten
|
|
|
1753
1723
|
*/
|
|
1754
1724
|
declare function useAutoCenter(width: number, height: number, contentW: number, contentH: number, setZoom: (z: number) => void, setPan: (x: number, y: number) => void): void;
|
|
1755
1725
|
|
|
1726
|
+
/**
|
|
1727
|
+
* Which physical keys are down right now — the poll a game loop or character
|
|
1728
|
+
* controller reads each step. This is raw input state, not routing: it sees
|
|
1729
|
+
* every key whether or not a binding claims it, and a binding claiming a key
|
|
1730
|
+
* does not hide it from here.
|
|
1731
|
+
*/
|
|
1732
|
+
interface KeyModifiers {
|
|
1733
|
+
shift: boolean;
|
|
1734
|
+
ctrl: boolean;
|
|
1735
|
+
alt: boolean;
|
|
1736
|
+
meta: boolean;
|
|
1737
|
+
}
|
|
1738
|
+
interface KeyStateAttachOptions {
|
|
1739
|
+
/** Ignore presses whose target is an input, textarea or contenteditable
|
|
1740
|
+
* element. Their releases are always taken. Default `true`. */
|
|
1741
|
+
skipInEditable?: boolean;
|
|
1742
|
+
/** `KeyboardEvent.code`s whose keydown and keyup have their default
|
|
1743
|
+
* prevented — the keys a game owns, so Space and the arrows stop scrolling
|
|
1744
|
+
* the page. */
|
|
1745
|
+
preventDefault?: readonly string[];
|
|
1746
|
+
}
|
|
1747
|
+
interface KeyState {
|
|
1748
|
+
/** Whether any of these physical keys, by `KeyboardEvent.code`
|
|
1749
|
+
* (`'KeyA'`, `'Space'`, `'ArrowLeft'`), is down. Codes name positions, so
|
|
1750
|
+
* WASD stays in place on any layout. */
|
|
1751
|
+
isDown(code: string | readonly string[]): boolean;
|
|
1752
|
+
/** Whether a key down produced any of these `KeyboardEvent.key` values when
|
|
1753
|
+
* it was pressed. Single characters compare case-insensitively. */
|
|
1754
|
+
isKeyDown(key: string | readonly string[]): boolean;
|
|
1755
|
+
/** Whether any of these codes was freshly pressed since it was last taken;
|
|
1756
|
+
* clears them. Autorepeat is not a press. A press is taken once, so two
|
|
1757
|
+
* readers of the same code see it once between them. */
|
|
1758
|
+
take(code: string | readonly string[]): boolean;
|
|
1759
|
+
/** Every code down. The set is live — copy it to keep it. */
|
|
1760
|
+
codes(): ReadonlySet<string>;
|
|
1761
|
+
modifiers(): KeyModifiers;
|
|
1762
|
+
/** Called on every change of what is down. Returns the unsubscribe. */
|
|
1763
|
+
subscribe(listener: () => void): () => void;
|
|
1764
|
+
/** Mark everything up and drop untaken presses. */
|
|
1765
|
+
release(): void;
|
|
1766
|
+
/**
|
|
1767
|
+
* Listen on `target` — `window`, or an element whose subtree has focus.
|
|
1768
|
+
* Everything is released when the keyups can no longer arrive: the window
|
|
1769
|
+
* blurs, the document hides, focus leaves an element target, or Meta is
|
|
1770
|
+
* released (macOS delivers no keyup for a key released while Cmd is held).
|
|
1771
|
+
* Returns the detach, which also releases.
|
|
1772
|
+
*/
|
|
1773
|
+
attach(target: Window | HTMLElement, options?: KeyStateAttachOptions): () => void;
|
|
1774
|
+
}
|
|
1775
|
+
declare function createKeyState(): KeyState;
|
|
1776
|
+
|
|
1777
|
+
interface UseKeyStateOptions extends KeyStateAttachOptions {
|
|
1778
|
+
/** Scope the poll to keys typed while focus is inside this element — a
|
|
1779
|
+
* canvas host, say. Omit it to poll the whole window. */
|
|
1780
|
+
target?: RefObject<HTMLElement | null>;
|
|
1781
|
+
}
|
|
1782
|
+
/** A {@link KeyState} attached for the component's lifetime. Its identity is
|
|
1783
|
+
* stable; read it from a frame loop rather than rendering from it. */
|
|
1784
|
+
declare function useKeyState(options?: UseKeyStateOptions): KeyState;
|
|
1785
|
+
|
|
1756
1786
|
/**
|
|
1757
1787
|
* Project an action's keyboard bindings into the shape a shortcut chip
|
|
1758
1788
|
* renders from (`formatShortcut` / `formatShortcutParts` in
|
|
@@ -2678,8 +2708,6 @@ interface UseStandardActionsOptions {
|
|
|
2678
2708
|
scene?: DepSchema['scene'];
|
|
2679
2709
|
/** Undo/redo history bound to the current scene. */
|
|
2680
2710
|
history?: DepSchema['history'];
|
|
2681
|
-
/** Canvas pointer position in world space. */
|
|
2682
|
-
pointer?: DepSchema['pointer'];
|
|
2683
2711
|
/** Currently active tool id + hotkey-hold stack. */
|
|
2684
2712
|
activeTool?: DepSchema['activeTool'];
|
|
2685
2713
|
/**
|
|
@@ -2929,7 +2957,7 @@ interface UseKeybindingsOptions {
|
|
|
2929
2957
|
/**
|
|
2930
2958
|
* Gate for keyboard tool activation: return false to refuse a tool the
|
|
2931
2959
|
* active mode doesn't allow. `<SceneCanvas>` wires this from
|
|
2932
|
-
* `getActiveMode` + each tool's `capabilities`, using the same predicate
|
|
2960
|
+
* `getActiveMode` + each tool's `eligibility.capabilities`, using the same predicate
|
|
2933
2961
|
* `ToolPalette` uses to grey a button out — so the grey-out becomes a
|
|
2934
2962
|
* guarantee rather than a hint.
|
|
2935
2963
|
*
|
|
@@ -2969,6 +2997,10 @@ interface ToolPrefBase<K extends string, Value> {
|
|
|
2969
2997
|
* on one row labeled with the `pair` string (e.g. `'Position'` for
|
|
2970
2998
|
* `pose.x` / `pose.y`). Purely presentational. */
|
|
2971
2999
|
pair?: string;
|
|
3000
|
+
/** The label a surface with no room for `name` shows instead — a strip of
|
|
3001
|
+
* controls on one line, or a segment in a `pair`ed row. `name` stays the
|
|
3002
|
+
* accessible name, so this abbreviates without costing anything. */
|
|
3003
|
+
short?: string;
|
|
2972
3004
|
}
|
|
2973
3005
|
/** How a schema-driven UI should present a number pref. */
|
|
2974
3006
|
type ToolPrefNumberControl = 'input' | 'slider';
|
|
@@ -2989,10 +3021,13 @@ interface ToolPrefNumberUnit {
|
|
|
2989
3021
|
fromDisplay: (display: number) => number;
|
|
2990
3022
|
/** Shown after the input, e.g. `'°'`. */
|
|
2991
3023
|
suffix?: string;
|
|
2992
|
-
/** Suffixes a person may type, each mapped to the
|
|
3024
|
+
/** Suffixes a person may type, each mapped to the scale that turns a
|
|
2993
3025
|
* number in that unit into a display number: `{ mm: 0.1, cm: 1 }` for a
|
|
2994
|
-
* field showing centimeters.
|
|
2995
|
-
|
|
3026
|
+
* field showing centimeters. A unit that disagrees with the display unit
|
|
3027
|
+
* about zero carries an `offset` as well. */
|
|
3028
|
+
accepts?: Readonly<Record<string, UnitEntry>>;
|
|
3029
|
+
/** The stored value as display text, suffix included. */
|
|
3030
|
+
format?: (stored: number) => string;
|
|
2996
3031
|
}
|
|
2997
3032
|
/**
|
|
2998
3033
|
* A display unit built from a {@link UnitSystem}: values are stored in the
|
|
@@ -3017,9 +3052,6 @@ interface ToolPrefNumber extends ToolPrefBase<'number', number> {
|
|
|
3017
3052
|
/** An on/off pref. */
|
|
3018
3053
|
interface ToolPrefBoolean extends ToolPrefBase<'boolean', boolean> {
|
|
3019
3054
|
control?: ToolPrefBooleanControl;
|
|
3020
|
-
/** The label a `toggle` shows, since a `pair`ed row is named by the pair
|
|
3021
|
-
* rather than by the leaf. `name` stays the accessible name. */
|
|
3022
|
-
short?: string;
|
|
3023
3055
|
}
|
|
3024
3056
|
/** A free-text pref. */
|
|
3025
3057
|
interface ToolPrefString extends ToolPrefBase<'string', string> {
|
|
@@ -3365,7 +3397,7 @@ interface UseSelectToolOptions<TPose> {
|
|
|
3365
3397
|
reparentOnDrop?: 'off' | 'top' | 'above';
|
|
3366
3398
|
}
|
|
3367
3399
|
/** Intersection of the move + area-select adapter interfaces.
|
|
3368
|
-
* Resize
|
|
3400
|
+
* Resize and rotate run through `resizeAction` / `rotateAction`. */
|
|
3369
3401
|
type SelectAdapter<TNode extends {
|
|
3370
3402
|
id: string;
|
|
3371
3403
|
}, TPose> = MoveAdapter<TNode, TPose> & AreaSelectAdapter;
|
|
@@ -3384,53 +3416,6 @@ declare function useSelectTool<TNode extends {
|
|
|
3384
3416
|
id: string;
|
|
3385
3417
|
}, TPose>(adapter: SelectAdapter<TNode, TPose>, options: UseSelectToolOptions<TPose>): Tool<null>;
|
|
3386
3418
|
|
|
3387
|
-
/** Options for `useRotateTool` — mostly the placement of the rotation
|
|
3388
|
-
* handle's hover band. */
|
|
3389
|
-
interface UseRotateToolOptions<TNode extends {
|
|
3390
|
-
id: string;
|
|
3391
|
-
}, _TPose> {
|
|
3392
|
-
/** Legacy `useRotate` options surface. Ignored now —
|
|
3393
|
-
* rotation flows through `rotateAction`, whose option surface is
|
|
3394
|
-
* configured at the action-registration level. Kept on the type for
|
|
3395
|
-
* backwards-compat with consumers (notably `SceneCanvas`'s
|
|
3396
|
-
* `rotateOptions`) that still pass a value. */
|
|
3397
|
-
rotate?: unknown;
|
|
3398
|
-
/** Minimum thickness of the rotate band outside the selection AABB, in
|
|
3399
|
-
* screen px. Defaults to {@link ROTATION_HANDLE_BASE_PX}; `<SceneCanvas>`
|
|
3400
|
-
* passes the device-scaled value. */
|
|
3401
|
-
rotationHandleDistance?: number;
|
|
3402
|
-
/** World-space bounds lookup. Required for the rotation affordance hit-test
|
|
3403
|
-
* in consumers that wire a `boundsOf` source separately from the
|
|
3404
|
-
* ChromeState-driven affordance pipeline. Retained for parity with
|
|
3405
|
-
* `useResizeTool`; the rotation affordance itself reads bounds via the
|
|
3406
|
-
* dispatcher-supplied ChromeState. */
|
|
3407
|
-
boundsOf?: (id: string) => Bounds | null;
|
|
3408
|
-
/** Live selection ids — retained for parity with `useResizeTool` /
|
|
3409
|
-
* `useSelectTool` option surfaces. The dispatcher-path `rotateAction`
|
|
3410
|
-
* reads selection from its own `InvocationCtx`, so this tool no longer
|
|
3411
|
-
* forwards selection into the rotation gesture itself. */
|
|
3412
|
-
getSelection?: () => string[];
|
|
3413
|
-
/** Node lookup — retained for parity with `useSelectTool` and for future
|
|
3414
|
-
* ghost-render wiring. The rotation affordance does not need it directly. */
|
|
3415
|
-
getNode?: (id: string) => TNode | null;
|
|
3416
|
-
}
|
|
3417
|
-
/** Rotate-only Tool. Owns the rotation-handle affordance render layer; the
|
|
3418
|
-
* gesture itself flows through `rotateAction` (declarative binding in
|
|
3419
|
-
* `useSelectTool.bindings` keyed on the `rotate-handle` affordance hit
|
|
3420
|
-
* kind) → dispatcher → preview surface → scene commit.
|
|
3421
|
-
*
|
|
3422
|
-
* The legacy `useRotate` hook is removed — the affordance no
|
|
3423
|
-
* longer wraps each region's drag channel; the unwrapped affordance is
|
|
3424
|
-
* used purely for the paint + hit-test surface. The dispatcher's
|
|
3425
|
-
* `affordanceAt` pipeline produces `rotate-handle` hits independently
|
|
3426
|
-
* (see `src/canvas/affordanceAt.ts`), which the `useSelectTool` rotate
|
|
3427
|
-
* binding then routes to `rotateAction`. */
|
|
3428
|
-
declare function useRotateTool<TNode extends {
|
|
3429
|
-
id: string;
|
|
3430
|
-
}, _TPose>(adapter: RotateAdapter<TNode, _TPose>, options: UseRotateToolOptions<TNode, _TPose>): Tool<unknown> & {
|
|
3431
|
-
overlay: RenderLayer<unknown>;
|
|
3432
|
-
};
|
|
3433
|
-
|
|
3434
3419
|
/**
|
|
3435
3420
|
* Pick the topmost id from a body-hit list, using whatever signal the
|
|
3436
3421
|
* adapter exposes.
|
|
@@ -3524,6 +3509,120 @@ declare function useHandTool(opts?: UseHandToolOptions): Tool<HandScratch | null
|
|
|
3524
3509
|
* `src/interactions/actions/defaults/enterTextEdit.ts`). Custom node
|
|
3525
3510
|
* factories and hit gating belong on those deps, not on the tool. */
|
|
3526
3511
|
declare function useTextTool(): Tool<undefined>;
|
|
3512
|
+
declare namespace useTextTool {
|
|
3513
|
+
var options: {
|
|
3514
|
+
name: string;
|
|
3515
|
+
description: string;
|
|
3516
|
+
children: {
|
|
3517
|
+
bold: {
|
|
3518
|
+
readonly kind: "boolean";
|
|
3519
|
+
readonly name: string;
|
|
3520
|
+
readonly description: `${string} for the characters in the range.`;
|
|
3521
|
+
readonly icon: string;
|
|
3522
|
+
readonly control: "toggle";
|
|
3523
|
+
readonly pair: "Character style";
|
|
3524
|
+
readonly default: false;
|
|
3525
|
+
};
|
|
3526
|
+
italic: {
|
|
3527
|
+
readonly kind: "boolean";
|
|
3528
|
+
readonly name: string;
|
|
3529
|
+
readonly description: `${string} for the characters in the range.`;
|
|
3530
|
+
readonly icon: string;
|
|
3531
|
+
readonly control: "toggle";
|
|
3532
|
+
readonly pair: "Character style";
|
|
3533
|
+
readonly default: false;
|
|
3534
|
+
};
|
|
3535
|
+
underline: {
|
|
3536
|
+
readonly kind: "boolean";
|
|
3537
|
+
readonly name: string;
|
|
3538
|
+
readonly description: `${string} for the characters in the range.`;
|
|
3539
|
+
readonly icon: string;
|
|
3540
|
+
readonly control: "toggle";
|
|
3541
|
+
readonly pair: "Character style";
|
|
3542
|
+
readonly default: false;
|
|
3543
|
+
};
|
|
3544
|
+
strikethrough: {
|
|
3545
|
+
readonly kind: "boolean";
|
|
3546
|
+
readonly name: string;
|
|
3547
|
+
readonly description: `${string} for the characters in the range.`;
|
|
3548
|
+
readonly icon: string;
|
|
3549
|
+
readonly control: "toggle";
|
|
3550
|
+
readonly pair: "Character style";
|
|
3551
|
+
readonly default: false;
|
|
3552
|
+
};
|
|
3553
|
+
overline: {
|
|
3554
|
+
readonly kind: "boolean";
|
|
3555
|
+
readonly name: string;
|
|
3556
|
+
readonly description: `${string} for the characters in the range.`;
|
|
3557
|
+
readonly icon: string;
|
|
3558
|
+
readonly control: "toggle";
|
|
3559
|
+
readonly pair: "Character style";
|
|
3560
|
+
readonly default: false;
|
|
3561
|
+
};
|
|
3562
|
+
script: {
|
|
3563
|
+
kind: string;
|
|
3564
|
+
name: string;
|
|
3565
|
+
description: string;
|
|
3566
|
+
default: undefined;
|
|
3567
|
+
};
|
|
3568
|
+
fontFamily: {
|
|
3569
|
+
kind: string;
|
|
3570
|
+
name: string;
|
|
3571
|
+
description: string;
|
|
3572
|
+
default: undefined;
|
|
3573
|
+
};
|
|
3574
|
+
fontSize: {
|
|
3575
|
+
kind: "number";
|
|
3576
|
+
name: string;
|
|
3577
|
+
description: string;
|
|
3578
|
+
min: number;
|
|
3579
|
+
step: number;
|
|
3580
|
+
default: number;
|
|
3581
|
+
};
|
|
3582
|
+
letterSpacing: {
|
|
3583
|
+
kind: "number";
|
|
3584
|
+
name: string;
|
|
3585
|
+
short: string;
|
|
3586
|
+
description: string;
|
|
3587
|
+
step: number;
|
|
3588
|
+
default: number;
|
|
3589
|
+
};
|
|
3590
|
+
baselineShift: {
|
|
3591
|
+
kind: "number";
|
|
3592
|
+
name: string;
|
|
3593
|
+
short: string;
|
|
3594
|
+
description: string;
|
|
3595
|
+
step: number;
|
|
3596
|
+
unit: {
|
|
3597
|
+
toDisplay: (v: number) => number;
|
|
3598
|
+
fromDisplay: (v: number) => number;
|
|
3599
|
+
suffix: string;
|
|
3600
|
+
};
|
|
3601
|
+
default: number;
|
|
3602
|
+
};
|
|
3603
|
+
fontScale: {
|
|
3604
|
+
kind: "number";
|
|
3605
|
+
name: string;
|
|
3606
|
+
description: string;
|
|
3607
|
+
min: number;
|
|
3608
|
+
step: number;
|
|
3609
|
+
unit: {
|
|
3610
|
+
toDisplay: (v: number) => number;
|
|
3611
|
+
fromDisplay: (v: number) => number;
|
|
3612
|
+
suffix: string;
|
|
3613
|
+
};
|
|
3614
|
+
default: number;
|
|
3615
|
+
};
|
|
3616
|
+
fill: {
|
|
3617
|
+
kind: "color";
|
|
3618
|
+
name: string;
|
|
3619
|
+
description: string;
|
|
3620
|
+
alpha: true;
|
|
3621
|
+
default: string;
|
|
3622
|
+
};
|
|
3623
|
+
};
|
|
3624
|
+
};
|
|
3625
|
+
}
|
|
3527
3626
|
|
|
3528
3627
|
/**
|
|
3529
3628
|
* In-progress pen anchor. `outHandle` is set when the anchor was placed via
|
|
@@ -3558,9 +3657,11 @@ interface PenSubpath {
|
|
|
3558
3657
|
* so click-by-click state survives gesture boundaries and the preview layer
|
|
3559
3658
|
* can read the same object.
|
|
3560
3659
|
*
|
|
3561
|
-
* ## The pen
|
|
3660
|
+
* ## The pen draws paths; it does not reshape them
|
|
3562
3661
|
*
|
|
3563
|
-
*
|
|
3662
|
+
* It draws new nodes, and extends an existing node's open subpath from one
|
|
3663
|
+
* of its ends (see `continuing`). Reshaping an existing path is anchor
|
|
3664
|
+
* editing: double-click a path to
|
|
3564
3665
|
* enter edit mode, then use the `editAnchors` / `insertPathAnchor` /
|
|
3565
3666
|
* `nudgeAnchors` / `deleteAnchors` / `marqueeAnchors` / `cutPathAtAnchor`
|
|
3566
3667
|
* Actions.
|
|
@@ -3583,6 +3684,22 @@ interface PenScratch {
|
|
|
3583
3684
|
} | null;
|
|
3584
3685
|
draggingHandleAt: number | null;
|
|
3585
3686
|
closeHintActive: boolean;
|
|
3687
|
+
/** Set while the pen is extending an existing node's open subpath rather
|
|
3688
|
+
* than drawing a new node. `current` then starts as that subpath (turned
|
|
3689
|
+
* around when it was picked up by its first anchor), and the commit
|
|
3690
|
+
* writes back into the node. */
|
|
3691
|
+
continuing: PenContinuation | null;
|
|
3692
|
+
}
|
|
3693
|
+
/** Which existing subpath the pen picked up, and the node's path as it was. */
|
|
3694
|
+
interface PenContinuation {
|
|
3695
|
+
id: string;
|
|
3696
|
+
/** Index of the picked-up subpath within `original`. */
|
|
3697
|
+
sub: number;
|
|
3698
|
+
/** True when it was picked up by its first anchor, so `current` runs
|
|
3699
|
+
* backwards and is turned around again on commit. */
|
|
3700
|
+
reversed: boolean;
|
|
3701
|
+
/** The node's path in world coords at pick-up. */
|
|
3702
|
+
original: PolygonPath;
|
|
3586
3703
|
}
|
|
3587
3704
|
/** Options for `usePenTool`: how a finished path becomes a pose, where it is
|
|
3588
3705
|
* inserted, and when a closed subpath commits. */
|
|
@@ -3608,6 +3725,10 @@ interface UsePenToolOptions<TPose> {
|
|
|
3608
3725
|
* Measured as a screen-space circle, so it stays round under non-uniform
|
|
3609
3726
|
* zoom; aligns with `useSelectTool.handleHitRadius`. */
|
|
3610
3727
|
closeHitRadius?: number;
|
|
3728
|
+
/** Screen-px radius within which a placed anchor lands exactly on an
|
|
3729
|
+
* existing path's anchor. Default `8`; `0` turns it off. Takes precedence
|
|
3730
|
+
* over `snapPoint`, which applies only when no anchor is in range. */
|
|
3731
|
+
anchorSnapRadius?: number;
|
|
3611
3732
|
/** Optional point snapper applied to every world-space coordinate the
|
|
3612
3733
|
* pen records or previews — anchor positions (corner clicks, smooth-
|
|
3613
3734
|
* drag base point), the rubber-band cursor, and the outgoing-handle
|
|
@@ -3874,7 +3995,7 @@ declare function useStarTool<TNode extends {
|
|
|
3874
3995
|
* array to `insertAction`, which forwards it as the `pencil` insert
|
|
3875
3996
|
* extras' `samples`. A consumer that wants pressure-driven
|
|
3876
3997
|
* `Stroke.vertexWidths` reads it off the samples in its own `insert` dep
|
|
3877
|
-
* (`useDepSource('insert', …)`) — see `apps/site/demos/
|
|
3998
|
+
* (`useDepSource('insert', …)`) — see `apps/site/demos/StrokeAndFillDemo.tsx`.
|
|
3878
3999
|
*/
|
|
3879
4000
|
interface PencilPoint {
|
|
3880
4001
|
x: number;
|
|
@@ -4102,8 +4223,8 @@ declare function resolveVisibility(consumer: VisibilityRules | undefined, ctx: C
|
|
|
4102
4223
|
* Sources are passed as plain getters / values rather than the live
|
|
4103
4224
|
* objects they come from. This keeps `chrome-caps` from depending on
|
|
4104
4225
|
* React, the dispatcher's concrete type, or `ChromeState`'s bounds
|
|
4105
|
-
* machinery — the same builder works from a test harness, a
|
|
4106
|
-
*
|
|
4226
|
+
* machinery — the same builder works from a test harness, a forge
|
|
4227
|
+
* story, or `<SceneCanvas>`.
|
|
4107
4228
|
*/
|
|
4108
4229
|
|
|
4109
4230
|
/** The pieces of live canvas state a `ChromeCtx` is assembled from. */
|
|
@@ -5085,6 +5206,18 @@ interface SceneSlotConfig<TNode extends {
|
|
|
5085
5206
|
* The move-overlay ghost (drag preview) is not post-processed.
|
|
5086
5207
|
*/
|
|
5087
5208
|
postProcess?: (cmds: DrawCommand[], view: View, dims: Dims) => DrawCommand[];
|
|
5209
|
+
/**
|
|
5210
|
+
* Drop commands that cannot reach the view before they reach the renderer,
|
|
5211
|
+
* so an off-screen node costs its painter and nothing after. Applied last,
|
|
5212
|
+
* after `postProcess`, to the `dims` rectangle under `view`; see
|
|
5213
|
+
* `cullDrawCommands` for what it can and cannot bound.
|
|
5214
|
+
*
|
|
5215
|
+
* Off by default because it makes the layer's world-space output depend on
|
|
5216
|
+
* the view: anything that draws this layer once and shows the result under
|
|
5217
|
+
* another view — a cache keyed without `view`, a consumer re-wrapping the
|
|
5218
|
+
* commands — would show the first view's cull.
|
|
5219
|
+
*/
|
|
5220
|
+
cull?: boolean;
|
|
5088
5221
|
}
|
|
5089
5222
|
/** Selection-overlay slot config — passed through to `createSelectionOverlayLayer`,
|
|
5090
5223
|
* minus the `getSelection`/`getPose` Canvas wires automatically. */
|
|
@@ -5156,6 +5289,12 @@ interface CanvasProps<TNode extends {
|
|
|
5156
5289
|
* same contract the headless `renderSceneToPixels` path follows (that
|
|
5157
5290
|
* path never reads ambient density at all). */
|
|
5158
5291
|
dpr?: number;
|
|
5292
|
+
/** Flatness tolerance for curve tessellation, in world units. Forwarded to
|
|
5293
|
+
* `WeaselRendererOptions.flattenTolerance`. Leave unset for the cached
|
|
5294
|
+
* default (`DEFAULT_FLATTEN_TOLERANCE`, 0.5); a scene whose world unit is
|
|
5295
|
+
* not a pixel — feet, inches, millimetres — needs a value scaled to its
|
|
5296
|
+
* unit or sub-unit curves flatten to a handful of vertices. */
|
|
5297
|
+
flattenTolerance?: number;
|
|
5159
5298
|
/** The version of whatever content this canvas draws, sampled at paint time
|
|
5160
5299
|
* and reported by {@link CanvasExtensionApi.getPaintedVersion}.
|
|
5161
5300
|
* `<SceneCanvas>` wires this to `scene.getVersion`. Chrome that must not
|
|
@@ -5491,6 +5630,8 @@ type SceneCanvasAdapter<TData, TLayer extends string, TPose> = MoveAdapter<Node$
|
|
|
5491
5630
|
setSelection(ids: string[]): void;
|
|
5492
5631
|
insertNode(node: Node$1<TData, TLayer, TPose>, index?: number): void;
|
|
5493
5632
|
removeNode(id: string): void;
|
|
5633
|
+
/** Replace a node's `data` — what a `setData` op writes through. */
|
|
5634
|
+
setData(id: string, data: TData): void;
|
|
5494
5635
|
getRemovalClosure(ids: readonly string[]): string[];
|
|
5495
5636
|
applyOps(ops: Op[], label?: string): void;
|
|
5496
5637
|
snapshotSelection(ids: string[]): ClipboardSnapshot;
|
|
@@ -5869,7 +6010,7 @@ declare function defaultDrawOne<TData, TLayer extends string, TPose>(node: Node$
|
|
|
5869
6010
|
declare const DEFAULT_HANDLE_SIZE: 8;
|
|
5870
6011
|
/** Built-in tool ids that aren't shape tools — the ones with no entry in
|
|
5871
6012
|
* the `core/shapeKinds` table. */
|
|
5872
|
-
declare const NON_SHAPE_BUILTIN_TOOLS: readonly ["select", "
|
|
6013
|
+
declare const NON_SHAPE_BUILTIN_TOOLS: readonly ["select", "hand"];
|
|
5873
6014
|
/** Built-in tool ids SceneCanvas knows how to mount when no `tools` prop
|
|
5874
6015
|
* is supplied. Pass a subset via `defaultTools` to slim the registered set. */
|
|
5875
6016
|
type BuiltinToolId = (typeof NON_SHAPE_BUILTIN_TOOLS)[number] | BuiltinShapeToolId;
|
|
@@ -6079,7 +6220,7 @@ type SceneCanvasProps<TData, TLayer extends string, TPose> = Omit<CanvasProps<No
|
|
|
6079
6220
|
* into the built-in registry on top of whatever `defaultTools` /
|
|
6080
6221
|
* `toolBundle` already selected.
|
|
6081
6222
|
* - `true` pulls in the built-in for this id (`'pen'`, `'lasso'`,
|
|
6082
|
-
* `'
|
|
6223
|
+
* `'hand'`, …) even when it's outside the active tier — useful
|
|
6083
6224
|
* for `toolBundle: 'minimal'` + `tools={{ pen: true }}`. Unknown
|
|
6084
6225
|
* built-in ids warn in dev and are ignored.
|
|
6085
6226
|
* - `AnyTool` adds a new id or replaces an existing one
|
|
@@ -6125,8 +6266,7 @@ type SceneCanvasProps<TData, TLayer extends string, TPose> = Omit<CanvasProps<No
|
|
|
6125
6266
|
onToolsCreated?: (tools: ToolsApi) => void;
|
|
6126
6267
|
/**
|
|
6127
6268
|
* Named preset for the built-in tool set: `'minimal'` (select + hand),
|
|
6128
|
-
* `'standard'` (select +
|
|
6129
|
-
* line + pencil), or `'exhaustive'` (every built-in including polygon,
|
|
6269
|
+
* `'standard'` (select + hand + rect + ellipse + line), or `'exhaustive'` (every built-in including polygon,
|
|
6130
6270
|
* star, lasso, text, clone). When set, defines the starting set;
|
|
6131
6271
|
* `defaultTools` (if also passed) overrides it. Ignored when the
|
|
6132
6272
|
* consumer supplies their own `tools` prop.
|
|
@@ -6134,7 +6274,7 @@ type SceneCanvasProps<TData, TLayer extends string, TPose> = Omit<CanvasProps<No
|
|
|
6134
6274
|
toolBundle?: ToolBundle;
|
|
6135
6275
|
/**
|
|
6136
6276
|
* Which built-in tools SceneCanvas registers in its internal `useTools`.
|
|
6137
|
-
* Default: `['select'
|
|
6277
|
+
* Default: `['select']` (plus `'hand'` when the
|
|
6138
6278
|
* `viewport` feature is on). Pass a smaller array to slim — e.g.
|
|
6139
6279
|
* `['select']` for move-only. Wins over `toolBundle` when both are
|
|
6140
6280
|
* passed. Ignored when the consumer supplies their own `tools` prop.
|
|
@@ -6326,6 +6466,12 @@ type SceneCanvasProps<TData, TLayer extends string, TPose> = Omit<CanvasProps<No
|
|
|
6326
6466
|
* to `<Canvas shaders={...} />`. See `CanvasProps.shaders` for details.
|
|
6327
6467
|
*/
|
|
6328
6468
|
shaders?: ShaderProgramHandle[];
|
|
6469
|
+
/**
|
|
6470
|
+
* Flatness tolerance for curve tessellation, in world units. Forwarded
|
|
6471
|
+
* directly to `<Canvas flattenTolerance={...} />`. See
|
|
6472
|
+
* `CanvasProps.flattenTolerance` for details.
|
|
6473
|
+
*/
|
|
6474
|
+
flattenTolerance?: number;
|
|
6329
6475
|
/**
|
|
6330
6476
|
* FillStyle applied to the full canvas behind the scene. Accepts the kit's
|
|
6331
6477
|
* `FillStyle` union (solid / pattern / linear-gradient / radial-gradient /
|
|
@@ -7173,12 +7319,15 @@ declare function derivedPose<TPose>(source: PoseSource<TPose>, node: PosedNode<T
|
|
|
7173
7319
|
declare function derivedDepOf<TPose>(source: PoseSource<TPose>, id: NodeId): DerivedDep<TPose> | undefined;
|
|
7174
7320
|
/**
|
|
7175
7321
|
* The pose the *document* says `node` is at: derived when it derives, else
|
|
7176
|
-
* authored. `effectivePose` minus the override step
|
|
7322
|
+
* authored. `effectivePose` minus the override step, at every link of the
|
|
7323
|
+
* dependency chain — a derived node's document pose holds still while
|
|
7324
|
+
* something it derives from is being dragged.
|
|
7177
7325
|
*
|
|
7178
7326
|
* For a reader that must not see an in-flight gesture — an action capturing
|
|
7179
|
-
* the `from` of a transform op, a placement computed against a sibling
|
|
7180
|
-
* derived pose belongs here and an override does not:
|
|
7181
|
-
* document means, an override is what one gesture is
|
|
7327
|
+
* the `from` of a transform op, a placement computed against a sibling, the
|
|
7328
|
+
* minimap's framing. A derived pose belongs here and an override does not:
|
|
7329
|
+
* derivation is what the document means, an override is what one gesture is
|
|
7330
|
+
* currently showing.
|
|
7182
7331
|
*/
|
|
7183
7332
|
declare function documentPose<TPose>(source: PoseSource<TPose>, node: PosedNode<TPose>): TPose;
|
|
7184
7333
|
/**
|
|
@@ -7520,6 +7669,58 @@ declare function SelectionContextProviderIfRoot({ children, }: {
|
|
|
7520
7669
|
*/
|
|
7521
7670
|
declare function usePublishSelection(ids: readonly NodeId[], kinds?: readonly (string | undefined)[]): void;
|
|
7522
7671
|
|
|
7672
|
+
/**
|
|
7673
|
+
* @experimental
|
|
7674
|
+
* PointerContext — a tiny ambient context that publishes the world-space
|
|
7675
|
+
* position of the canvas pointer, refreshed on every `pointermove` over
|
|
7676
|
+
* the canvas. Cleared (set to `null`) on `pointerleave`.
|
|
7677
|
+
*
|
|
7678
|
+
* Why ref-based and not state-based: cursor moves fire dozens of times per
|
|
7679
|
+
* second; routing those through React state would re-render every consumer
|
|
7680
|
+
* in the tree. The context exposes a stable `pointerRef` whose `.current`
|
|
7681
|
+
* is mutated directly by the publisher, plus a thunk `getDropPoint()` that
|
|
7682
|
+
* reads it on demand. Consumers (e.g. `useClipboard`) pull via the thunk
|
|
7683
|
+
* inside their callbacks — no subscription, no re-render.
|
|
7684
|
+
*
|
|
7685
|
+
* `<SceneCanvas>` publishes automatically. `useClipboardOps` consumes when
|
|
7686
|
+
* the caller didn't pass an explicit `getDropPoint` option. Other future
|
|
7687
|
+
* hit-on-cursor consumers (drop-zone hover, context-menu anchor) can reuse
|
|
7688
|
+
* the same context.
|
|
7689
|
+
*/
|
|
7690
|
+
|
|
7691
|
+
/** @experimental World-space pointer position, or `null` when the pointer
|
|
7692
|
+
* isn't over the publishing canvas. */
|
|
7693
|
+
type PointerWorldPos = {
|
|
7694
|
+
worldX: number;
|
|
7695
|
+
worldY: number;
|
|
7696
|
+
} | null;
|
|
7697
|
+
/** @experimental */
|
|
7698
|
+
interface PointerContextValue {
|
|
7699
|
+
/** Live ref — mutate to publish, read for the latest snapshot. The
|
|
7700
|
+
* identity is stable for the lifetime of the provider. */
|
|
7701
|
+
readonly pointerRef: MutableRefObject<PointerWorldPos>;
|
|
7702
|
+
/** Convenience thunk equivalent to `() => pointerRef.current`. Stable
|
|
7703
|
+
* identity for the lifetime of the provider; safe to pass to hooks. */
|
|
7704
|
+
readonly getDropPoint: () => PointerWorldPos;
|
|
7705
|
+
}
|
|
7706
|
+
/**
|
|
7707
|
+
* @experimental
|
|
7708
|
+
* Wrap the part of the React tree that should share a pointer-position
|
|
7709
|
+
* context. Usually placed at the demo / app root, alongside
|
|
7710
|
+
* `<ActionsProvider>` and `<SelectionContextProvider>`.
|
|
7711
|
+
*
|
|
7712
|
+
* Most consumers don't need to mount this directly — `<SceneCanvas>` mounts
|
|
7713
|
+
* an internal provider when no parent provider is in scope, so child hooks
|
|
7714
|
+
* (`useClipboard` without an explicit `getDropPoint`) read the canvas's
|
|
7715
|
+
* tracked pointer for free.
|
|
7716
|
+
*/
|
|
7717
|
+
declare function PointerContextProvider({ children }: {
|
|
7718
|
+
children: ReactNode;
|
|
7719
|
+
}): ReactNode;
|
|
7720
|
+
/** @experimental Read the surrounding pointer-context value, or `null` when
|
|
7721
|
+
* no provider is in scope. */
|
|
7722
|
+
declare function usePointerContext(): PointerContextValue | null;
|
|
7723
|
+
|
|
7523
7724
|
/** Mount a `<PointerContextProvider>` only when none is already in scope. */
|
|
7524
7725
|
declare function PointerProviderIfRoot({ children }: {
|
|
7525
7726
|
children: ReactNode;
|
|
@@ -8189,6 +8390,12 @@ interface TextEditScreenPose {
|
|
|
8189
8390
|
fontSize: number;
|
|
8190
8391
|
/** Effective on-screen line height multiplier (defaults to style.lineHeight). */
|
|
8191
8392
|
lineHeight?: number;
|
|
8393
|
+
/**
|
|
8394
|
+
* Where the text sits within `height`, as the canvas places it. `'center'`
|
|
8395
|
+
* and `'bottom'` size the overlay to its own content and offset it by the
|
|
8396
|
+
* slack, re-measured as typing changes the line count. Default `'top'`.
|
|
8397
|
+
*/
|
|
8398
|
+
verticalAlign?: TextVerticalAlign;
|
|
8192
8399
|
/**
|
|
8193
8400
|
* CSS scale applied to the overlay (`transform: scale(zoom)`, anchored at
|
|
8194
8401
|
* its top-left). Every other size on this pose, and every typographic
|
|
@@ -8500,6 +8707,20 @@ interface UseSceneTextEditReturn extends UseTextEditReturn {
|
|
|
8500
8707
|
* over the node being edited and writes the result back as an undoable op. */
|
|
8501
8708
|
declare function useSceneTextEdit<TData extends DefaultTextData, TLayer extends string, TPose extends RectPose = RectPose>(scene: Scene<TData, TLayer, TPose>, container: HTMLElement | null, options?: UseSceneTextEditOptions<TData>): UseSceneTextEditReturn;
|
|
8502
8709
|
|
|
8710
|
+
/**
|
|
8711
|
+
* What is actually rendering across a range: `range` (from `styleAtRange`,
|
|
8712
|
+
* or `useTextEdit`'s `rangeStyle`) resolved against the node's own `style`
|
|
8713
|
+
* and `paint`, as the canvas resolves runs. `null` reads the node alone.
|
|
8714
|
+
*
|
|
8715
|
+
* Flags are additive — a run can turn one on, never off — so a node flag
|
|
8716
|
+
* makes the flag `true` across the range, `MIXED` runs included. Every other
|
|
8717
|
+
* key is the run's value where the range sets one, otherwise the node's.
|
|
8718
|
+
* The node level is resolved first, so the result has a value for every
|
|
8719
|
+
* key but the run-only ones, and for `fill` unless the node is unfilled.
|
|
8720
|
+
* A node's weight reads as bold at 600 and above, as `nodeHasFlag` does.
|
|
8721
|
+
*/
|
|
8722
|
+
declare function effectiveRangeStyle(range: RangeStyle | null, style: TextStyle | undefined, paint?: TextPaint): RangeStyle;
|
|
8723
|
+
|
|
8503
8724
|
/**
|
|
8504
8725
|
* Build a `TextDrawCommand`. `textCommandFromPose` is the command for a text
|
|
8505
8726
|
* node — what `kit:text` and `createTextLayer` both emit. `textCommand` takes
|
|
@@ -8512,20 +8733,25 @@ declare function useSceneTextEdit<TData extends DefaultTextData, TLayer extends
|
|
|
8512
8733
|
*
|
|
8513
8734
|
* `paint` is the node's `data.fill` / `data.stroke`. A caller with no node —
|
|
8514
8735
|
* a HUD widget, a debug overlay — states its color on the run instead.
|
|
8736
|
+
*
|
|
8737
|
+
* `scale` is the view scale a `{ px }` `fontSize` or `letterSpacing` resolves
|
|
8738
|
+
* against — for a world-space layer, the mean of `view.scale.x` and
|
|
8739
|
+
* `view.scale.y`. It has to be applied here and not at draw time, because a
|
|
8740
|
+
* screen-pixel size moves the glyph advances and so the wrap points.
|
|
8515
8741
|
*/
|
|
8516
8742
|
|
|
8517
|
-
declare function textCommandFromRuns(x: number, y: number, runs: readonly StyledRun[], style?: TextStyle, maxWidth?: number, height?: number, verticalAlign?: TextVerticalAlign, paint?: TextPaint, width?: number): DrawCommand;
|
|
8743
|
+
declare function textCommandFromRuns(x: number, y: number, runs: readonly StyledRun[], style?: TextStyle, maxWidth?: number, height?: number, verticalAlign?: TextVerticalAlign, paint?: TextPaint, width?: number, scale?: number): DrawCommand;
|
|
8518
8744
|
/** Build a draw command for a single unstyled string. Text is laid out with
|
|
8519
8745
|
* the registered font's metrics, wrapped at `maxWidth`, aligned across
|
|
8520
8746
|
* `width` (default `maxWidth`) and within `height` when `verticalAlign` is
|
|
8521
8747
|
* given. */
|
|
8522
|
-
declare function textCommand(x: number, y: number, text: string, style?: TextStyle, maxWidth?: number, height?: number, verticalAlign?: TextVerticalAlign, paint?: TextPaint, width?: number): DrawCommand;
|
|
8748
|
+
declare function textCommand(x: number, y: number, text: string, style?: TextStyle, maxWidth?: number, height?: number, verticalAlign?: TextVerticalAlign, paint?: TextPaint, width?: number, scale?: number): DrawCommand;
|
|
8523
8749
|
/**
|
|
8524
8750
|
* The draw command for a text pose. Its wrap width, alignment box and runs
|
|
8525
8751
|
* come from `textPoseLayoutInput`, so the renderer lays it out into exactly
|
|
8526
8752
|
* the lines `layoutTextPose` reports for the same pose.
|
|
8527
8753
|
*/
|
|
8528
|
-
declare function textCommandFromPose(pose: TextPose): TextDrawCommand;
|
|
8754
|
+
declare function textCommandFromPose(pose: TextPose, scale?: number): TextDrawCommand;
|
|
8529
8755
|
|
|
8530
8756
|
/**
|
|
8531
8757
|
* Pure DOM ↔ `StyledRun[]` serializers for the contenteditable overlay
|
|
@@ -8594,6 +8820,178 @@ interface TilePatternOpts {
|
|
|
8594
8820
|
*/
|
|
8595
8821
|
declare function createTilePattern(opts: TilePatternOpts): TextureHandle | null;
|
|
8596
8822
|
|
|
8823
|
+
/**
|
|
8824
|
+
* Coons and tensor-product patch surfaces — PDF's shading types 6 and 7, as
|
|
8825
|
+
* pure geometry.
|
|
8826
|
+
*
|
|
8827
|
+
* A patch is a curved quadrilateral: four cubic Bézier edges and a color at
|
|
8828
|
+
* each corner. The interior is what the edges imply — a Coons patch reads it
|
|
8829
|
+
* off the boundary alone; a tensor patch adds four interior control points
|
|
8830
|
+
* that pull it around. Both evaluate at a `(u, v)` in the unit square, which
|
|
8831
|
+
* is what lets the renderer subdivide a patch into as many triangles as it
|
|
8832
|
+
* wants without the patch knowing.
|
|
8833
|
+
*
|
|
8834
|
+
* Nothing here touches GL, a color string, or a scene. `evalPatch` is the
|
|
8835
|
+
* whole contract.
|
|
8836
|
+
*/
|
|
8837
|
+
/** A point in the patch's own space. */
|
|
8838
|
+
interface MeshPoint {
|
|
8839
|
+
x: number;
|
|
8840
|
+
y: number;
|
|
8841
|
+
}
|
|
8842
|
+
/**
|
|
8843
|
+
* One patch.
|
|
8844
|
+
*
|
|
8845
|
+
* `points` walks the boundary: corner 0, the two control points of the edge
|
|
8846
|
+
* leaving it, corner 1, its two, and so on — twelve points, ending with the
|
|
8847
|
+
* two controls that return to corner 0. A tensor patch appends its four
|
|
8848
|
+
* interior points, in the order `(1,1)`, `(1,2)`, `(2,2)`, `(2,1)` of the
|
|
8849
|
+
* bicubic control net, which is PDF's own order.
|
|
8850
|
+
*
|
|
8851
|
+
* Twelve points is a Coons patch and sixteen is a tensor patch; there is no
|
|
8852
|
+
* flag, because the count already says which it is.
|
|
8853
|
+
*
|
|
8854
|
+
* `colors` are the corner colors in the same walk order, as whatever color
|
|
8855
|
+
* form the caller resolves — the renderer hands premultiplied RGBA in, the
|
|
8856
|
+
* serializer hands CSS strings.
|
|
8857
|
+
*/
|
|
8858
|
+
interface MeshPatch<TColor = string> {
|
|
8859
|
+
points: readonly MeshPoint[];
|
|
8860
|
+
colors: readonly [TColor, TColor, TColor, TColor];
|
|
8861
|
+
}
|
|
8862
|
+
/** Corner `i` of the boundary walk. */
|
|
8863
|
+
declare function patchCorner(patch: MeshPatch<unknown>, i: number): MeshPoint;
|
|
8864
|
+
/** `true` when the patch carries the four interior points a tensor patch adds. */
|
|
8865
|
+
declare function isTensorPatch(patch: MeshPatch<unknown>): boolean;
|
|
8866
|
+
/** A patch is twelve boundary points, or sixteen with the interior. Anything
|
|
8867
|
+
* else cannot be evaluated, and saying so here beats painting nonsense. */
|
|
8868
|
+
declare function isValidPatch(patch: MeshPatch<unknown>): boolean;
|
|
8869
|
+
/**
|
|
8870
|
+
* The patch surface at `(u, v)`, both in `0..1`.
|
|
8871
|
+
*
|
|
8872
|
+
* `u` runs along the edge leaving corner 0 and `v` along the edge leaving
|
|
8873
|
+
* corner 1, so `(0,0)` is corner 0, `(1,0)` corner 1, `(1,1)` corner 2 and
|
|
8874
|
+
* `(0,1)` corner 3 — the same walk `colors` is in.
|
|
8875
|
+
*/
|
|
8876
|
+
declare function evalPatch(patch: MeshPatch<unknown>, u: number, v: number): MeshPoint;
|
|
8877
|
+
/**
|
|
8878
|
+
* The four corner weights at `(u, v)` — bilinear, in the corner walk order.
|
|
8879
|
+
*
|
|
8880
|
+
* Color is separate from position on purpose: it interpolates in whatever
|
|
8881
|
+
* space the caller chose, which is not a thing the surface can do for it.
|
|
8882
|
+
*/
|
|
8883
|
+
declare function cornerWeights(u: number, v: number): [number, number, number, number];
|
|
8884
|
+
/** Axis-aligned bounds of a patch, sampled on a grid. Control points alone
|
|
8885
|
+
* bound a Bézier but not tightly, and a mesh paint is baked into a texture
|
|
8886
|
+
* sized from this — a loose box wastes texels on every side. */
|
|
8887
|
+
declare function patchBounds(patch: MeshPatch<unknown>, steps?: number): {
|
|
8888
|
+
x: number;
|
|
8889
|
+
y: number;
|
|
8890
|
+
width: number;
|
|
8891
|
+
height: number;
|
|
8892
|
+
};
|
|
8893
|
+
|
|
8894
|
+
/**
|
|
8895
|
+
* The `mesh-gradient` paint kind — PDF's shading types 6 and 7 as a registered
|
|
8896
|
+
* paint.
|
|
8897
|
+
*
|
|
8898
|
+
* A mesh gradient is a set of curved quadrilateral patches, each with a color
|
|
8899
|
+
* at every corner. It is the paint SVG tried to standardize as
|
|
8900
|
+
* `<meshgradient>` and abandoned, and the one PDF has had since 1993; what it
|
|
8901
|
+
* buys over the three gradients is a color field that bends, so a highlight
|
|
8902
|
+
* can follow a form instead of running straight across it.
|
|
8903
|
+
*
|
|
8904
|
+
* This is a registered kind rather than a sixth branch in the renderer, and
|
|
8905
|
+
* deliberately: it uses only the slots `registerPaintKind` gives a consumer, so
|
|
8906
|
+
* whatever it can do, a consumer's own kind can do too. Its one concession is
|
|
8907
|
+
* living in this package, because that is where the shader registry is.
|
|
8908
|
+
*
|
|
8909
|
+
* `docs/proposals/2026-09-17-paint-kinds-beyond-svg.md` is the design.
|
|
8910
|
+
*/
|
|
8911
|
+
|
|
8912
|
+
/**
|
|
8913
|
+
* A mesh gradient paint.
|
|
8914
|
+
*
|
|
8915
|
+
* `patches` are in the space `units` names, the same way a gradient's
|
|
8916
|
+
* geometry is — under `'bounds'` every point is a fraction of the painted
|
|
8917
|
+
* node's box, which is what lets the paint survive a resize.
|
|
8918
|
+
*
|
|
8919
|
+
* `interpolate` is the space corner colors blend through, matching the three
|
|
8920
|
+
* gradients. It is more visible here than there: a mesh blends in two
|
|
8921
|
+
* directions at once, so an sRGB blend's muddy middle covers area rather than
|
|
8922
|
+
* a line.
|
|
8923
|
+
*/
|
|
8924
|
+
interface MeshGradientFill {
|
|
8925
|
+
fill: 'mesh-gradient';
|
|
8926
|
+
patches: MeshPatch[];
|
|
8927
|
+
units?: GradientUnits;
|
|
8928
|
+
interpolate?: ColorSpace;
|
|
8929
|
+
opacity?: number;
|
|
8930
|
+
}
|
|
8931
|
+
/** The kind's id, as `FillStyle['fill']` carries it. */
|
|
8932
|
+
declare const MESH_GRADIENT_KIND = "mesh-gradient";
|
|
8933
|
+
/** A mesh paint, narrowed. */
|
|
8934
|
+
declare function isMeshGradientFill(fill: FillStyle | null | undefined): fill is FillStyle & MeshGradientFill;
|
|
8935
|
+
/** A one-patch square covering the unit box, its four corners four readings of
|
|
8936
|
+
* `color` — a mesh seeded from a solid has to show *something* curved, or
|
|
8937
|
+
* switching kind looks like nothing happened. */
|
|
8938
|
+
declare function seedMeshPatch(color: string): MeshGradientFill;
|
|
8939
|
+
/**
|
|
8940
|
+
* The `<defs>` entry for a mesh paint, in weasel's own namespace.
|
|
8941
|
+
*
|
|
8942
|
+
* Not SVG's abandoned `<meshgradient>`: that vocabulary only reaches Coons
|
|
8943
|
+
* patches, shares patch edges implicitly — a reader that gets the sharing
|
|
8944
|
+
* wrong tears the surface rather than failing outright — and has exactly one
|
|
8945
|
+
* implementation in the world. Ours writes every patch's points in full.
|
|
8946
|
+
* `@weasel-js/svg` puts the paint fallback color beside the reference, so a
|
|
8947
|
+
* foreign renderer paints flat instead of nothing.
|
|
8948
|
+
*/
|
|
8949
|
+
declare function meshGradientXml(id: string, mesh: MeshGradientFill): string;
|
|
8950
|
+
|
|
8951
|
+
/**
|
|
8952
|
+
* A mesh paint baked into one RGBA bitmap.
|
|
8953
|
+
*
|
|
8954
|
+
* A patch is a surface over `(u, v)`, but a paint has to answer "what color is
|
|
8955
|
+
* this fragment", which is the inverse question — and inverting a bicubic is
|
|
8956
|
+
* Newton iteration per fragment. Every renderer that draws these instead
|
|
8957
|
+
* subdivides the patch into small quads and rasterizes them forward, which is
|
|
8958
|
+
* what this does, once per paint, into a texture the shader then samples. The
|
|
8959
|
+
* cost is a texture and a resolution; the gain is that the paint composes with
|
|
8960
|
+
* every fill the renderer already knows how to draw, clipping included.
|
|
8961
|
+
*
|
|
8962
|
+
* The bitmap is straight (non-premultiplied) RGBA, matching the ramp atlas;
|
|
8963
|
+
* the fragment shader premultiplies.
|
|
8964
|
+
*/
|
|
8965
|
+
|
|
8966
|
+
/** Texels on a side of a baked mesh. A mesh gradient is smooth by
|
|
8967
|
+
* construction, so this is about how large it is drawn, not how detailed it
|
|
8968
|
+
* is; 256 covers a paint at typical shape sizes without a visible step. */
|
|
8969
|
+
declare const MESH_BAKE_SIZE = 256;
|
|
8970
|
+
/** The box a bake covers, in the paint's own space. */
|
|
8971
|
+
interface MeshBox {
|
|
8972
|
+
x: number;
|
|
8973
|
+
y: number;
|
|
8974
|
+
width: number;
|
|
8975
|
+
height: number;
|
|
8976
|
+
}
|
|
8977
|
+
interface BakedMesh {
|
|
8978
|
+
/** `MESH_BAKE_SIZE` square, straight RGBA. */
|
|
8979
|
+
pixels: Uint8ClampedArray;
|
|
8980
|
+
size: number;
|
|
8981
|
+
/** Where the bitmap sits in paint space, which is what the shader maps a
|
|
8982
|
+
* fragment through. */
|
|
8983
|
+
box: MeshBox;
|
|
8984
|
+
}
|
|
8985
|
+
/** The union of every patch's bounds, or `null` when nothing is drawable. */
|
|
8986
|
+
declare function meshBounds(patches: readonly MeshPatch[]): MeshBox | null;
|
|
8987
|
+
/**
|
|
8988
|
+
* Rasterize `patches` into a square bitmap covering their union.
|
|
8989
|
+
*
|
|
8990
|
+
* Returns `null` when no patch is drawable, which is the caller's cue to paint
|
|
8991
|
+
* nothing rather than a blank square.
|
|
8992
|
+
*/
|
|
8993
|
+
declare function bakeMesh(patches: readonly MeshPatch[], space?: ColorSpace, size?: number): BakedMesh | null;
|
|
8994
|
+
|
|
8597
8995
|
/**
|
|
8598
8996
|
* `TilePatternSpec` → `TextureHandle`. The bridge between the serializable
|
|
8599
8997
|
* half of a pattern paint and the GL texture that paints it.
|
|
@@ -8640,7 +9038,7 @@ declare function isGradientFill(fill: FillStyle | null | undefined): fill is Gra
|
|
|
8640
9038
|
*
|
|
8641
9039
|
* Returns transparent black for an empty list.
|
|
8642
9040
|
*/
|
|
8643
|
-
declare function sampleGradientStops(stops: readonly GradStop[], t: number): string;
|
|
9041
|
+
declare function sampleGradientStops(stops: readonly GradStop[], t: number, space?: ColorSpace): string;
|
|
8644
9042
|
/**
|
|
8645
9043
|
* Retarget a gradient to a different kind, preserving stops, `units` and
|
|
8646
9044
|
* `opacity`, and carrying the geometry across as faithfully as the kinds
|
|
@@ -9064,86 +9462,38 @@ type DerivePose<TPose> = (node: {
|
|
|
9064
9462
|
declare function unionOfChildrenVia<TPose>(descriptor: PoseDescriptor<TPose>): DerivePose<TPose>;
|
|
9065
9463
|
|
|
9066
9464
|
/**
|
|
9067
|
-
*
|
|
9068
|
-
* encoding behind move/line/curve/close calls and a final `build()`. Use
|
|
9069
|
-
* this to construct paths in tests and demos; production callers that need
|
|
9070
|
-
* to mutate large paths in place should reach for the raw arrays directly.
|
|
9465
|
+
* Ergonomic builders for tiny shape paths used by chrome / overlays / markers.
|
|
9071
9466
|
*
|
|
9072
|
-
*
|
|
9467
|
+
* These don't expand the `DrawCommand` union — they all return `PolygonPath`,
|
|
9468
|
+
* which `PathDrawCommand.path` already accepts. The wins are:
|
|
9469
|
+
* - One place owns the math (`circlePath`'s segment loop, `squarePath`'s
|
|
9470
|
+
* corner unrolling), so consumers don't reinvent it.
|
|
9471
|
+
* - Default segment counts can be tuned in one place if "circles look
|
|
9472
|
+
* facety" feedback ever surfaces.
|
|
9073
9473
|
*
|
|
9074
|
-
*
|
|
9075
|
-
*
|
|
9474
|
+
* Not appropriate for *user-drawn* shapes (those have a pose and live in the
|
|
9475
|
+
* scene). Use these for selection chrome, anchor markers, rubber-band rects,
|
|
9476
|
+
* and similar transient/decorative geometry.
|
|
9076
9477
|
*/
|
|
9077
9478
|
|
|
9078
|
-
/**
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
/** Cubic bezier to (x, y) with control points (x1, y1) and (x2, y2). */
|
|
9097
|
-
curveTo(x1: number, y1: number, x2: number, y2: number, x: number, y: number): this;
|
|
9098
|
-
/** Quadratic bezier to (x, y) with control point (x1, y1). */
|
|
9099
|
-
quadTo(x1: number, y1: number, x: number, y: number): this;
|
|
9100
|
-
close(): this;
|
|
9101
|
-
build(): PolygonPath;
|
|
9102
|
-
}
|
|
9103
|
-
/** Construct a `RectPath` (the fast-path subtype). */
|
|
9104
|
-
declare function rectPath(x: number, y: number, width: number, height: number): RectPath;
|
|
9105
|
-
/** Build an open polyline from a flat list of points — the same geometry as
|
|
9106
|
-
* {@link polygonFromPoints} without the closing edge. A freehand stroke and a
|
|
9107
|
-
* measurement line want this; a region wants the closed one. */
|
|
9108
|
-
declare function polylineFromPoints(points: readonly {
|
|
9109
|
-
x: number;
|
|
9110
|
-
y: number;
|
|
9111
|
-
}[]): PolygonPath | RectPath;
|
|
9112
|
-
/** Build a closed polygon from a flat list of points. */
|
|
9113
|
-
declare function polygonFromPoints(points: readonly {
|
|
9114
|
-
x: number;
|
|
9115
|
-
y: number;
|
|
9116
|
-
}[], opts?: {
|
|
9117
|
-
fillRule?: PathFillRule;
|
|
9118
|
-
}): PolygonPath;
|
|
9119
|
-
/** Closed ellipse inscribed in `bounds`, as a 4-cubic-Bezier `PolygonPath`.
|
|
9120
|
-
* Matches the geometry `useEllipseTool`'s overlay paints. */
|
|
9121
|
-
declare function ellipsePath(bounds: {
|
|
9122
|
-
x: number;
|
|
9123
|
-
y: number;
|
|
9124
|
-
width: number;
|
|
9125
|
-
height: number;
|
|
9126
|
-
}): PolygonPath;
|
|
9127
|
-
/** Closed regular n-gon centered at `center`, circumscribed by `radius`.
|
|
9128
|
-
* `rotation` is in radians; default 0 puts the first vertex on the +x axis. */
|
|
9129
|
-
declare function regularPolygonPath(center: {
|
|
9130
|
-
x: number;
|
|
9131
|
-
y: number;
|
|
9132
|
-
}, radius: number, sides: number, rotation?: number): PolygonPath;
|
|
9133
|
-
/** Closed n-pointed star centered at `center`, alternating `outerRadius` and
|
|
9134
|
-
* `innerRadius` (default `outerRadius / 2`). `rotation` is in radians. */
|
|
9135
|
-
declare function starPath(center: {
|
|
9136
|
-
x: number;
|
|
9137
|
-
y: number;
|
|
9138
|
-
}, outerRadius: number, points?: number, innerRadius?: number, rotation?: number): PolygonPath;
|
|
9139
|
-
/** Open 2-vertex polyline from `a` to `b` — strokeable, not fillable. */
|
|
9140
|
-
declare function linePath(a: {
|
|
9141
|
-
x: number;
|
|
9142
|
-
y: number;
|
|
9143
|
-
}, b: {
|
|
9144
|
-
x: number;
|
|
9145
|
-
y: number;
|
|
9146
|
-
}): PolygonPath;
|
|
9479
|
+
/**
|
|
9480
|
+
* N-segment polygon approximation of a circle. Default 32 segments → max
|
|
9481
|
+
* radial deviation of ≈0.005·r (≈0.05 px at r=10). Bump higher for large
|
|
9482
|
+
* filled circles where the facets become visible; the default is fine for
|
|
9483
|
+
* the handle-dot / anchor-dot scale we use everywhere.
|
|
9484
|
+
*/
|
|
9485
|
+
declare function circlePath(cx: number, cy: number, r: number, segments?: number): PolygonPath;
|
|
9486
|
+
/** Axis-aligned square centred at (cx, cy) with side length `size`. */
|
|
9487
|
+
declare function squarePath(cx: number, cy: number, size: number): PolygonPath;
|
|
9488
|
+
/** Axis-aligned rectangle. Top-left at (x, y), width/height as given. */
|
|
9489
|
+
declare function rectMarkerPath(x: number, y: number, width: number, height: number): PolygonPath;
|
|
9490
|
+
/**
|
|
9491
|
+
* Axis-aligned rounded rectangle. Top-left at (x, y); `r` is clamped to half
|
|
9492
|
+
* the shorter side. Each corner is `cornerSamples` line segments, matching
|
|
9493
|
+
* `circlePath`'s polygonal approximation — the default 8 gives the same
|
|
9494
|
+
* angular resolution as `circlePath`'s 32.
|
|
9495
|
+
*/
|
|
9496
|
+
declare function roundRectPath(x: number, y: number, width: number, height: number, r: number, cornerSamples?: number): PolygonPath;
|
|
9147
9497
|
|
|
9148
9498
|
/**
|
|
9149
9499
|
* AABB bounds of a `Path`. Returned as `RectPath` for direct reuse with the
|
|
@@ -9239,21 +9589,6 @@ interface PointInPathOptions {
|
|
|
9239
9589
|
/** Filled-region hit-test for a `Path`. Rect short-circuits to AABB; polygons run ray-cast / winding per `fillRule`. */
|
|
9240
9590
|
declare function pointInPath(path: Path, x: number, y: number, opts?: PointInPathOptions): boolean;
|
|
9241
9591
|
|
|
9242
|
-
/**
|
|
9243
|
-
* Polygon-vs-axis-aligned-rect tests. Pure functions; no React/kit deps.
|
|
9244
|
-
*
|
|
9245
|
-
* `polygon` is a closed polyline given as an ordered vertex array; the
|
|
9246
|
-
* closing edge from `polygon[N-1]` to `polygon[0]` is implicit. Even-odd fill
|
|
9247
|
-
* rule, and one contour only — a path with holes or curves goes through
|
|
9248
|
-
* `pathHitTest`, which reads its `fillRule`.
|
|
9249
|
-
*/
|
|
9250
|
-
|
|
9251
|
-
/** A 2D point or vector. */
|
|
9252
|
-
interface Vec2 {
|
|
9253
|
-
x: number;
|
|
9254
|
-
y: number;
|
|
9255
|
-
}
|
|
9256
|
-
|
|
9257
9592
|
/**
|
|
9258
9593
|
* Path-vs-geometry hit-test helpers. Five pure functions covering all
|
|
9259
9594
|
* combinations of path-vs-point, path-vs-rect, and path-vs-polygon.
|
|
@@ -9272,9 +9607,9 @@ declare function pathContainsRect(path: Path, rect: Rect, opts?: PointInPathOpti
|
|
|
9272
9607
|
/** Returns true if `rect` overlaps (intersects or contains) `path`. */
|
|
9273
9608
|
declare function pathIntersectsRect(path: Path, rect: Rect, opts?: PointInPathOptions): boolean;
|
|
9274
9609
|
/** Returns true if every vertex of `polygon` lies inside `path`. */
|
|
9275
|
-
declare function pathContainsPolygon(path: Path, polygon: readonly
|
|
9610
|
+
declare function pathContainsPolygon(path: Path, polygon: readonly Point2[], opts?: PointInPathOptions): boolean;
|
|
9276
9611
|
/** Returns true if `polygon` overlaps (intersects or is contained by) `path`. */
|
|
9277
|
-
declare function pathIntersectsPolygon(path: Path, polygon: readonly
|
|
9612
|
+
declare function pathIntersectsPolygon(path: Path, polygon: readonly Point2[], opts?: PointInPathOptions): boolean;
|
|
9278
9613
|
|
|
9279
9614
|
/**
|
|
9280
9615
|
* Pure-geometry distance from a point to a path's boundary (stroke), with
|
|
@@ -9298,35 +9633,6 @@ declare function pathIntersectsPolygon(path: Path, polygon: readonly Vec2[], opt
|
|
|
9298
9633
|
* combine with `pathContainsPoint` at the call site. */
|
|
9299
9634
|
declare function pathDistanceToPoint(path: Path, px: number, py: number): number;
|
|
9300
9635
|
|
|
9301
|
-
/**
|
|
9302
|
-
* A station along a path: where it is at a fraction of its length, and which
|
|
9303
|
-
* way it is heading there.
|
|
9304
|
-
*
|
|
9305
|
-
* For anything positioned *along* geometry rather than beside it — a label on a
|
|
9306
|
-
* routed edge, a tick on a curve, a badge near an arrowhead. Curves are
|
|
9307
|
-
* flattened first, so the fraction is arc length along the drawn shape rather
|
|
9308
|
-
* than a curve parameter, which is what makes 0.5 look like the middle.
|
|
9309
|
-
*/
|
|
9310
|
-
|
|
9311
|
-
interface PathStation {
|
|
9312
|
-
point: Vec2;
|
|
9313
|
-
/** Unit vector along the path at `point`, pointing toward the end. */
|
|
9314
|
-
tangent: Vec2;
|
|
9315
|
-
}
|
|
9316
|
-
interface PointAlongPathOptions {
|
|
9317
|
-
/** Curve flattening tolerance, in world units. Default 0.5. */
|
|
9318
|
-
flattenTolerance?: number;
|
|
9319
|
-
}
|
|
9320
|
-
/**
|
|
9321
|
-
* Where `path` is at `t` of its total length, and its heading there.
|
|
9322
|
-
*
|
|
9323
|
-
* `t` is clamped to 0..1. Subpaths are measured in order and treated as one
|
|
9324
|
-
* run, the way a browser measures a whole `<path>`. Returns `null` for a path
|
|
9325
|
-
* with no points at all; a path of zero length answers at its single point,
|
|
9326
|
-
* heading along +X.
|
|
9327
|
-
*/
|
|
9328
|
-
declare function pointAlongPath(path: Path, t: number, opts?: PointAlongPathOptions): PathStation | null;
|
|
9329
|
-
|
|
9330
9636
|
/**
|
|
9331
9637
|
* In-place and copy-out path transforms. Translation is the most common —
|
|
9332
9638
|
* called every pointermove during a drag — so the polygon variant mutates
|
|
@@ -9343,12 +9649,6 @@ declare function pointAlongPath(path: Path, t: number, opts?: PointAlongPathOpti
|
|
|
9343
9649
|
* predictable. Polygon coords are copied into a fresh `Float32Array`.
|
|
9344
9650
|
*/
|
|
9345
9651
|
declare function translatePath(path: Path, dx: number, dy: number): Path;
|
|
9346
|
-
/**
|
|
9347
|
-
* Translate a polygon path's coords *in place*. Returns the same
|
|
9348
|
-
* `PolygonPath` reference. Use only for transient overlay buffers — never
|
|
9349
|
-
* for committed scene state, which must remain immutable for React.
|
|
9350
|
-
*/
|
|
9351
|
-
declare function translatePolygonInPlace(path: PolygonPath, dx: number, dy: number): PolygonPath;
|
|
9352
9652
|
/**
|
|
9353
9653
|
* Scale a path's coords so its current AABB maps to `target`. Resize
|
|
9354
9654
|
* interactions use this to make a polygon follow a corner-handle drag.
|
|
@@ -9941,14 +10241,18 @@ interface PaintBindContext {
|
|
|
9941
10241
|
* an axis. Nothing the paint draws there means anything, so `bind` should
|
|
9942
10242
|
* return `null` and draw nothing.
|
|
9943
10243
|
*/
|
|
9944
|
-
spaceInverse(units: GradientUnits | undefined):
|
|
10244
|
+
spaceInverse(units: GradientUnits | undefined): GlMat3 | null;
|
|
9945
10245
|
/**
|
|
9946
10246
|
* Bake a stop ramp into the frame's ramp atlas, bind that atlas to a texture
|
|
9947
10247
|
* unit, and return the `v` the ramp's own row sits at — every ramp in a
|
|
9948
10248
|
* frame shares one texture, so a paint must sample at the returned `v` and
|
|
9949
10249
|
* not at a constant.
|
|
10250
|
+
*
|
|
10251
|
+
* `space` is the blend the stops are baked through, defaulting to `'rgb'`.
|
|
10252
|
+
* It is part of the atlas key, so the same stops under two spaces take two
|
|
10253
|
+
* rows rather than colliding.
|
|
9950
10254
|
*/
|
|
9951
|
-
bindRamp(stops: GradStop[], unit: number): number;
|
|
10255
|
+
bindRamp(stops: GradStop[], unit: number, space?: ColorSpace): number;
|
|
9952
10256
|
}
|
|
9953
10257
|
/**
|
|
9954
10258
|
* One paint kind.
|
|
@@ -9987,7 +10291,15 @@ interface PaintKindEntry {
|
|
|
9987
10291
|
inPoseFrame?(fill: FillStyle, box: FillPoseBox): FillStyle;
|
|
9988
10292
|
/** The inverse. Required whenever `inPoseFrame` is supplied. */
|
|
9989
10293
|
toBoundsFrame?(fill: FillStyle, box: FillPoseBox): FillStyle;
|
|
9990
|
-
/**
|
|
10294
|
+
/**
|
|
10295
|
+
* The `<defs>` entry backing a `url(#id)` reference.
|
|
10296
|
+
*
|
|
10297
|
+
* SVG has paint servers for two gradients and a pattern and nothing else, so
|
|
10298
|
+
* a kind beyond those has no element to target: write a foreign-namespaced
|
|
10299
|
+
* one under the `wzl:` prefix `@weasel-js/svg` declares on the root whenever
|
|
10300
|
+
* a document holds such a paint. That package emits the fallback color
|
|
10301
|
+
* beside the reference on its own, from `colorOf`.
|
|
10302
|
+
*/
|
|
9991
10303
|
toSvg?(id: string, fill: FillStyle): string;
|
|
9992
10304
|
}
|
|
9993
10305
|
/**
|
|
@@ -10559,32 +10871,6 @@ declare function alignInsertBehavior<TPose>(args: AlignmentBehaviorBase): Insert
|
|
|
10559
10871
|
* candidates. The pinned (anchor) edge stays fixed. Publishes the line(s). */
|
|
10560
10872
|
declare function alignResizeBehavior<TPose extends Bounds>(args: AlignmentBehaviorBase): BoundsConstraint<TPose>;
|
|
10561
10873
|
|
|
10562
|
-
/** AABB center of an unrotated rect — the canonical rotation pivot. */
|
|
10563
|
-
declare function aabbCenter(bounds: Bounds): {
|
|
10564
|
-
x: number;
|
|
10565
|
-
y: number;
|
|
10566
|
-
};
|
|
10567
|
-
/** Rotate `(px, py)` by `angle` (radians) around `(cx, cy)`. */
|
|
10568
|
-
declare function rotatePoint(px: number, py: number, cx: number, cy: number, angle: number): {
|
|
10569
|
-
x: number;
|
|
10570
|
-
y: number;
|
|
10571
|
-
};
|
|
10572
|
-
/** Four corners of an unrotated rect, in TL/TR/BR/BL order. */
|
|
10573
|
-
declare function rectCorners(bounds: Bounds): {
|
|
10574
|
-
x: number;
|
|
10575
|
-
y: number;
|
|
10576
|
-
}[];
|
|
10577
|
-
/** Four corners of a rotated rect (rotation around AABB center), in
|
|
10578
|
-
* TL/TR/BR/BL order. Useful for selection-overlay rendering. */
|
|
10579
|
-
declare function rotatedRectCorners(pose: RotatedPose): {
|
|
10580
|
-
x: number;
|
|
10581
|
-
y: number;
|
|
10582
|
-
}[];
|
|
10583
|
-
/** Hit-test a world point against a rotated rect (rotation around AABB
|
|
10584
|
-
* center). Standard pattern: invert the rotation and AABB-test in the
|
|
10585
|
-
* rect's local frame. */
|
|
10586
|
-
declare function pointInRotatedRect(pose: RotatedPose, worldX: number, worldY: number): boolean;
|
|
10587
|
-
|
|
10588
10874
|
/** Default world-space distance from the rect's top edge to the rotation
|
|
10589
10875
|
* handle's center. Matches the demo's visual default; consumers can
|
|
10590
10876
|
* override per-call. Unscaled — kit-internal use sites multiply by
|
|
@@ -11232,35 +11518,34 @@ interface MomentumOptions {
|
|
|
11232
11518
|
*/
|
|
11233
11519
|
declare function momentum<TPose>(opts: MomentumOptions): MoveBehavior<TPose>;
|
|
11234
11520
|
|
|
11235
|
-
/**
|
|
11236
|
-
|
|
11237
|
-
|
|
11238
|
-
|
|
11239
|
-
|
|
11240
|
-
|
|
11241
|
-
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
*
|
|
11250
|
-
*
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
|
|
11258
|
-
*
|
|
11259
|
-
|
|
11260
|
-
|
|
11261
|
-
|
|
11262
|
-
|
|
11263
|
-
declare function lerpColorArray(from: readonly number[], to: readonly number[], t: number, space?: ColorSpace): number[];
|
|
11521
|
+
/** Most a slewed value may change per second, in its own units, in each
|
|
11522
|
+
* direction. A direction left out is unlimited: the value jumps to a target
|
|
11523
|
+
* on that side. `0` holds the value where it is. */
|
|
11524
|
+
interface SlewRates {
|
|
11525
|
+
rise?: number;
|
|
11526
|
+
fall?: number;
|
|
11527
|
+
}
|
|
11528
|
+
/**
|
|
11529
|
+
* One step of a slew limiter: `value` moved toward `target` by at most the
|
|
11530
|
+
* rate for that direction times `dt` seconds, landing on `target` rather than
|
|
11531
|
+
* passing it. A fast `rise` with a slow `fall` is an attack/release envelope.
|
|
11532
|
+
*/
|
|
11533
|
+
declare function slewToward(value: number, target: number, dt: number, rates: SlewRates): number;
|
|
11534
|
+
/** A value that follows `target` at limited rates. Both fields are writable:
|
|
11535
|
+
* set `target` to steer it, or write `value` to jump it and let it slew on
|
|
11536
|
+
* from there. Nothing moves until `step` is called. */
|
|
11537
|
+
interface Slew {
|
|
11538
|
+
value: number;
|
|
11539
|
+
target: number;
|
|
11540
|
+
/** Advance `dt` seconds and return the new value. */
|
|
11541
|
+
step(dt: number): number;
|
|
11542
|
+
}
|
|
11543
|
+
/** A stateful {@link slewToward}. `target` defaults to `value`, so a new slew
|
|
11544
|
+
* is at rest. */
|
|
11545
|
+
declare function createSlew(options?: SlewRates & {
|
|
11546
|
+
value?: number;
|
|
11547
|
+
target?: number;
|
|
11548
|
+
}): Slew;
|
|
11264
11549
|
|
|
11265
11550
|
/**
|
|
11266
11551
|
* Color interpolator: receives two flat RGBA float arrays (values in
|
|
@@ -11434,6 +11719,77 @@ declare const IDENTITY_JOINT: JointTransform;
|
|
|
11434
11719
|
*/
|
|
11435
11720
|
declare function blendPoses(poses: Pose[], weights: number[]): Pose;
|
|
11436
11721
|
|
|
11722
|
+
/** The part of a scene a rig writes to. */
|
|
11723
|
+
interface RigScene<TPose> {
|
|
11724
|
+
get(id: NodeId): {
|
|
11725
|
+
pose: TPose;
|
|
11726
|
+
} | undefined;
|
|
11727
|
+
readonly overrides: PoseOverrides<TPose>;
|
|
11728
|
+
setPose(id: NodeId, pose: TPose): void;
|
|
11729
|
+
batch<T>(label: string, fn: () => T): T;
|
|
11730
|
+
}
|
|
11731
|
+
interface RigApplyContext<TPose> {
|
|
11732
|
+
joint: string;
|
|
11733
|
+
node: NodeId;
|
|
11734
|
+
/** The node's document pose when the rig was bound — where it sits at the
|
|
11735
|
+
* bind pose. */
|
|
11736
|
+
rest: TPose;
|
|
11737
|
+
/** The joint's world transform at the bind pose. */
|
|
11738
|
+
restWorld: GlMat3;
|
|
11739
|
+
/** `world * inverse(restWorld)`: the motion since the bind pose, in world
|
|
11740
|
+
* space. Carrying `rest` by it is what welding the node to the joint means. */
|
|
11741
|
+
fromRest: GlMat3;
|
|
11742
|
+
}
|
|
11743
|
+
/** Turns a joint's world transform into a pose for one bound node. The only
|
|
11744
|
+
* part of a rig that knows the scene's pose shape. */
|
|
11745
|
+
type RigApply<TPose> = (world: GlMat3, ctx: RigApplyContext<TPose>) => TPose;
|
|
11746
|
+
interface BindRigOptions<TPose> {
|
|
11747
|
+
scene: RigScene<TPose>;
|
|
11748
|
+
skeleton: Skeleton;
|
|
11749
|
+
/** Joint name → the node or nodes that ride it. Each node keeps the offset
|
|
11750
|
+
* from its joint that it has at the bind pose. */
|
|
11751
|
+
bindings: Readonly<Record<string, NodeId | readonly NodeId[]>>;
|
|
11752
|
+
/** Default: {@link rigidRigApply} over `descriptor`. */
|
|
11753
|
+
apply?: RigApply<TPose>;
|
|
11754
|
+
/** The descriptor the default `apply` reads and writes poses through.
|
|
11755
|
+
* Default `AUTO_POSE_DESCRIPTOR`. */
|
|
11756
|
+
descriptor?: PoseDescriptor<TPose>;
|
|
11757
|
+
}
|
|
11758
|
+
interface Rig {
|
|
11759
|
+
readonly skeleton: Skeleton;
|
|
11760
|
+
/**
|
|
11761
|
+
* Resolve `pose` and move every bound node to it, through the scene's pose
|
|
11762
|
+
* overrides — no history entry, no document write, no version bump — then
|
|
11763
|
+
* commit them. The per-frame write. `root` places the rig in the world, and
|
|
11764
|
+
* may mirror it.
|
|
11765
|
+
*/
|
|
11766
|
+
pose(pose: Pose, root?: GlMat3): void;
|
|
11767
|
+
/** The joint world transforms the last `pose` resolved, root applied. */
|
|
11768
|
+
world(): ReadonlyMap<string, GlMat3>;
|
|
11769
|
+
/** Write the current frame into the bound nodes' document poses as one
|
|
11770
|
+
* undo entry, and drop the overrides. Later frames stay relative to the
|
|
11771
|
+
* bind-time rest, so baking does not compound. */
|
|
11772
|
+
bake(label?: string): void;
|
|
11773
|
+
/** Drop the overrides; the nodes show their document poses again until the
|
|
11774
|
+
* next `pose`. */
|
|
11775
|
+
release(): void;
|
|
11776
|
+
}
|
|
11777
|
+
/**
|
|
11778
|
+
* Carries a node rigidly with its joint: the rest pose's center moves by
|
|
11779
|
+
* `fromRest`, and its rotation turns with the rest pose's x-axis. Scale in the
|
|
11780
|
+
* joint chain moves positions but not sizes — the pose model holds no shear,
|
|
11781
|
+
* and a sized pose under anisotropic scale would need one. Write an `apply`
|
|
11782
|
+
* that reads `world` to size nodes from joint scale.
|
|
11783
|
+
*/
|
|
11784
|
+
declare function rigidRigApply<TPose>(descriptor: PoseDescriptor<TPose>): RigApply<TPose>;
|
|
11785
|
+
/**
|
|
11786
|
+
* Bind a skeleton's joints to scene nodes. Nodes are written in world space
|
|
11787
|
+
* and the rig resolves its own hierarchy, so bound nodes are best left
|
|
11788
|
+
* unparented, or under containers whose pose does not compose into theirs;
|
|
11789
|
+
* the scene's tree stays free to order and group them for drawing.
|
|
11790
|
+
*/
|
|
11791
|
+
declare function bindRig<TPose>(options: BindRigOptions<TPose>): Rig;
|
|
11792
|
+
|
|
11437
11793
|
/**
|
|
11438
11794
|
* Resolve every joint's world transform by walking the skeleton once and
|
|
11439
11795
|
* composing each joint onto its already-resolved parent.
|
|
@@ -11443,7 +11799,14 @@ declare function blendPoses(poses: Pose[], weights: number[]): Pose;
|
|
|
11443
11799
|
* because that failure is otherwise invisible until a limb renders in the wrong
|
|
11444
11800
|
* place.
|
|
11445
11801
|
*/
|
|
11446
|
-
declare function resolveSkeleton(skeleton: Skeleton, pose: Pose): Map<string,
|
|
11802
|
+
declare function resolveSkeleton(skeleton: Skeleton, pose: Pose): Map<string, GlMat3>;
|
|
11803
|
+
|
|
11804
|
+
/**
|
|
11805
|
+
* A {@link Rig} bound for the component's lifetime, its overrides dropped on
|
|
11806
|
+
* unmount. Rebinds — re-reading every node's rest pose — whenever an option's
|
|
11807
|
+
* identity changes, so hoist or memoize `skeleton` and `bindings`.
|
|
11808
|
+
*/
|
|
11809
|
+
declare function useRig<TPose>(options: BindRigOptions<TPose>): Rig;
|
|
11447
11810
|
|
|
11448
11811
|
/** Snap policy that never picks a target — every drop is rejected, which is
|
|
11449
11812
|
* what a free-form container wants. */
|
|
@@ -11505,10 +11868,24 @@ interface TileGridOptions<TPose> {
|
|
|
11505
11868
|
width: number;
|
|
11506
11869
|
height: number;
|
|
11507
11870
|
}, dragged: TPose): TPose;
|
|
11871
|
+
/** Optional: the point that decides which cell a child occupies — a child
|
|
11872
|
+
* occupies the cell containing it. Default reads `x`/`y` plus half of
|
|
11873
|
+
* `width`/`height` when the pose has them, which is the center of a
|
|
11874
|
+
* `RectPose` and the point itself for a point pose. */
|
|
11875
|
+
centerOf?(pose: TPose): {
|
|
11876
|
+
x: number;
|
|
11877
|
+
y: number;
|
|
11878
|
+
};
|
|
11508
11879
|
}
|
|
11509
|
-
/**
|
|
11510
|
-
*
|
|
11511
|
-
*
|
|
11880
|
+
/**
|
|
11881
|
+
* Layout strategy that arranges children into a fixed grid of cells, one
|
|
11882
|
+
* child per cell, and the container holds at most `cols × rows` children.
|
|
11883
|
+
*
|
|
11884
|
+
* A child occupies the cell its pose sits in (see `centerOf`). A drag from
|
|
11885
|
+
* inside the container swaps with the child in the cell it lands on; a drop
|
|
11886
|
+
* from outside is offered only the free cells, so it lands in the nearest
|
|
11887
|
+
* free one and a full grid rejects it.
|
|
11888
|
+
*/
|
|
11512
11889
|
declare function tileGrid<TPose>(opts: TileGridOptions<TPose>): LayoutStrategy<TPose>;
|
|
11513
11890
|
|
|
11514
11891
|
/** Which points within a container a child can snap to. */
|
|
@@ -11522,15 +11899,10 @@ interface SnapPointOptions<TPose> {
|
|
|
11522
11899
|
tolerance?: number;
|
|
11523
11900
|
snap?: LayoutSnap<TPose>;
|
|
11524
11901
|
}
|
|
11525
|
-
/** A point in world coordinates. */
|
|
11526
|
-
type Pt = {
|
|
11527
|
-
x: number;
|
|
11528
|
-
y: number;
|
|
11529
|
-
};
|
|
11530
11902
|
/** Layout strategy that leaves children where they are but offers a fixed set
|
|
11531
11903
|
* of points — corners, edge midpoints, center, or a grid — for a dragged
|
|
11532
11904
|
* child to land on. */
|
|
11533
|
-
declare function snapPoint<TPose extends
|
|
11905
|
+
declare function snapPoint<TPose extends Point2>(opts: SnapPointOptions<TPose>): LayoutStrategy<TPose>;
|
|
11534
11906
|
|
|
11535
11907
|
/**
|
|
11536
11908
|
* Parse a CSS color string into [r, g, b, a] with 0..1 components.
|
|
@@ -11699,4 +12071,4 @@ interface InsertOverlayStyle {
|
|
|
11699
12071
|
lineWidth?: number;
|
|
11700
12072
|
}
|
|
11701
12073
|
|
|
11702
|
-
export { ANCHOR_HIT_BASE_PX, type ActionShortcut, ActionsProviderIfRoot, type Affordance, type AffordanceBinding, type AffordanceRegion, type AffordanceRegionHit, type AlignAdapter, type AlignAnchor, type AlignEdge, type AlignMatchResult, type AlignMoveArgs, type AlignmentBehaviorBase, type AnchorHit, type AnchorScratch, type AnchorState, type AnimateOnSetPoseOptions, AnimationHandle, Animator, type AnyTool, AreaSelectAdapter, type ArrayAdapter, type ArrayAdapterConfig, ArrowIcon, BUILTIN_MARKERS, BUNDLE_TOOLS, BooleansAdapter, BoundsConstraint, 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 ColorSpace, type CommonAffordanceScratch, type ComposeSelectionPoseOpts, type ComputeFitViewOptions, type Condition, ContentHandlerEntry, type Contribution, type ContributionChrome, type CornerResizeAffordanceOptions, type CornerResizeScratch, type CreateChildrenLayerOpts, type CreateParallaxLayerOpts, type CreatePathEditingOverlayLayerOptions, type CreatePathLayerOpts, type CreatePenPreviewLayerOptions, type CreateTextLayerOpts, type CreateViewResolverOpts, type CreateViewportLayerOpts, CropIcon, CursorCoordsHud, type CursorCoordsHudProps, type CurveRepKind, type CurveRepresentation, type CustomLayerEntry, type CustomPaintContext, type CycleHandle, type CycleVertexColorsOptions, DEFAULT_ALPHA_DECAY, DEFAULT_ALPHA_MIN, 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, DEFAULT_VELOCITY_DECAY, type DebugConfig, type DebugFeature, type DebugSnapshot, type DebugStroke, type DebugStrokes, type DebugTheme, type DefaultTextData, DepRegistryProviderIfRoot, type DeriveAlignmentGuidesOptions, DerivedDep, DeviceProfileProvider, type DeviceProfileProviderProps, type Dims, type Discriminator, type DistributeAdapter, type DistributeAxis, type DistributeMode, 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, EasingSpec, Effect, EllipseIcon, ExcludeIcon, EyedropperIcon, FALLBACK_FIT_VIEW, type FeedDelta, type FeedNode, type FillPoseBox, type FitTextPoseOptions, type FlagKey, type FreeformOptions, GHOST_STROKE, type GateLayerOptions, GeometryProjection, type GesturePreviewSource, type GestureSource, type GridLayerOpts, type GridSlotConfig, 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 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 LabelOptions, LassoHitMode, LassoIcon, LassoSelectAdapter, LassoSelectBehavior, type LayerCommandCache, type LayerDrawFailure, LayerEnumerableAdapter, type LayerGroup, type LayerHit, type LayerSlotValue, type LayersMap, LayoutSnap, LayoutStrategy, type LifecycleAnimation, LineIcon, type LinePoint, MIXED, MOVE_ANCHORS, type MarkerCtx, type MarkerEntry, type MarkerPaint, type MarkerSite, type MarkerSiteRequest, Mat3$1 as Mat3, 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, Path, type PathAnchor, type PathAnchorAffordanceOptions, PathBuilder, PathDrawCommand, type PathEditingOverlayStyle, PathFillRule, type PathInWorldPose, type PathStation, type PenAnchor, PenIcon, type PenPreviewStyle, type PenScratch, type PenSubpath, PencilIcon, type PencilPoint, PickHud, type PickHudProps, type PickTopMostHitAdapter, type PinchZoomOptions, type PixelRenderPlan, type PointAlongPathOptions, 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, type Pt, ROTATION_HANDLE_BASE_PX, type RangeStyle, type RasterImage, type RecordedBounds, type RecordedHandle, type RecordedHitbox, type RecordedLayer, type RecordedOrigin, type RecordedSnap, RectIcon, RectPath, RectPose, type RegisterNodeShapeOptions, RegisteredOp, type RenderLayer, type RenderSceneToCanvasArgs, type RenderSceneToPixelsArgs, type ReorderDirection, ResizeAdapter, type ResolvableView, type ResolvedOverlay, 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, SerializedScene, type SetFlagResult, type SetPathFields, ShaderProgramHandle, type ShapeCoversPointOptions, type SharedAnchor, type Simulation, type SimulationCore, type SimulationForce, type SimulationNode, type SimulationOptions, type Skeleton, 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 TileGridOptions, type TilePatternOpts, 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, UnionIcon, Unit, 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 UseKeybindingsOptions, type UseLassoSelectOptions, type UseLassoToolOptions, UseMoveOptions, type UseNodeOverlayFrameOptions, type UsePenToolOptions, type UsePointerStylusOptions, type UsePolygonToolOptions, type UsePoseRunOptions, UseResizeOptions, type UseResizePolicyOptions, type UseRotateOptions, type UseRotateToolOptions, UseSceneOptions, type UseSceneTextEditOptions, type UseSceneTextEditReturn, type UseSceneTrivialOptions, type UseSelectToolOptions, type UseSelectionOptions, type UseSimulationOptions, type UseStandardActionsOptions, type UseStarToolOptions, type UseTextEditOptions, type UseTextEditReturn, type UseToolsOptions, VERSION, type Vec2, 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, aabbCenter, actionIs, actionShortcuts, alignDeltaFor, alignInsertBehavior, alignMoveBehavior, alignResizeBehavior, always, and, animateLifecycle, animateOnSetPose, annulusSemiAxes, applyOpsTo, applyStyleToRange, areaSelectAction, arrayAdapter, asPaint, axisAlignedBounds, bezierCubic, bezierQuadratic, blendPoses, boundsOfPath, buildChromeCtx, buildSceneViewCommands, canBringForward, canHover, canSendBackward, capabilityAll, capabilityIn, capabilityIs, capabilityNot, caretIndexAt, cellAt, charOffsetToDomPosition, clampView, clearSelectionAction, clipboardCopyAction, clipboardCutAction, cloneAction, coarsePointer, composeAffordanceLayer, composePath, composeSelectionPose, computeFitView, computeFitViewport, computeIndicatorCommand, computeWheelAction, cond, constrainTo45, containedThenNearest, countPathAnchors, createCellHighlightLayer, createChildrenLayer, createCornerResizeAffordance, createDebugOverlayLayer, createDebugSink, createDeleteOp, createGridLayer, createGuidesLayer, createHistory, createInsertOp, createMoveToIndexOp, createNodeProperties, createNodeRouting, createPaintedCursorLayer, createParallaxLayer, createPathAnchorAffordances, createPathEditingOverlayLayer, createPathLayer, createPenPreviewLayer, createPoseFeed, createPoseOverrides, createReorderOp, createReparentOp, createRotationAffordance, createScene, createSelectionHandlesLayer, createSelectionOutlineLayer, createSelectionOverlayLayer, createSetDataOp, createSetLayerOp, createSetPathOp, createSetSelectionOp, createSetTextOp, createSimulation, createTextLayer, createTilePattern, createTransformOp, createVelocityTracker, createViewResolver, createViewportLayer, cycleVertexColors, decomposePath, defaultCommitAdapter, defaultDrawOne, defaultLabelTextRenderer, defaultNodeProperties, defaultNodeRouting, defaultVisibilityRules, defineTool, defineViewportTool, deriveAlignmentGuides, deriveParallaxView, derivedDepOf, derivedPose, dispatchApplyBatch, dlog, documentPose, domPositionToCharOffset, domToRuns, drawLayers, drawOneLayer, dwarn, editAnchorsAction, effectivePose, ellipsePath, enterTextEditAction, enumerateAnchors, 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, isPatternSpec, keySpecShortcut, lassoSelectAction, lerpColorArray, lerpOklab, lerpOklch, linePath, listMarkers, listPaintKinds, makePinchZoomAction, makeViewportWheelPanAction, makeViewportZoomAction, markerDrawCommands, markerInset, markerKeyOf, markerSites, matchAlignment, meanScale, mergeAlphaFromPrev, modeIn, modeIs, modeNot, modifierHeld, momentum, moveAction, multiActive, nearest, nearestWithin, nestedHitTester, never, nodeHasFlag, none, normalizeHex, normalizeView, normalizeZoom, not, nurbs, oklabToOklch, oklabToSrgbU8, oklchToOklab, openFilePicker, or, paintAlpha, paintKindOf, paintWithAlpha, paintWithColor, parseColor, parseColorToRgba255, parseDebugFlags, pathContainsPoint, pathContainsPolygon, pathContainsRect, pathDistanceToPoint, pathDivide, pathExclude, pathFromD, pathInPoseFrame, pathInWorld, pathIntersect, pathIntersectsPolygon, pathIntersectsRect, pathOriginProjection, pathPoseDescriptor, pathSubtract, pathToAnchors, pathUnion, pickTopMostHit, pinchZoomAction, planPixelRender, pointAlongPath, pointInPath, pointInRotatedRect, pointInTextPose, polygonFromPoints, polylineFromPoints, poseRotationOf, prefUnit, pressureToWidth, pxExtent, rainbowVertexColors, rebuildOp, rectCorners, rectPath, registerMarker, registerNodeShape, registerOpFactory, registerPaintKind, registeredOpNames, regularPolygonPath, renderLabel, renderSceneToCanvas, renderSceneToPixels, resizeAction, resolveColor, resolveFillPattern, resolveMarkerSize, resolveOverlays, resolvePatternSpec, resolvePreviews, resolveSkeleton, resolveVisibility, rgbaToHex, rotateAction, rotateAroundAABBCenter, rotatePathAround, rotatePoint, rotatedRectCorners, rotationDegreesUnit, rotationHandle, roundToCell, runsToDom, sampleGradientStops, sampleTrack, scaleDelta, scalePathToBounds, sceneFromJSON, sceneNodeClientRect, sceneSelectionStore, sceneToAdapter, screenToWorld, selectFromLasso, selectionAtLeast, selectionEmpty, selectionIs, setFlagOverRange, shapeCoversPoint, sliceAction, snap, snapPoint, solid, solidVertexColors, spiro, splitPathByLine, splitSubpaths, springPose, springVertexColors, srgbU8ToOklab, staggerVertexColors, starPath, startThresholdDrag, strokeInsets, strokeOf, strokeWith, styleAtRange, subscribeImageReady, textCommand, textCommandFromPose, textCommandFromRuns, tileGrid, toHex8, transformPath, translatePath, translatePolygonInPlace, 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, useKeybindings, useLassoTool, useLineTool, useNodeOverlayFrame, usePenTool, usePencilTool, usePinchGesture, usePointerStylus, usePolygonTool, usePoseCompositionDepSource, usePoseDescriptorDepSource, usePoseRun, usePublishSelection, useRectTool, useResizePolicy, useRotateTool, 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 };
|
|
12074
|
+
export { ANCHOR_HIT_BASE_PX, type ActionShortcut, ActionsProviderIfRoot, type Affordance, type AffordanceBinding, type AffordanceRegion, type AffordanceRegionHit, type AlignAdapter, type AlignAnchor, type AlignEdge, type AlignMatchResult, type AlignMoveArgs, 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, 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, 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, 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, DepRegistryProviderIfRoot, type DeriveAlignmentGuidesOptions, DerivedDep, DeviceProfileProvider, type DeviceProfileProviderProps, type Dims, type Discriminator, type DistributeAdapter, type DistributeAxis, type DistributeMode, 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, EasingSpec, Effect, EllipseIcon, ExcludeIcon, EyedropperIcon, FALLBACK_FIT_VIEW, type FeedDelta, type FeedNode, type FillPoseBox, type FitTextPoseOptions, type FlagKey, type FreeformOptions, GHOST_STROKE, type GateLayerOptions, GeometryProjection, type GesturePreviewSource, type GestureSource, GlMat3, type GridLayerOpts, type GridSlotConfig, 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 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, 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, 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, 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, SerializedScene, type SetFlagResult, type SetPathFields, ShaderProgramHandle, type ShapeCoversPointOptions, 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, 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, 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, cycleVertexColors, decomposePath, defaultCommitAdapter, defaultDrawOne, defaultLabelTextRenderer, defaultNodeProperties, defaultNodeRouting, defaultVisibilityRules, defineTool, defineViewportTool, 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, 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 };
|