@weasel-js/core 1.0.2 → 1.0.4
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 +208 -0
- package/dist/{DrawCommand-DCmiNkBj.d.ts → DrawCommand-BbPrSTra.d.ts} +24 -0
- package/dist/{chunk-6SHZHXXR.js → chunk-4Z6J4IVH.js} +43 -27
- package/dist/chunk-4Z6J4IVH.js.map +1 -0
- package/dist/{chunk-PI56ORHE.js → chunk-AYGSXNY3.js} +540 -263
- package/dist/chunk-AYGSXNY3.js.map +1 -0
- package/dist/{chunk-UB6A6L77.js → chunk-CSMF654J.js} +3 -3
- package/dist/{chunk-UB6A6L77.js.map → chunk-CSMF654J.js.map} +1 -1
- package/dist/{chunk-IO5Z75X4.js → chunk-HGF5X6MZ.js} +2 -2
- package/dist/chunk-HGF5X6MZ.js.map +1 -0
- package/dist/{chunk-W2WB4352.js → chunk-J3YC3GVF.js} +5 -4
- package/dist/chunk-J3YC3GVF.js.map +1 -0
- package/dist/{chunk-Z3KNFTTS.js → chunk-J7LUY47N.js} +3 -3
- package/dist/chunk-J7LUY47N.js.map +1 -0
- package/dist/{chunk-775XXAHR.js → chunk-JOSUVS6C.js} +2 -2
- package/dist/{chunk-775XXAHR.js.map → chunk-JOSUVS6C.js.map} +1 -1
- package/dist/clipboard.d.ts +5 -2
- package/dist/clipboard.js +1 -1
- package/dist/clone.d.ts +2 -2
- package/dist/{geometry-CnISZ11w.d.ts → geometry-5X6TrAkX.d.ts} +1 -1
- package/dist/{grid-CBiLBnyc.d.ts → grid-sfilv5HP.d.ts} +7 -2
- package/dist/index.d.ts +552 -56
- package/dist/index.js +7 -7
- package/dist/insert.d.ts +6 -3
- package/dist/insert.js +1 -1
- package/dist/insert.js.map +1 -1
- package/dist/move.d.ts +26 -5
- package/dist/move.js +3 -3
- package/dist/move.js.map +1 -1
- package/dist/{options-DoOvx50U.d.ts → options-CbsIgQci.d.ts} +3 -1
- package/dist/patterns-builtin.d.ts +8 -0
- package/dist/patterns-builtin.js +1 -1
- package/dist/{pointSnapToGrid-Bj4r_lEQ.d.ts → pointSnapToGrid-C3wowsQy.d.ts} +9 -3
- package/dist/{registry-BQL4oyTg.d.ts → registry-QRg8KiNM.d.ts} +91 -7
- package/dist/renderer.d.ts +54 -17
- package/dist/renderer.js +7 -7
- package/dist/resize.d.ts +12 -5
- package/dist/resize.js +2 -2
- package/dist/routing.d.ts +7 -7
- package/dist/routing.js +1 -1
- package/dist/{types-Dtxe7jTS.d.ts → types-BHK2dkMu.d.ts} +23 -0
- package/dist/{types-Ct4n0Z38.d.ts → types-ByZxoD6P.d.ts} +1 -1
- package/dist/{types-Ch0Goo-j.d.ts → types-DpQ0cWYC.d.ts} +20 -0
- package/dist/{types-Kh_osAq9.d.ts → types-vqxpCFVp.d.ts} +31 -0
- package/dist/{viewToMat3-BvaWCN99.d.ts → viewToMat3-CQW_YqDw.d.ts} +1 -1
- package/package.json +6 -6
- package/dist/chunk-6SHZHXXR.js.map +0 -1
- package/dist/chunk-IO5Z75X4.js.map +0 -1
- package/dist/chunk-PI56ORHE.js.map +0 -1
- package/dist/chunk-W2WB4352.js.map +0 -1
- package/dist/chunk-Z3KNFTTS.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,40 +2,40 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import React__default, { RefObject, ReactNode, Ref, MouseEvent as MouseEvent$1, MutableRefObject } from 'react';
|
|
3
3
|
import { a as ViewTransform, V as View, Z as ZoomBound, b as ZoomFactor } from './view-DSQgxBJB.js';
|
|
4
4
|
export { s as screenToWorld, v as viewToTransform, w as worldToScreen } from './view-DSQgxBJB.js';
|
|
5
|
-
import { a as UnitValue, b as UnitSystem, U as UseMoveOptions, O as OriginProjection } from './grid-
|
|
6
|
-
export { I as IMPERIAL_INCHES, M as METRIC_MM, P as PIXELS, R as RECT_ORIGIN_PROJECTION, c as Unit, f as formatUnit, g as gridSnapStrategy, p as pointToGridCell, r as resolveUnit } from './grid-
|
|
7
|
-
import { R as RenderLayer, D as Dims, a as DeviceProfile, b as DetectedDeviceFacts, C as Condition, c as Rule, d as RuleCtx, V as VisibilityRules, e as ChromeCtx, f as ChromeId, A as Action, g as DepSchema, S as SliceDep, h as ActionsRegistry, T as Tool, i as AffordanceHit, j as Dispatcher, k as ToolDef, l as ViewportToolDef, m as AnyTool, O as OverlayPosition, n as
|
|
8
|
-
export {
|
|
5
|
+
import { a as UnitValue, b as UnitSystem, U as UseMoveOptions, O as OriginProjection } from './grid-sfilv5HP.js';
|
|
6
|
+
export { I as IMPERIAL_INCHES, M as METRIC_MM, P as PIXELS, R as RECT_ORIGIN_PROJECTION, c as Unit, f as formatUnit, g as gridSnapStrategy, p as pointToGridCell, r as resolveUnit } from './grid-sfilv5HP.js';
|
|
7
|
+
import { R as RenderLayer, D as Dims, a as DeviceProfile, b as DetectedDeviceFacts, C as Condition, c as Rule, d as RuleCtx, V as VisibilityRules, e as ChromeCtx, f as ChromeId, A as Action, g as DepSchema, S as SliceDep, h as ActionsRegistry, T as Tool, i as AffordanceHit, j as Dispatcher, k as ToolDef, l as ViewportToolDef, m as AnyTool, O as OverlayPosition, n as ToolKeybinding, H as HotkeyTrigger, L as LayerHit, o as ChromeState, p as SelectionApi, I as InsertExtras, G as GeometryProjection, q as ContentHandlerEntry, r as SvgIngestOptions, U as UseSelectionOptions, s as ActionsProp, t as Affordance, u as AffordanceRegion, v as AffordanceBinding, w as CommonAffordanceScratch, B as BooleansAdapter, E as Eligibility, x as BindingScope, y as Contribution, z as ScopedBinding } from './registry-QRg8KiNM.js';
|
|
8
|
+
export { F as ALWAYS, J as ActionDeps, K as ActionDisabledReason, M as ActionEnabledResult, N as ActionEntry, P as ActionsProvider, Q as ActiveToolContextProvider, W as ActiveToolContextProviderIfRoot, X as ActiveToolContextProviderProps, Y as ActiveToolContextValue, Z as AreaSelectDep, _ as BindingOpts, $ as BooleanOp, a0 as BooleanOpResult, a1 as BoundGesture, a2 as BuildRuleCtxArgs, a3 as ClaimableGesture, a4 as ClipboardDep, a5 as ClipboardIngestCtx, a6 as CustomPaintContext, a7 as DepName, a8 as DepRegistry, a9 as DepRegistryProvider, aa as DispatcherContext, ab as DragSample, ac as EditAnchorsDep, ad as GestureBinding, ae as IDENTITY_POSE_COMPOSITION, af as ImmediateInvoker, ag as IngestCtx, ah as IngestionDep, ai as InsertDep, aj as InvocationCtx, ak as Invoker, al as LassoSelectDep, am as LayoutDep, an as MatchResult, ao as NEVER, ap as NodeAtPointDep, aq as OngoingHandle, ar as OngoingInvoker, as as OngoingOverlay, at as Point2, au as PointerContextProvider, av as PointerContextValue, aw as PointerWorldPos, ax as PoseAdapter, ay as PoseComposition, az as ResizePolicy, aA as ResolveAllOptions, aB as ResolveOnlyResult, aC as ResolvedCandidate, aD as SelectionExtendKey, aE as SelectionMode, aF as Selector, aG as SnapDep, aH as SvgUnpacker, aI as TextEditDep, aJ as ToolCtx, aK as ToolModifiers, aL as ToolPresentation, aM as ToolSlot, aN as UiOngoingControl, aO as ViewApi, aP as applyBooleanOp, aQ as buildRuleCtx, aR as clipboardCopyAction, aS as clipboardCutAction, aT as composeRectPose, aU as composeWorldPose, aV as createDispatcher, aW as decomposeRectPose, aX as describeRule, aY as drawLayers, aZ as enterTextEditAction, a_ as evaluate, a$ as evaluateEnabled, b0 as rebaseLocalPose, b1 as registerContentHandler, b2 as sliceAction, b3 as specificity, b4 as translateRectPose, b5 as useAction, b6 as useActionsRegistry, b7 as useActiveToolContext, b8 as useDepRegistry, b9 as useDepSource, ba as useOptionalActiveToolContext, bb as useOptionalDepRegistry, bc as usePointerContext, bd as useSelection, be as worldPoseLookup } from './registry-QRg8KiNM.js';
|
|
9
9
|
import { S as Stroke, F as FillStyle, a as TextureHandle, T as TilePatternSpec, b as GradientKind, G as GradStop, c as GradientFill } from './paint-types-CnLIzqq1.js';
|
|
10
10
|
export { d as GradientUnits, R as Region, e as StrokeAlign, f as alignedStrokeRect } from './paint-types-CnLIzqq1.js';
|
|
11
|
-
import { B as Bounds, P as PoseProjection, F as FitViewToBoundsOptions, V as ViewportDims } from './geometry-
|
|
12
|
-
export { R as RECT_POSE_DESCRIPTOR, a as ROTATED_POSE_DESCRIPTOR, f as fitViewToBounds } from './geometry-
|
|
13
|
-
import { N as NodeId, S as Scene, a as Node$1, b as SerializedScene, R as RectPose, U as UseSceneOptions, c as SceneRegistry, d as RegisteredOp } from './types-
|
|
14
|
-
export { A as AddLayerSpec, e as AddNodeSpec, C as ContainerNode, L as LayerRecord, f as LeafNode, g as SerializedNode, h as SystemLayerRecord, i as SystemLayerSpec, j as UserLayerRecord, k as asNodeId } from './types-
|
|
15
|
-
import { M as ModifierState, R as ResizePose, B as BoundsConstraint, P as PointSnapBehavior, L as LassoSelectBehavior, a as RotatedPose, e as RotateBehavior, S as SnapStrategy, c as ResizeAnchor, b as MoveBehavior, I as InsertBehavior } from './types-
|
|
16
|
-
export { A as ActionBehavior, f as AreaSelectOverlay, g as BehaviorMoveResult, h as BehaviorResult, C as CloneBehavior, i as CloneLayer, j as ClonePose, G as GestureContext, k as GroupTransform, l as InsertMoveResult, m as InsertOverlay, n as InsertPoint, o as InsertProposed, p as LassoSelectMoveResult, q as LassoSelectOverlay, r as LassoSelectPose, s as LassoSelectProposed, t as PointSnapContext, d as PointSnapFrame, u as PointSnapResult, v as PointerState, w as ResizeMoveResult, x as ResizeOverlay, y as ResizeProposed, z as RotateMoveResult, D as RotateOverlay, E as RotateProposed } from './types-
|
|
17
|
-
import { U as UseResizeOptions } from './pointSnapToGrid-
|
|
18
|
-
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-
|
|
11
|
+
import { B as Bounds, P as PoseProjection, F as FitViewToBoundsOptions, V as ViewportDims } from './geometry-5X6TrAkX.js';
|
|
12
|
+
export { R as RECT_POSE_DESCRIPTOR, a as ROTATED_POSE_DESCRIPTOR, f as fitViewToBounds } from './geometry-5X6TrAkX.js';
|
|
13
|
+
import { N as NodeId, S as Scene, a as Node$1, b as SerializedScene, R as RectPose, U as UseSceneOptions, c as SceneRegistry, d as RegisteredOp } from './types-vqxpCFVp.js';
|
|
14
|
+
export { A as AddLayerSpec, e as AddNodeSpec, C as ContainerNode, L as LayerRecord, f as LeafNode, g as SerializedNode, h as SystemLayerRecord, i as SystemLayerSpec, j as UserLayerRecord, k as asNodeId } from './types-vqxpCFVp.js';
|
|
15
|
+
import { M as ModifierState, R as ResizePose, B as BoundsConstraint, P as PointSnapBehavior, L as LassoSelectBehavior, a as RotatedPose, e as RotateBehavior, S as SnapStrategy, c as ResizeAnchor, b as MoveBehavior, I as InsertBehavior } from './types-ByZxoD6P.js';
|
|
16
|
+
export { A as ActionBehavior, f as AreaSelectOverlay, g as BehaviorMoveResult, h as BehaviorResult, C as CloneBehavior, i as CloneLayer, j as ClonePose, G as GestureContext, k as GroupTransform, l as InsertMoveResult, m as InsertOverlay, n as InsertPoint, o as InsertProposed, p as LassoSelectMoveResult, q as LassoSelectOverlay, r as LassoSelectPose, s as LassoSelectProposed, t as PointSnapContext, d as PointSnapFrame, u as PointSnapResult, v as PointerState, w as ResizeMoveResult, x as ResizeOverlay, y as ResizeProposed, z as RotateMoveResult, D as RotateOverlay, E as RotateProposed } from './types-ByZxoD6P.js';
|
|
17
|
+
import { U as UseResizeOptions } from './pointSnapToGrid-C3wowsQy.js';
|
|
18
|
+
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-C3wowsQy.js';
|
|
19
19
|
import { BodyClassification, IngestItem } from '@weasel-js/gestures';
|
|
20
20
|
export { ClickSpec, DragSpec, DropSpec, GestureSpec, IngestItem, InputEvent, KeyHeldSpec, KeySpec, ModSpec, MultiTouchSpec, PasteSpec, TargetSpec, WheelSpec } from '@weasel-js/gestures';
|
|
21
|
-
import { M as MoveAdapter, A as AreaSelectAdapter, R as RotateAdapter, a as LassoHitMode, b as LassoSelectAdapter, c as ResizeAdapter, d as SceneAdapter, L as LayoutStrategy, e as LayerEnumerableAdapter, I as InsertAdapter, C as ClipboardSnapshot, O as OrderedAdapter, f as LayoutSnap } from './types-
|
|
22
|
-
export { g as ContainerBounds, D as DropTarget, h as LayoutChild, i as LayoutContainer, j as LayoutDragged, S as SnapTarget } from './types-
|
|
23
|
-
import { D as DebugSink, a as DebugConfig, b as DebugSnapshot, c as DebugStrokes, d as DebugTheme } from './types-
|
|
24
|
-
export { e as DebugFeature, f as DebugStroke, H as HandleKind, g as HitShape, R as RecordedBounds, h as RecordedHandle, i as RecordedHitbox, j as RecordedLayer, k as RecordedOrigin, l as RecordedSnap } from './types-
|
|
21
|
+
import { M as MoveAdapter, A as AreaSelectAdapter, R as RotateAdapter, a as LassoHitMode, b as LassoSelectAdapter, c as ResizeAdapter, d as SceneAdapter, L as LayoutStrategy, e as LayerEnumerableAdapter, I as InsertAdapter, C as ClipboardSnapshot, O as OrderedAdapter, f as LayoutSnap } from './types-DpQ0cWYC.js';
|
|
22
|
+
export { g as ContainerBounds, D as DropTarget, h as LayoutChild, i as LayoutContainer, j as LayoutDragged, S as SnapTarget } from './types-DpQ0cWYC.js';
|
|
23
|
+
import { D as DebugSink, a as DebugConfig, b as DebugSnapshot, c as DebugStrokes, d as DebugTheme } from './types-BHK2dkMu.js';
|
|
24
|
+
export { e as DebugFeature, f as DebugStroke, H as HandleKind, g as HitShape, R as RecordedBounds, h as RecordedHandle, i as RecordedHitbox, j as RecordedLayer, k as RecordedOrigin, l as RecordedSnap } from './types-BHK2dkMu.js';
|
|
25
25
|
import { a as PolygonPath, P as Path, b as PathFillRule, R as RectPath } from './path-B6MMiodD.js';
|
|
26
26
|
export { c as PATH_C, d as PATH_CMD_LENGTHS, e as PATH_L, f as PATH_M, g as PATH_Q, h as PATH_Z } from './path-B6MMiodD.js';
|
|
27
27
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
28
|
-
import { D as DrawCommand, S as ShaderProgramHandle, P as PathDrawCommand, d as StyledRun, R as ResolvedTextStyle, e as TextStyle, f as TextVerticalAlign } from './DrawCommand-
|
|
29
|
-
export { g as DEFAULT_TEXT_STYLE, G as GroupDrawCommand, I as ImageDrawCommand, M as Mat3, h as ResolvedRun, a as ShaderDrawCommand, b as ShaderUniform, T as TextDrawCommand, i as fontString, j as markdownToRuns, k as resolveRuns, l as resolveTextStyle, n as runsToMarkdown, o as runsToPlainText, t as toRuns, v as verticalAlignOffset } from './DrawCommand-
|
|
28
|
+
import { D as DrawCommand, S as ShaderProgramHandle, P as PathDrawCommand, d as StyledRun, R as ResolvedTextStyle, e as TextStyle, f as TextVerticalAlign } from './DrawCommand-BbPrSTra.js';
|
|
29
|
+
export { g as DEFAULT_TEXT_STYLE, G as GroupDrawCommand, I as ImageDrawCommand, M as Mat3, h as ResolvedRun, a as ShaderDrawCommand, b as ShaderUniform, T as TextDrawCommand, i as fontString, j as markdownToRuns, k as resolveRuns, l as resolveTextStyle, n as runsToMarkdown, o as runsToPlainText, t as toRuns, v as verticalAlignOffset } from './DrawCommand-BbPrSTra.js';
|
|
30
30
|
import { Op, CreateHistoryOptions, History } from '@weasel-js/history';
|
|
31
31
|
export * from '@weasel-js/history';
|
|
32
32
|
export { Op } from '@weasel-js/history';
|
|
33
33
|
import { Mat3 } from '@weasel-js/geom';
|
|
34
34
|
import { G as Guide } from './types-D2tTKEU0.js';
|
|
35
|
-
export { U as UseInsertOptions } from './options-
|
|
35
|
+
export { U as UseInsertOptions } from './options-CbsIgQci.js';
|
|
36
36
|
export { UseClipboardOpsOptions, UseClipboardOpsReturn, WEASEL_CLIPBOARD_MIME, WEASEL_CLIPBOARD_MIME_WEB, buildWeaselClipboardText, embedWeaselMetadataInSvg, extractWeaselClipboardFromSvg, parseWeaselClipboardText, sniffWeaselClipboardText, useClipboardOps } from './clipboard.js';
|
|
37
37
|
export { cloneByAltDrag } from './clone.js';
|
|
38
|
-
export { I as ImageMinification, v as viewToMat3 } from './viewToMat3-
|
|
38
|
+
export { I as ImageMinification, v as viewToMat3 } from './viewToMat3-CQW_YqDw.js';
|
|
39
39
|
export { FontVariant, LocalFontOutlinesResult, OutlineFontStyle, OutlineSource, OutlineStatus, OutlineVariant, canQueryLocalFonts, enableLocalFontOutlines, hasFontOutlines, isCanvasFont, listFontOutlines, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, subscribeGlyphReady, unregisterCanvasFont, unregisterFontOutlines } from '@weasel-js/font';
|
|
40
40
|
import { CapabilityTag } from '@weasel-js/modes';
|
|
41
41
|
|
|
@@ -272,6 +272,10 @@ interface ViewportLayer<TData> extends RenderLayer<TData> {
|
|
|
272
272
|
y: number;
|
|
273
273
|
} | null;
|
|
274
274
|
}
|
|
275
|
+
/** Build a layer that renders other layers through a second view, inside a
|
|
276
|
+
* sub-region of the canvas — a minimap, an inset, a magnifier. Its
|
|
277
|
+
* `reproject` maps screen points back through the inner view so the region
|
|
278
|
+
* can be interacted with. */
|
|
275
279
|
declare function createViewportLayer<TData>(opts: CreateViewportLayerOpts<TData>): ViewportLayer<TData>;
|
|
276
280
|
/**
|
|
277
281
|
* @experimental
|
|
@@ -291,10 +295,15 @@ declare function viewportsAt<TData>(layers: readonly ViewportLayer<TData>[], out
|
|
|
291
295
|
};
|
|
292
296
|
} | null;
|
|
293
297
|
|
|
298
|
+
/** One value for both axes, or a separate value per axis. */
|
|
294
299
|
type ScalarOrXY = number | {
|
|
295
300
|
x: number;
|
|
296
301
|
y: number;
|
|
297
302
|
};
|
|
303
|
+
/** How a parallax plane tracks the camera: `pan` is the fraction of the
|
|
304
|
+
* camera's translation it follows (1 = locked to the scene, 0 = fixed to the
|
|
305
|
+
* screen), `zoom` the same for scale, and `anchor` the world point both are
|
|
306
|
+
* measured from. */
|
|
298
307
|
interface ParallaxOpts {
|
|
299
308
|
pan: ScalarOrXY;
|
|
300
309
|
zoom?: ScalarOrXY;
|
|
@@ -316,6 +325,7 @@ interface ParallaxOpts {
|
|
|
316
325
|
*/
|
|
317
326
|
declare function deriveParallaxView(outer: View, opts: ParallaxOpts): View;
|
|
318
327
|
|
|
328
|
+
/** Options for `createParallaxLayer`. */
|
|
319
329
|
interface CreateParallaxLayerOpts<TData> extends ParallaxOpts {
|
|
320
330
|
id: string;
|
|
321
331
|
label: string;
|
|
@@ -364,6 +374,8 @@ interface SimulationForce<TNode extends SimulationNode = SimulationNode> {
|
|
|
364
374
|
(alpha: number): void;
|
|
365
375
|
initialize?(nodes: TNode[], random?: () => number): void;
|
|
366
376
|
}
|
|
377
|
+
/** Options for `useSimulation`: the nodes to move, the forces acting on them,
|
|
378
|
+
* and the cooling schedule that decides when the simulation settles. */
|
|
367
379
|
interface UseSimulationOptions<TNode extends SimulationNode> {
|
|
368
380
|
/** Mutable array of nodes. Kit + forces mutate vx/vy/x/y in place. */
|
|
369
381
|
nodes: TNode[];
|
|
@@ -387,6 +399,16 @@ interface UseSimulationOptions<TNode extends SimulationNode> {
|
|
|
387
399
|
requestFrame?: (cb: (t: number) => void) => number;
|
|
388
400
|
cancelFrame?: (handle: number) => void;
|
|
389
401
|
}
|
|
402
|
+
/**
|
|
403
|
+
* A running force simulation over a set of nodes.
|
|
404
|
+
*
|
|
405
|
+
* Each tick applies every force and then integrates velocities, scaled by
|
|
406
|
+
* `alpha` — a temperature that decays toward `alphaTarget` so the layout
|
|
407
|
+
* settles instead of jittering forever. Raise `alphaTarget` to reheat it,
|
|
408
|
+
* which is what a drag does.
|
|
409
|
+
*
|
|
410
|
+
* Nodes are mutated in place; the simulation holds the array, not a copy.
|
|
411
|
+
*/
|
|
390
412
|
interface Simulation<TNode extends SimulationNode> {
|
|
391
413
|
readonly nodes: TNode[];
|
|
392
414
|
setNodes(nodes: TNode[]): this;
|
|
@@ -414,7 +436,10 @@ interface Simulation<TNode extends SimulationNode> {
|
|
|
414
436
|
}
|
|
415
437
|
/** Default alpha decay: such that alpha drops from 1 to alphaMin (0.001) in 300 ticks. */
|
|
416
438
|
declare const DEFAULT_ALPHA_DECAY: number;
|
|
439
|
+
/** Alpha below which a cooling simulation is considered settled. */
|
|
417
440
|
declare const DEFAULT_ALPHA_MIN = 0.001;
|
|
441
|
+
/** Fraction of velocity shed each tick — friction. Higher settles sooner and
|
|
442
|
+
* overshoots less. */
|
|
418
443
|
declare const DEFAULT_VELOCITY_DECAY = 0.4;
|
|
419
444
|
|
|
420
445
|
/**
|
|
@@ -555,6 +580,7 @@ interface PointerStylusState extends StylusData {
|
|
|
555
580
|
* glass without contact. */
|
|
556
581
|
hovering: boolean;
|
|
557
582
|
}
|
|
583
|
+
/** Options for `usePointerStylus`. */
|
|
558
584
|
interface UsePointerStylusOptions {
|
|
559
585
|
/** Throttle re-renders to ≈this many state updates per second. The latest
|
|
560
586
|
* sample is always kept; intermediates are dropped. Default 60. Set to
|
|
@@ -721,12 +747,15 @@ interface ThresholdDragHandle {
|
|
|
721
747
|
/** Begin a threshold-gated drag from a React PointerDown event; returns a handle exposing live state. */
|
|
722
748
|
declare function startThresholdDrag(e: React.PointerEvent, opts: ThresholdDragOptions): ThresholdDragHandle;
|
|
723
749
|
|
|
750
|
+
/** The world rect a view is not allowed to show outside of. */
|
|
724
751
|
interface ClampBounds {
|
|
725
752
|
x: number;
|
|
726
753
|
y: number;
|
|
727
754
|
width: number;
|
|
728
755
|
height: number;
|
|
729
756
|
}
|
|
757
|
+
/** Canvas dimensions in CSS pixels — needed to know how much world a view
|
|
758
|
+
* actually shows. */
|
|
730
759
|
interface CanvasSize {
|
|
731
760
|
width: number;
|
|
732
761
|
height: number;
|
|
@@ -822,6 +851,7 @@ declare const ROTATION_HANDLE_BASE_PX = 24;
|
|
|
822
851
|
* force-touch-chrome demos possible without stubbing `matchMedia`.
|
|
823
852
|
*/
|
|
824
853
|
declare function useDeviceProfile(overrides?: Partial<DeviceProfile>): DeviceProfile;
|
|
854
|
+
/** Props for `<DeviceProfileProvider>`. */
|
|
825
855
|
interface DeviceProfileProviderProps {
|
|
826
856
|
/** Partial override folded over detected facts. */
|
|
827
857
|
value?: Partial<DeviceProfile>;
|
|
@@ -1169,6 +1199,7 @@ declare function resolveVisibility(consumer: VisibilityRules | undefined, ctx: C
|
|
|
1169
1199
|
* fixture, or `<SceneCanvas>`.
|
|
1170
1200
|
*/
|
|
1171
1201
|
|
|
1202
|
+
/** The pieces of live canvas state a `ChromeCtx` is assembled from. */
|
|
1172
1203
|
interface BuildChromeCtxArgs {
|
|
1173
1204
|
focused: boolean;
|
|
1174
1205
|
selection: readonly NodeId[];
|
|
@@ -1181,6 +1212,8 @@ interface BuildChromeCtxArgs {
|
|
|
1181
1212
|
hover: NodeId | null;
|
|
1182
1213
|
view: View;
|
|
1183
1214
|
}
|
|
1215
|
+
/** Gather the current canvas state into the context that chrome-visibility
|
|
1216
|
+
* rules are evaluated against. Rebuilt per frame. */
|
|
1184
1217
|
declare function buildChromeCtx(args: BuildChromeCtxArgs): ChromeCtx;
|
|
1185
1218
|
|
|
1186
1219
|
/**
|
|
@@ -1198,6 +1231,7 @@ declare function buildChromeCtx(args: BuildChromeCtxArgs): ChromeCtx;
|
|
|
1198
1231
|
* during paint, so the hover state is always read fresh.
|
|
1199
1232
|
*/
|
|
1200
1233
|
|
|
1234
|
+
/** Options for `useHoverTracking`. */
|
|
1201
1235
|
interface UseHoverTrackingArgs {
|
|
1202
1236
|
canvasRef: RefObject<HTMLCanvasElement | null>;
|
|
1203
1237
|
/** Client → world conversion. Same shape as the dispatcher's. */
|
|
@@ -1211,6 +1245,9 @@ interface UseHoverTrackingArgs {
|
|
|
1211
1245
|
} | null;
|
|
1212
1246
|
enabled?: boolean;
|
|
1213
1247
|
}
|
|
1248
|
+
/** Track which node the pointer is over. Returns a getter rather than state,
|
|
1249
|
+
* so per-frame code can read the current value without the hover re-rendering
|
|
1250
|
+
* the component on every pointer move. */
|
|
1214
1251
|
declare function useHoverTracking(args: UseHoverTrackingArgs): () => NodeId | null;
|
|
1215
1252
|
|
|
1216
1253
|
/**
|
|
@@ -1889,6 +1926,10 @@ declare function useStandardActions(opts: UseStandardActionsOptions): void;
|
|
|
1889
1926
|
* widened to all op-apply methods.
|
|
1890
1927
|
*/
|
|
1891
1928
|
|
|
1929
|
+
/** Build the adapter the default actions commit through when the consumer
|
|
1930
|
+
* supplies no `applyOps` hook of its own — it applies ops straight to the
|
|
1931
|
+
* scene. Selection, path and text ops are not covered; those surfaces belong
|
|
1932
|
+
* to their own owners. */
|
|
1892
1933
|
declare function defaultCommitAdapter<TPose>(scene: Scene<unknown, string, TPose>): {
|
|
1893
1934
|
getNode: (id: string) => Node$1<unknown, string, TPose> | undefined;
|
|
1894
1935
|
getNodes: () => Node$1<unknown, string, TPose>[];
|
|
@@ -1904,16 +1945,25 @@ declare function defaultCommitAdapter<TPose>(scene: Scene<unknown, string, TPose
|
|
|
1904
1945
|
insertNode: (node: Node$1<unknown, string, TPose>, index?: number) => NodeId;
|
|
1905
1946
|
};
|
|
1906
1947
|
|
|
1948
|
+
/** Options for `useResizePolicy`. Each omitted field falls back to the kit
|
|
1949
|
+
* default. */
|
|
1907
1950
|
interface UseResizePolicyOptions<TPose> {
|
|
1908
1951
|
constraints?: TPose extends ResizePose ? BoundsConstraint<TPose>[] : never[];
|
|
1909
1952
|
pointSnap?: TPose extends ResizePose ? PointSnapBehavior<TPose>[] : never[];
|
|
1910
1953
|
expandIds?: (ids: string[]) => string[];
|
|
1911
1954
|
projection?: PoseProjection<TPose>;
|
|
1912
1955
|
}
|
|
1956
|
+
/** Publish how resizing should behave — constraints, point snapping, group
|
|
1957
|
+
* expansion, pose projection — for the resize action to consult. */
|
|
1913
1958
|
declare function useResizePolicy<TPose>(options: UseResizePolicyOptions<TPose>): void;
|
|
1914
1959
|
|
|
1960
|
+
/** Publish how a slice (knife cut) is performed, so the `slice` action can
|
|
1961
|
+
* run against the consumer's geometry. */
|
|
1915
1962
|
declare function useSliceDep(dep: SliceDep): void;
|
|
1916
1963
|
|
|
1964
|
+
/** Options for `useGestureDispatcher`: the element to listen on, the actions
|
|
1965
|
+
* and tools in play, and the hooks that turn raw DOM events into the world
|
|
1966
|
+
* coordinates and hit targets bindings match against. */
|
|
1917
1967
|
interface UseGestureDispatcherOptions {
|
|
1918
1968
|
/** Ref to the canvas element. Pointer/wheel/multitouch listeners attach here. */
|
|
1919
1969
|
canvasRef: RefObject<HTMLCanvasElement | null>;
|
|
@@ -2039,6 +2089,15 @@ interface UseGestureDispatcherOptions {
|
|
|
2039
2089
|
*/
|
|
2040
2090
|
getRuleCtx?: () => RuleCtx;
|
|
2041
2091
|
}
|
|
2092
|
+
/**
|
|
2093
|
+
* Attach the input pipeline to a canvas: DOM pointer, wheel, keyboard and
|
|
2094
|
+
* multitouch listeners in, normalized input events out, routed through the
|
|
2095
|
+
* dispatcher to whichever action a binding names.
|
|
2096
|
+
*
|
|
2097
|
+
* Everything it needs beyond its options — the active tool, the dep registry —
|
|
2098
|
+
* comes from context, so it must be mounted inside `<SceneCanvas>`'s
|
|
2099
|
+
* providers.
|
|
2100
|
+
*/
|
|
2042
2101
|
declare function useGestureDispatcher(opts: UseGestureDispatcherOptions): void;
|
|
2043
2102
|
|
|
2044
2103
|
/**
|
|
@@ -2082,6 +2141,8 @@ declare function computeWheelAction(state: WheelState, input: WheelInput, bounds
|
|
|
2082
2141
|
*/
|
|
2083
2142
|
declare function clientToCanvas(canvas: HTMLCanvasElement, clientX: number, clientY: number): [number, number];
|
|
2084
2143
|
|
|
2144
|
+
/** Records recent pointer deltas and reports the current velocity, averaged
|
|
2145
|
+
* over the last 100ms — the throw speed a momentum decay starts from. */
|
|
2085
2146
|
declare function useVelocityTracker(): {
|
|
2086
2147
|
record(dx: number, dy: number, t: number): void;
|
|
2087
2148
|
getVelocity(): {
|
|
@@ -2091,12 +2152,15 @@ declare function useVelocityTracker(): {
|
|
|
2091
2152
|
reset(): void;
|
|
2092
2153
|
};
|
|
2093
2154
|
|
|
2155
|
+
/** Per-axis limits on a view's position. Any side may be left open. */
|
|
2094
2156
|
interface PanBounds {
|
|
2095
2157
|
minX?: number;
|
|
2096
2158
|
maxX?: number;
|
|
2097
2159
|
minY?: number;
|
|
2098
2160
|
maxY?: number;
|
|
2099
2161
|
}
|
|
2162
|
+
/** How a decay should run: its starting velocity, how fast it slows, and what
|
|
2163
|
+
* happens if it reaches the pan limits. */
|
|
2100
2164
|
interface DecayLoopConfig {
|
|
2101
2165
|
velocity: {
|
|
2102
2166
|
vx: number;
|
|
@@ -2122,11 +2186,15 @@ interface DecayLoopConfig {
|
|
|
2122
2186
|
onTick: (dx: number, dy: number) => void;
|
|
2123
2187
|
onEnd?: () => void;
|
|
2124
2188
|
}
|
|
2189
|
+
/** A rAF loop that coasts a value to a stop under friction, reporting the
|
|
2190
|
+
* per-frame delta. What turns a released pan drag into momentum scrolling. */
|
|
2125
2191
|
declare function useDecayLoop(): {
|
|
2126
2192
|
start: (config: DecayLoopConfig) => void;
|
|
2127
2193
|
cancel: () => void;
|
|
2128
2194
|
};
|
|
2129
2195
|
|
|
2196
|
+
/** Animate the view from where it is to a target view — zoom-to-fit,
|
|
2197
|
+
* zoom-to-selection, and anything else that should glide rather than jump. */
|
|
2130
2198
|
declare function useViewTween(setView: (v: View) => void): {
|
|
2131
2199
|
animateTo: (from: View, to: View, opts?: {
|
|
2132
2200
|
duration?: number;
|
|
@@ -2206,6 +2274,8 @@ declare function defineTool<TScratch = void>(def: ToolDef<TScratch>): Tool<TScra
|
|
|
2206
2274
|
*/
|
|
2207
2275
|
declare function defineViewportTool<TScratch = void>(def: ViewportToolDef<TScratch>): Tool<TScratch>;
|
|
2208
2276
|
|
|
2277
|
+
/** Options for `useTools`: which tools exist, which one starts active, and
|
|
2278
|
+
* which run continuously regardless of the active one. */
|
|
2209
2279
|
interface UseToolsOptions {
|
|
2210
2280
|
/** Initial active-slot tool id. Must exist in `registry`. */
|
|
2211
2281
|
active: string;
|
|
@@ -2216,6 +2286,8 @@ interface UseToolsOptions {
|
|
|
2216
2286
|
/** Always-on tools — listen continuously regardless of active slot. */
|
|
2217
2287
|
ambient?: AnyTool[];
|
|
2218
2288
|
}
|
|
2289
|
+
/** The tool registry's runtime surface: which tool is active, which is
|
|
2290
|
+
* temporarily held by a hotkey, and how to change either. */
|
|
2219
2291
|
interface ToolsApi {
|
|
2220
2292
|
/** Current active-slot tool id. */
|
|
2221
2293
|
active: string;
|
|
@@ -2260,6 +2332,7 @@ interface ToolsApi {
|
|
|
2260
2332
|
*/
|
|
2261
2333
|
declare function useTools(opts: UseToolsOptions): ToolsApi;
|
|
2262
2334
|
|
|
2335
|
+
/** Options for `useKeybindings`. */
|
|
2263
2336
|
interface UseKeybindingsOptions {
|
|
2264
2337
|
/** Skip all wiring. Useful for touch apps or test isolation. */
|
|
2265
2338
|
disable?: boolean;
|
|
@@ -2278,8 +2351,12 @@ interface UseKeybindingsOptions {
|
|
|
2278
2351
|
*/
|
|
2279
2352
|
isToolEligible?: (toolId: string) => boolean;
|
|
2280
2353
|
}
|
|
2354
|
+
/** Wire the single-key tool-activation shortcuts (V, P, T, …) and Escape to
|
|
2355
|
+
* return to the default tool. Activation is gated on what the active mode
|
|
2356
|
+
* allows, so a key cannot reach a tool the palette greys out. */
|
|
2281
2357
|
declare function useKeybindings(tools: ToolsApi, options?: UseKeybindingsOptions): void;
|
|
2282
2358
|
|
|
2359
|
+
/** The value types a built-in pref leaf can hold. */
|
|
2283
2360
|
type ToolPrefKind = 'number' | 'boolean' | 'string' | 'enum' | 'color' | 'paint';
|
|
2284
2361
|
interface ToolPrefBase<K extends string, Value> {
|
|
2285
2362
|
kind: K;
|
|
@@ -2301,9 +2378,13 @@ interface ToolPrefBase<K extends string, Value> {
|
|
|
2301
2378
|
* `pose.x` / `pose.y`). Purely presentational. */
|
|
2302
2379
|
pair?: string;
|
|
2303
2380
|
}
|
|
2381
|
+
/** How a schema-driven UI should present a number pref. */
|
|
2304
2382
|
type ToolPrefNumberControl = 'input' | 'slider';
|
|
2383
|
+
/** How a schema-driven UI should present a boolean pref. */
|
|
2305
2384
|
type ToolPrefBooleanControl = 'checkbox' | 'switch';
|
|
2385
|
+
/** How a schema-driven UI should present a string pref. */
|
|
2306
2386
|
type ToolPrefStringControl = 'input' | 'textarea';
|
|
2387
|
+
/** How a schema-driven UI should present an enum pref. */
|
|
2307
2388
|
type ToolPrefEnumControl = 'select' | 'radio';
|
|
2308
2389
|
/** Display-unit conversion for number leaves whose stored value uses a
|
|
2309
2390
|
* canonical unit the user shouldn't see (e.g. radians stored, degrees
|
|
@@ -2314,6 +2395,8 @@ interface ToolPrefNumberUnit {
|
|
|
2314
2395
|
/** Shown after the input, e.g. `'°'`. */
|
|
2315
2396
|
suffix?: string;
|
|
2316
2397
|
}
|
|
2398
|
+
/** A numeric pref, optionally bounded and stepped, and optionally stored in a
|
|
2399
|
+
* different unit from the one shown. */
|
|
2317
2400
|
interface ToolPrefNumber extends ToolPrefBase<'number', number> {
|
|
2318
2401
|
min?: number;
|
|
2319
2402
|
max?: number;
|
|
@@ -2321,12 +2404,15 @@ interface ToolPrefNumber extends ToolPrefBase<'number', number> {
|
|
|
2321
2404
|
control?: ToolPrefNumberControl;
|
|
2322
2405
|
unit?: ToolPrefNumberUnit;
|
|
2323
2406
|
}
|
|
2407
|
+
/** An on/off pref. */
|
|
2324
2408
|
interface ToolPrefBoolean extends ToolPrefBase<'boolean', boolean> {
|
|
2325
2409
|
control?: ToolPrefBooleanControl;
|
|
2326
2410
|
}
|
|
2411
|
+
/** A free-text pref. */
|
|
2327
2412
|
interface ToolPrefString extends ToolPrefBase<'string', string> {
|
|
2328
2413
|
control?: ToolPrefStringControl;
|
|
2329
2414
|
}
|
|
2415
|
+
/** A pref with a fixed set of labeled choices. */
|
|
2330
2416
|
interface ToolPrefEnum<T extends string = string> extends ToolPrefBase<'enum', T> {
|
|
2331
2417
|
options: readonly {
|
|
2332
2418
|
value: T;
|
|
@@ -2334,6 +2420,8 @@ interface ToolPrefEnum<T extends string = string> extends ToolPrefBase<'enum', T
|
|
|
2334
2420
|
}[];
|
|
2335
2421
|
control?: ToolPrefEnumControl;
|
|
2336
2422
|
}
|
|
2423
|
+
/** A single color, stored as a hex string. For a value that may also be a
|
|
2424
|
+
* gradient or a pattern, use {@link ToolPrefPaint} instead. */
|
|
2337
2425
|
interface ToolPrefColor extends ToolPrefBase<'color', string> {
|
|
2338
2426
|
/** Value is `#rrggbb`, or `#rrggbbaa` when `alpha` is set (UIs then
|
|
2339
2427
|
* offer an opacity control). */
|
|
@@ -2362,6 +2450,8 @@ interface ToolPrefPaint extends ToolPrefBase<'paint', unknown> {
|
|
|
2362
2450
|
/** Offer an opacity control alongside the color. */
|
|
2363
2451
|
alpha?: boolean;
|
|
2364
2452
|
}
|
|
2453
|
+
/** One built-in pref leaf. `ToolPrefLeaf` widens this to include
|
|
2454
|
+
* app-defined kinds. */
|
|
2365
2455
|
type ToolPref = ToolPrefNumber | ToolPrefBoolean | ToolPrefString | ToolPrefEnum | ToolPrefColor | ToolPrefPaint;
|
|
2366
2456
|
/** Built-in or app-defined leaf. */
|
|
2367
2457
|
type ToolPrefLeaf = ToolPref | ToolPrefCustom;
|
|
@@ -2372,6 +2462,8 @@ interface ToolPrefGroup {
|
|
|
2372
2462
|
children: Record<string, ToolPrefLeaf | ToolPrefGroup>;
|
|
2373
2463
|
}
|
|
2374
2464
|
|
|
2465
|
+
/** Options for `useSelectTool`: how a point resolves to nodes, how a click
|
|
2466
|
+
* chooses among them, and the appearance of the marquee. */
|
|
2375
2467
|
interface UseSelectToolOptions<TPose> {
|
|
2376
2468
|
/** Return ids of all objects whose painted body covers (worldX, worldY).
|
|
2377
2469
|
* Order doesn't matter — the tool collapses parent/child overlap via
|
|
@@ -2465,6 +2557,8 @@ declare function useSelectTool<TNode extends {
|
|
|
2465
2557
|
id: string;
|
|
2466
2558
|
}, TPose>(adapter: SelectAdapter<TNode, TPose>, options: UseSelectToolOptions<TPose>): Tool<null>;
|
|
2467
2559
|
|
|
2560
|
+
/** Options for `useRotateTool` — mostly the placement and hit size of the
|
|
2561
|
+
* rotation handle. */
|
|
2468
2562
|
interface UseRotateToolOptions<TNode extends {
|
|
2469
2563
|
id: string;
|
|
2470
2564
|
}, _TPose> {
|
|
@@ -2547,18 +2641,13 @@ interface PickTopMostHitAdapter {
|
|
|
2547
2641
|
* `getZIndex` when both are present. */
|
|
2548
2642
|
compareZ?: (a: string, b: string) => number;
|
|
2549
2643
|
}
|
|
2644
|
+
/** Reduce a set of hit ids to the single one a click should act on: drop any
|
|
2645
|
+
* id that is an ancestor of another in the set, then take the topmost of what
|
|
2646
|
+
* remains. */
|
|
2550
2647
|
declare function pickTopMostHit(ids: readonly string[], adapter: PickTopMostHitAdapter | undefined | null): string | null;
|
|
2551
2648
|
|
|
2552
|
-
/**
|
|
2553
|
-
*
|
|
2554
|
-
* On hit (string id or array of ids), set the selection and return `true` —
|
|
2555
|
-
* the caller should claim and skip insertion. On miss or when no callback
|
|
2556
|
-
* is supplied, return `false`. */
|
|
2557
|
-
declare function applyHitExistingGate(ctx: ToolCtx<unknown>, hitExisting: ((p: {
|
|
2558
|
-
x: number;
|
|
2559
|
-
y: number;
|
|
2560
|
-
}) => string | string[] | null) | undefined): boolean;
|
|
2561
|
-
|
|
2649
|
+
/** Momentum settings for the hand tool: how quickly a flung view slows, when
|
|
2650
|
+
* it stops, and what happens at the pan limits. */
|
|
2562
2651
|
interface InertiaConfig {
|
|
2563
2652
|
friction?: number;
|
|
2564
2653
|
minSpeed?: number;
|
|
@@ -2567,6 +2656,7 @@ interface InertiaConfig {
|
|
|
2567
2656
|
/** View-coordinate limits for boundary clamping. Requires `boundary` to take effect. */
|
|
2568
2657
|
bounds?: PanBounds;
|
|
2569
2658
|
}
|
|
2659
|
+
/** Options for `useHandTool`. */
|
|
2570
2660
|
interface UseHandToolOptions {
|
|
2571
2661
|
inertia?: false | InertiaConfig;
|
|
2572
2662
|
/**
|
|
@@ -2615,6 +2705,8 @@ declare function useHandTool(opts?: UseHandToolOptions): Tool<HandScratch | null
|
|
|
2615
2705
|
* factories and hit gating belong on those deps, not on the tool. */
|
|
2616
2706
|
declare function useTextTool(): Tool<undefined>;
|
|
2617
2707
|
|
|
2708
|
+
/** Options for `usePinchZoomTool`: the zoom limits, and whether it is wired
|
|
2709
|
+
* at all. */
|
|
2618
2710
|
interface PinchZoomToolOpts {
|
|
2619
2711
|
min?: number;
|
|
2620
2712
|
max?: number;
|
|
@@ -2650,6 +2742,8 @@ interface PenAnchor$1 {
|
|
|
2650
2742
|
* anchor's incoming handle is NOT mirrored from this one. */
|
|
2651
2743
|
altBroken?: boolean;
|
|
2652
2744
|
}
|
|
2745
|
+
/** One in-progress subpath of the pen tool: its anchors so far, and whether
|
|
2746
|
+
* the user has closed it. */
|
|
2653
2747
|
interface PenSubpath {
|
|
2654
2748
|
anchors: PenAnchor$1[];
|
|
2655
2749
|
closed: boolean;
|
|
@@ -2686,6 +2780,8 @@ interface PenScratch {
|
|
|
2686
2780
|
draggingHandleAt: number | null;
|
|
2687
2781
|
closeHintActive: boolean;
|
|
2688
2782
|
}
|
|
2783
|
+
/** Options for `usePenTool`: how a finished path becomes a pose, where it is
|
|
2784
|
+
* inserted, and when a closed subpath commits. */
|
|
2689
2785
|
interface UsePenToolOptions<TPose> {
|
|
2690
2786
|
/** Wrap a finished PolygonPath in the consumer's pose type. */
|
|
2691
2787
|
wrapPath: (path: PolygonPath, opts: {
|
|
@@ -2780,6 +2876,7 @@ declare function useRectTool(): Tool<null>;
|
|
|
2780
2876
|
*/
|
|
2781
2877
|
declare function useEllipseTool(): Tool<null>;
|
|
2782
2878
|
|
|
2879
|
+
/** Options for `useImageTool`. */
|
|
2783
2880
|
interface UseImageToolOptions {
|
|
2784
2881
|
/** Image source for inserted nodes — a URL, a `blob:` URL, or a
|
|
2785
2882
|
* `data:image/…;base64,…` URI. Stored verbatim on each new node's
|
|
@@ -2803,6 +2900,7 @@ interface UseImageToolOptions {
|
|
|
2803
2900
|
*/
|
|
2804
2901
|
declare function useImageTool(options: UseImageToolOptions): Tool<null>;
|
|
2805
2902
|
|
|
2903
|
+
/** Options for `useEyedropperTool`. */
|
|
2806
2904
|
interface UseEyedropperToolOptions {
|
|
2807
2905
|
/** Called when the user picks a color. `null` means "no node was hit
|
|
2808
2906
|
* with a color" — currently only reachable when `colorOf` returns null
|
|
@@ -2833,6 +2931,7 @@ interface UseEyedropperToolOptions {
|
|
|
2833
2931
|
*/
|
|
2834
2932
|
declare function useEyedropperTool(opts: UseEyedropperToolOptions): Tool<null>;
|
|
2835
2933
|
|
|
2934
|
+
/** An endpoint of a line, in world coordinates. */
|
|
2836
2935
|
interface LinePoint {
|
|
2837
2936
|
x: number;
|
|
2838
2937
|
y: number;
|
|
@@ -2858,6 +2957,7 @@ declare function useLineTool(): Tool<null>;
|
|
|
2858
2957
|
* Consumers should import from here directly; `lassoSelect.ts`
|
|
2859
2958
|
* re-exports the same symbol for back-compat. */
|
|
2860
2959
|
|
|
2960
|
+
/** Options for the `lasso-select` action. */
|
|
2861
2961
|
interface UseLassoSelectOptions {
|
|
2862
2962
|
behaviors?: LassoSelectBehavior[];
|
|
2863
2963
|
/** When set, overrides any behavior's `defaultTransient`. */
|
|
@@ -2873,6 +2973,8 @@ interface UseLassoSelectOptions {
|
|
|
2873
2973
|
debug?: DebugSink;
|
|
2874
2974
|
}
|
|
2875
2975
|
|
|
2976
|
+
/** Options for `useLassoTool` — the lasso-select action's options plus the
|
|
2977
|
+
* tool's own hit mode and activation key. */
|
|
2876
2978
|
interface UseLassoToolOptions extends Pick<UseLassoSelectOptions, 'behaviors' | 'transient' | 'label' | 'onGestureStart' | 'onGestureEnd' | 'minVertexSpacing' | 'debug'> {
|
|
2877
2979
|
/** Hit mode forwarded to the default `selectFromLasso` behavior when no
|
|
2878
2980
|
* explicit `behaviors` array is passed. Default 'intersect'. */
|
|
@@ -2891,10 +2993,12 @@ interface UseLassoToolOptions extends Pick<UseLassoSelectOptions, 'behaviors' |
|
|
|
2891
2993
|
* `lassoSelectAction` (see `src/interactions/actions/defaults/lassoSelect.ts`). */
|
|
2892
2994
|
declare function useLassoTool(_adapter: LassoSelectAdapter, options?: UseLassoToolOptions): Tool<undefined>;
|
|
2893
2995
|
|
|
2996
|
+
/** A point in world coordinates. */
|
|
2894
2997
|
interface PolygonPoint {
|
|
2895
2998
|
x: number;
|
|
2896
2999
|
y: number;
|
|
2897
3000
|
}
|
|
3001
|
+
/** Options for `usePolygonTool`. */
|
|
2898
3002
|
interface UsePolygonToolOptions {
|
|
2899
3003
|
label?: string;
|
|
2900
3004
|
/** Initial side count. Side count persists across gestures
|
|
@@ -2919,10 +3023,12 @@ declare function usePolygonTool<TNode extends {
|
|
|
2919
3023
|
id: string;
|
|
2920
3024
|
}>(options?: UsePolygonToolOptions): Tool<null>;
|
|
2921
3025
|
|
|
3026
|
+
/** A point in world coordinates. */
|
|
2922
3027
|
interface StarPoint {
|
|
2923
3028
|
x: number;
|
|
2924
3029
|
y: number;
|
|
2925
3030
|
}
|
|
3031
|
+
/** Options for `useStarTool`. */
|
|
2926
3032
|
interface UseStarToolOptions {
|
|
2927
3033
|
label?: string;
|
|
2928
3034
|
/** Initial point count. Persists across gestures (Illustrator
|
|
@@ -3311,19 +3417,16 @@ interface HierarchicalAdapter<TNode, TPose> {
|
|
|
3311
3417
|
}
|
|
3312
3418
|
|
|
3313
3419
|
/**
|
|
3314
|
-
*
|
|
3315
|
-
* `viewport` prop into a `useHandTool` instance and wires `usePinchZoomTool`.
|
|
3316
|
-
* Hooks always run (React's rules); each is a no-op when its config is absent.
|
|
3317
|
-
*
|
|
3318
|
-
* Keyboard zoom (Cmd+=/-/0) and wheel zoom/pan are now handled by the
|
|
3319
|
-
* `viewport.zoom` and `viewport.pan` action descriptors registered via
|
|
3320
|
-
* `useStandardActions` + `useGestureDispatcher`. The former
|
|
3321
|
-
* `useKeyboardZoomTool` and `useWheelZoomTool` ambient tools are dissolved.
|
|
3420
|
+
* The consumer-facing `viewport` prop shape for `<SceneCanvas>`.
|
|
3322
3421
|
*
|
|
3323
|
-
*
|
|
3324
|
-
* `
|
|
3422
|
+
* The features it names are wired by the `viewport.*` action descriptors
|
|
3423
|
+
* (`useStandardActions` + `useGestureDispatcher`) and by SceneCanvas itself,
|
|
3424
|
+
* which derives the hand tool and the registered flag inline.
|
|
3325
3425
|
*/
|
|
3326
3426
|
|
|
3427
|
+
/** Which viewport interactions `<SceneCanvas>` wires up — pan inertia, pinch
|
|
3428
|
+
* zoom, wheel pan, wheel and keyboard zoom. Each may be switched off with
|
|
3429
|
+
* `false` or tuned with an options object. */
|
|
3327
3430
|
interface ViewportConfig {
|
|
3328
3431
|
inertia?: boolean | {
|
|
3329
3432
|
friction?: number;
|
|
@@ -3411,9 +3514,15 @@ type SelectionOverlaySlotConfig<TPose> = Omit<SelectionOverlayLayerOpts<TPose>,
|
|
|
3411
3514
|
type StandardSlotConfig<TNode extends {
|
|
3412
3515
|
id: string;
|
|
3413
3516
|
}, TPose> = GridSlotConfig | SceneSlotConfig<TNode, TPose> | SelectionOverlaySlotConfig<TPose>;
|
|
3517
|
+
/** What may fill one of the canvas's named layer slots: a config the canvas
|
|
3518
|
+
* builds the layer from, a pre-built layer, or `null` to leave the slot
|
|
3519
|
+
* empty. */
|
|
3414
3520
|
type LayerSlotValue<TNode extends {
|
|
3415
3521
|
id: string;
|
|
3416
3522
|
}, TPose> = StandardSlotConfig<TNode, TPose> | CustomLayerEntry | null;
|
|
3523
|
+
/** The canvas's render stack, as named slots. The standard slots (grid,
|
|
3524
|
+
* scene, selection overlay, cell highlight) can be configured, replaced with
|
|
3525
|
+
* a layer of your own, or switched off; further keys add custom layers. */
|
|
3417
3526
|
type LayersMap<TNode extends {
|
|
3418
3527
|
id: string;
|
|
3419
3528
|
}, TPose> = {
|
|
@@ -3620,13 +3729,6 @@ interface CanvasProps<TNode extends {
|
|
|
3620
3729
|
* drags. Returns `null` / `undefined` when no preview is in flight.
|
|
3621
3730
|
*/
|
|
3622
3731
|
previewPoseExtra?: (id: string) => unknown;
|
|
3623
|
-
/**
|
|
3624
|
-
* Extra preview-bounds lookup checked after `previewBoundsExtra`'s `previewPose`
|
|
3625
|
-
* fallback. Same shape as `previewPoseExtra` but returns AABB directly,
|
|
3626
|
-
* preferred when the in-flight handle can produce bounds without going
|
|
3627
|
-
* through geometry.getBounds(pose).
|
|
3628
|
-
*/
|
|
3629
|
-
previewBoundsExtra?: (id: string) => Bounds | null;
|
|
3630
3732
|
/**
|
|
3631
3733
|
* In-flight gesture state `<Canvas>` can't see for itself. Backs the
|
|
3632
3734
|
* `getGestureBounds` / `subscribeGestures` / `getGestureVersion` trio on
|
|
@@ -3798,6 +3900,7 @@ interface CanvasHelpers<TPose> {
|
|
|
3798
3900
|
getIsVisible(): (id: string) => boolean;
|
|
3799
3901
|
}
|
|
3800
3902
|
|
|
3903
|
+
/** Which of a node's two per-anchor color arrays an override applies to. */
|
|
3801
3904
|
type VertexColorChannel = 'fill' | 'stroke';
|
|
3802
3905
|
/** Function-form override: receives the consumer-supplied base color
|
|
3803
3906
|
* array and the current animation timestamp (ms, from the animator's
|
|
@@ -3821,7 +3924,12 @@ declare class ColorOverrideRegistry {
|
|
|
3821
3924
|
version(): number;
|
|
3822
3925
|
}
|
|
3823
3926
|
|
|
3927
|
+
/** An easing curve: maps normalized progress `t ∈ [0, 1]` to eased progress.
|
|
3928
|
+
* Curves may leave the 0–1 range in the middle (back, elastic) but should
|
|
3929
|
+
* pass through 0 at 0 and 1 at 1. */
|
|
3824
3930
|
type EasingFn = (t: number) => number;
|
|
3931
|
+
/** Blends two `T` values at eased progress `t`. Called once per frame; see
|
|
3932
|
+
* {@link InterpolatorFactory} when the blend has setup worth hoisting. */
|
|
3825
3933
|
type Interpolate<T> = (from: T, to: T, t: number) => T;
|
|
3826
3934
|
/** Factory interpolator: built ONCE at tween start with (from, to), the returned
|
|
3827
3935
|
* function is called with `t ∈ [0, 1]` each frame. Use for interpolators with
|
|
@@ -3829,12 +3937,17 @@ type Interpolate<T> = (from: T, to: T, t: number) => T;
|
|
|
3829
3937
|
* shape exactly. For cheap interpolations the per-tick `Interpolate<T>` form is
|
|
3830
3938
|
* fine; this is the escape hatch when setup-per-tick is wasteful. */
|
|
3831
3939
|
type InterpolatorFactory<T> = (from: T, to: T) => (t: number) => T;
|
|
3940
|
+
/** A spring's physical parameters. Higher stiffness settles faster, higher
|
|
3941
|
+
* damping overshoots less, higher mass makes both sluggish. */
|
|
3832
3942
|
interface SpringPreset {
|
|
3833
3943
|
stiffness: number;
|
|
3834
3944
|
damping: number;
|
|
3835
3945
|
mass: number;
|
|
3836
3946
|
}
|
|
3947
|
+
/** One of the tunings in `SPRING_PRESETS`. */
|
|
3837
3948
|
type SpringPresetName = 'gentle' | 'wobbly' | 'stiff' | 'slow';
|
|
3949
|
+
/** A running animation. Cancel it, or bend its time — pausing and time-scaling
|
|
3950
|
+
* act on this animation's own virtual clock, independent of the animator's. */
|
|
3838
3951
|
interface AnimationHandle {
|
|
3839
3952
|
/** Monotonic id assigned by the animator. */
|
|
3840
3953
|
id: number;
|
|
@@ -3849,6 +3962,9 @@ interface AnimationHandle {
|
|
|
3849
3962
|
/** True iff this handle is currently paused. */
|
|
3850
3963
|
isPaused(): boolean;
|
|
3851
3964
|
}
|
|
3965
|
+
/** A duration-based animation from `from` to `to` over `ms`, shaped by an
|
|
3966
|
+
* easing curve. Reach for a spring instead when the motion should respond to
|
|
3967
|
+
* where the value already is rather than restart from a fixed duration. */
|
|
3852
3968
|
interface TweenOptions<T> {
|
|
3853
3969
|
from: T;
|
|
3854
3970
|
to: T;
|
|
@@ -3867,6 +3983,9 @@ interface TweenOptions<T> {
|
|
|
3867
3983
|
/** Any new animation passed the same cancelKey cancels the prior one in flight. */
|
|
3868
3984
|
cancelKey?: string;
|
|
3869
3985
|
}
|
|
3986
|
+
/** A spring animation: runs until the value settles on `to` rather than for a
|
|
3987
|
+
* set duration, so it absorbs an initial velocity naturally. Non-numeric `T`
|
|
3988
|
+
* needs the four vector helpers. */
|
|
3870
3989
|
interface SpringOptions<T> {
|
|
3871
3990
|
from: T;
|
|
3872
3991
|
to: T;
|
|
@@ -3888,6 +4007,9 @@ interface SpringOptions<T> {
|
|
|
3888
4007
|
onDone?: () => void;
|
|
3889
4008
|
cancelKey?: string;
|
|
3890
4009
|
}
|
|
4010
|
+
/** Spring and decay as one animation. With a `to`, a spring pulls toward it;
|
|
4011
|
+
* with `to: null`, the value coasts on its velocity. Either can become the
|
|
4012
|
+
* other mid-flight through the handle. */
|
|
3891
4013
|
interface PhysicsOptions<T> {
|
|
3892
4014
|
from: T;
|
|
3893
4015
|
/** Target. `null` ⇒ no spring force (decay-mode). */
|
|
@@ -3908,12 +4030,16 @@ interface PhysicsOptions<T> {
|
|
|
3908
4030
|
onDone?: () => void;
|
|
3909
4031
|
cancelKey?: string;
|
|
3910
4032
|
}
|
|
4033
|
+
/** An `AnimationHandle` that can also be steered while it runs — the point of
|
|
4034
|
+
* the physics primitive. */
|
|
3911
4035
|
interface PhysicsHandle<T = unknown> extends AnimationHandle {
|
|
3912
4036
|
/** Retarget mid-flight. `null` ⇒ switch to decay-mode (no spring force). */
|
|
3913
4037
|
setTarget(to: T | null): void;
|
|
3914
4038
|
/** Replace the current velocity in T-units per second. */
|
|
3915
4039
|
setVelocity(v: T): void;
|
|
3916
4040
|
}
|
|
4041
|
+
/** Momentum: coast from `from` at `velocity`, slowing by `friction` each
|
|
4042
|
+
* second until below `threshold`. What a flick-to-pan leaves behind. */
|
|
3917
4043
|
interface DecayOptions<T> {
|
|
3918
4044
|
from: T;
|
|
3919
4045
|
velocity: T;
|
|
@@ -3928,6 +4054,8 @@ interface DecayOptions<T> {
|
|
|
3928
4054
|
onDone?: () => void;
|
|
3929
4055
|
cancelKey?: string;
|
|
3930
4056
|
}
|
|
4057
|
+
/** Options for `useAnimator`. Everything here is an injection seam for tests;
|
|
4058
|
+
* the defaults are the real clock, rAF, and `setTimeout`. */
|
|
3931
4059
|
interface UseAnimatorOptions {
|
|
3932
4060
|
/** Optional clock injection for tests. Returns ms since some epoch. */
|
|
3933
4061
|
now?: () => number;
|
|
@@ -3940,6 +4068,15 @@ interface UseAnimatorOptions {
|
|
|
3940
4068
|
/** Companion to `setTimer`. Defaults to global `clearTimeout`. */
|
|
3941
4069
|
clearTimer?: (handle: unknown) => void;
|
|
3942
4070
|
}
|
|
4071
|
+
/**
|
|
4072
|
+
* Owns every running animation on a canvas and drives them from one rAF loop.
|
|
4073
|
+
* Beyond the primitives (`tween`, `spring`, `decay`, `physics`) it offers
|
|
4074
|
+
* composition — `loop`, `stagger` — and bulk control by handle, by cancel-key,
|
|
4075
|
+
* or over everything at once.
|
|
4076
|
+
*
|
|
4077
|
+
* An animator does not know about the scene: animations report values through
|
|
4078
|
+
* `onTick` and the caller decides what to do with them.
|
|
4079
|
+
*/
|
|
3943
4080
|
interface Animator {
|
|
3944
4081
|
tween<T>(opts: TweenOptions<T>): AnimationHandle;
|
|
3945
4082
|
spring<T>(opts: SpringOptions<T>): AnimationHandle;
|
|
@@ -4043,6 +4180,7 @@ interface Animator {
|
|
|
4043
4180
|
*/
|
|
4044
4181
|
keepAlive(): () => void;
|
|
4045
4182
|
}
|
|
4183
|
+
/** Options for `Animator.loop`. */
|
|
4046
4184
|
interface LoopOptions {
|
|
4047
4185
|
/** Maximum number of iterations. Default Infinity. */
|
|
4048
4186
|
count?: number;
|
|
@@ -4059,15 +4197,20 @@ interface StaggerOptions {
|
|
|
4059
4197
|
* any timer or child is alive. */
|
|
4060
4198
|
cancelKey?: string;
|
|
4061
4199
|
}
|
|
4200
|
+
/** Produces one iteration of a loop. Must arrange for `next` to be called when
|
|
4201
|
+
* the animation it returns finishes, or the loop stalls after one pass. */
|
|
4062
4202
|
type LoopFactory = (iteration: number, next: () => void) => AnimationHandle;
|
|
4063
4203
|
/** Per-index delay schedule. Number ⇒ `index * delay` ms. Function ⇒ caller
|
|
4064
4204
|
* decides the absolute delay for each index (e.g. `i => i * i * 30`). */
|
|
4065
4205
|
type StaggerDelay = number | ((index: number) => number);
|
|
4206
|
+
/** Produces the animation for one staggered item. */
|
|
4066
4207
|
type StaggerFactory<TItem> = (item: TItem, index: number) => AnimationHandle;
|
|
4067
4208
|
/** A `T` value or a function that derives one from the per-item context. Used
|
|
4068
4209
|
* by the fluent builder methods (`.tween`, `.springPose`) so each item can
|
|
4069
4210
|
* vary an option (e.g. `to: (_item, i) => (i + 1) * 10`). */
|
|
4070
4211
|
type StaggerPerItem<T, TItem> = T | ((item: TItem, index: number) => T);
|
|
4212
|
+
/** Options for the stagger builder's `.tween`: a tween per item, where
|
|
4213
|
+
* `from`, `to` and `ms` may each vary by item. */
|
|
4071
4214
|
interface StaggerTweenOptions<T, TItem> {
|
|
4072
4215
|
from: StaggerPerItem<T, TItem>;
|
|
4073
4216
|
to: StaggerPerItem<T, TItem>;
|
|
@@ -4077,6 +4220,8 @@ interface StaggerTweenOptions<T, TItem> {
|
|
|
4077
4220
|
onTick: (value: T, item: TItem, index: number) => void;
|
|
4078
4221
|
onDone?: (item: TItem, index: number) => void;
|
|
4079
4222
|
}
|
|
4223
|
+
/** Options for the stagger builder's `.springPose`: the spring tuning, and
|
|
4224
|
+
* whether each item's settle is recorded as an undoable op. */
|
|
4080
4225
|
interface StaggerSpringPoseOptions<TPose> {
|
|
4081
4226
|
preset?: SpringPresetName;
|
|
4082
4227
|
stiffness?: number;
|
|
@@ -4086,6 +4231,8 @@ interface StaggerSpringPoseOptions<TPose> {
|
|
|
4086
4231
|
recordOp?: boolean;
|
|
4087
4232
|
opLabel?: string;
|
|
4088
4233
|
}
|
|
4234
|
+
/** Fluent form of `Animator.stagger`: pick what to run per item after the
|
|
4235
|
+
* items and the delay schedule are already fixed. */
|
|
4089
4236
|
interface StaggerBuilder<TItem> {
|
|
4090
4237
|
/** Run an arbitrary per-item factory. */
|
|
4091
4238
|
each(factory: StaggerFactory<TItem>): AnimationHandle;
|
|
@@ -4100,6 +4247,8 @@ interface StaggerBuilder<TItem> {
|
|
|
4100
4247
|
id: string;
|
|
4101
4248
|
}, TPose>, poseFn: (item: TItem, index: number) => TPose, opts?: StaggerSpringPoseOptions<TPose>): AnimationHandle;
|
|
4102
4249
|
}
|
|
4250
|
+
/** Options for `Animator.tweenLoop` — a tween's options plus how each
|
|
4251
|
+
* iteration relates to the last. */
|
|
4103
4252
|
interface TweenLoopOptions<T> {
|
|
4104
4253
|
from: T;
|
|
4105
4254
|
to: T;
|
|
@@ -4133,6 +4282,10 @@ interface ReorderAdapter {
|
|
|
4133
4282
|
getChildren(parentId: string | null): string[];
|
|
4134
4283
|
setChildOrder(parentId: string | null, ids: string[]): void;
|
|
4135
4284
|
}
|
|
4285
|
+
/** Everything the interaction layer can ask of a scene, as one type: the
|
|
4286
|
+
* move, resize, rotate, selection, layer and reorder contracts combined.
|
|
4287
|
+
* `<SceneCanvas>` synthesizes one of these, which is why most consumers never
|
|
4288
|
+
* touch an adapter directly. */
|
|
4136
4289
|
type SceneCanvasAdapter<TData, TLayer extends string, TPose> = MoveAdapter<Node$1<TData, TLayer, TPose>, TPose> & ResizeAdapter<Node$1<TData, TLayer, TPose>, TPose> & RotateAdapter<Node$1<TData, TLayer, TPose>, TPose> & AreaSelectAdapter & LassoSelectAdapter & LayerEnumerableAdapter<TLayer> & ReorderAdapter & Partial<InsertAdapter<Node$1<TData, TLayer, TPose>>> & {
|
|
4137
4290
|
getParent(id: string): string | null;
|
|
4138
4291
|
getSelection(): string[];
|
|
@@ -4193,6 +4346,9 @@ interface SceneToAdapterOptions<TData, TLayer extends string, TPose> {
|
|
|
4193
4346
|
* primitive — containers move but their descendants don't follow. */
|
|
4194
4347
|
cascadeContainerPose?: 'rect' | ((pose: TPose, dx: number, dy: number) => TPose);
|
|
4195
4348
|
}
|
|
4349
|
+
/** Derive the adapter for a scene. Reads go straight to the scene; writes are
|
|
4350
|
+
* ops applied through its history, so anything done through the adapter is
|
|
4351
|
+
* undoable. */
|
|
4196
4352
|
declare function sceneToAdapter<TData, TLayer extends string, TPose>(scene: Scene<TData, TLayer, TPose>, options?: SceneToAdapterOptions<TData, TLayer, TPose>): SceneCanvasAdapter<TData, TLayer, TPose>;
|
|
4197
4353
|
/**
|
|
4198
4354
|
* React-hook wrapper around `sceneToAdapter`. Memoizes on `scene`,
|
|
@@ -4213,11 +4369,14 @@ declare function useSceneAdapter<TData, TLayer extends string, TPose>(scene: Sce
|
|
|
4213
4369
|
* Consumers should import from here directly; `rotate.ts` re-exports the
|
|
4214
4370
|
* same symbols for back-compat. */
|
|
4215
4371
|
|
|
4372
|
+
/** Projects a pose to and from a rotated bounding box, so the rotate action
|
|
4373
|
+
* can work on pose shapes that carry rotation differently. */
|
|
4216
4374
|
interface RotateGeometry<TPose> {
|
|
4217
4375
|
getRotatedBounds(pose: TPose): RotatedPose;
|
|
4218
4376
|
/** Write a new rotation back into the pose; bounds stay the same. */
|
|
4219
4377
|
withRotation(pose: TPose, rotation: number): TPose;
|
|
4220
4378
|
}
|
|
4379
|
+
/** Options for the `rotate` action. */
|
|
4221
4380
|
interface UseRotateOptions<TPose> {
|
|
4222
4381
|
/** Behaviors are typed against the pose shape; the kit ships none yet
|
|
4223
4382
|
* (rotation snap behaviors are deferred). For non-rect TPose, behaviors
|
|
@@ -4329,6 +4488,8 @@ interface OpenFilePickerOptions {
|
|
|
4329
4488
|
/** Allow multi-select. Default false. */
|
|
4330
4489
|
multiple?: boolean;
|
|
4331
4490
|
}
|
|
4491
|
+
/** Show the browser's file picker and resolve with what the user chose —
|
|
4492
|
+
* empty when they cancel. Must be called from a user gesture. */
|
|
4332
4493
|
declare function openFilePicker(opts?: OpenFilePickerOptions): Promise<File[]>;
|
|
4333
4494
|
|
|
4334
4495
|
/**
|
|
@@ -4377,6 +4538,9 @@ interface NodeRouting {
|
|
|
4377
4538
|
/** Enumerate registered kinds in registration order. */
|
|
4378
4539
|
list(): readonly NodeRoutingEntry[];
|
|
4379
4540
|
}
|
|
4541
|
+
/** Build a registry of per-node-kind routing entries, which decide how a node
|
|
4542
|
+
* kind is drawn, hit-tested and serialized. Registering a duplicate kind name
|
|
4543
|
+
* throws. */
|
|
4380
4544
|
declare function createNodeRouting(): NodeRouting;
|
|
4381
4545
|
|
|
4382
4546
|
/**
|
|
@@ -4443,6 +4607,9 @@ interface NodePaintCtx {
|
|
|
4443
4607
|
* load-status error variant). */
|
|
4444
4608
|
resolveImage?: (node: Node$1<unknown, string, unknown>) => ImageBitmap | undefined;
|
|
4445
4609
|
}
|
|
4610
|
+
/** A painter for one kind of node: which nodes it claims, and the draw
|
|
4611
|
+
* commands it emits for them. Registering one is how a consumer teaches the
|
|
4612
|
+
* default renderer to draw its own node kinds. */
|
|
4446
4613
|
interface NodeShapeEntry<TData = unknown, TPose = unknown> {
|
|
4447
4614
|
/** Stable identifier — used for unregistration and debugging. Pick
|
|
4448
4615
|
* something descriptive: `'kit:text'`, `'app:image'`, etc. */
|
|
@@ -4487,6 +4654,7 @@ interface NodeInk {
|
|
|
4487
4654
|
/** Stroke width in world units. `0` for no stroke. */
|
|
4488
4655
|
strokeWidth: number;
|
|
4489
4656
|
}
|
|
4657
|
+
/** Options for `registerNodeShape`. */
|
|
4490
4658
|
interface RegisterNodeShapeOptions {
|
|
4491
4659
|
/** `'high'` puts the painter ahead of all normally-registered ones (so
|
|
4492
4660
|
* it can win over a kit built-in). `'normal'` appends at the end. */
|
|
@@ -4596,6 +4764,9 @@ type NodeFill = string | FillStyle;
|
|
|
4596
4764
|
* overlay since their content already shows.
|
|
4597
4765
|
*/
|
|
4598
4766
|
|
|
4767
|
+
/** Paint one node the way the kit does by default: dispatch to the first
|
|
4768
|
+
* registered node-shape painter that matches, then draw its `data.label` on
|
|
4769
|
+
* top when it has one. Consumers replace or wrap this via `drawOne`. */
|
|
4599
4770
|
declare function defaultDrawOne<TData, TLayer extends string, TPose>(node: Node$1<TData, TLayer, TPose>, pose: TPose, ctx?: NodePaintCtx): DrawCommand[];
|
|
4600
4771
|
|
|
4601
4772
|
/** Default size in CSS pixels for selection corner-handles AND their
|
|
@@ -4625,6 +4796,9 @@ interface SceneCanvasHit {
|
|
|
4625
4796
|
id: string;
|
|
4626
4797
|
kind: string;
|
|
4627
4798
|
}
|
|
4799
|
+
/** Props for `<SceneCanvas>`. Most are optional: a scene is the only thing it
|
|
4800
|
+
* truly needs, and everything else — tools, layers, selection handling,
|
|
4801
|
+
* layouts, animation — layers onto sensible defaults. */
|
|
4628
4802
|
type SceneCanvasProps<TData, TLayer extends string, TPose> = Omit<CanvasProps<Node$1<TData, TLayer, TPose>, TPose>, 'adapter' | 'moveOptions' | 'resizeOptions' | 'rotateOptions' | 'snap' | 'pickEvery' | 'boundsOf' | 'handleHitRadius' | 'selection' | 'selectionOptions' | 'tools' | 'geometry' | 'layers' | 'onBackgroundClick' | 'getIsVisible'> & {
|
|
4629
4803
|
/** A `Scene` (typically from `useScene`) — or a `SerializedScene`
|
|
4630
4804
|
* JSON object, which SceneCanvas bakes into a Scene internally on
|
|
@@ -5105,10 +5279,24 @@ type SceneCanvasProps<TData, TLayer extends string, TPose> = Omit<CanvasProps<No
|
|
|
5105
5279
|
onDoubleClick?: (hit: SceneCanvasHit | null) => void;
|
|
5106
5280
|
};
|
|
5107
5281
|
declare function SceneCanvasInner<TData, TLayer extends string, TPose>(props: SceneCanvasProps<TData, TLayer, TPose>, ref: React__default.ForwardedRef<SceneCanvasApi>): react_jsx_runtime.JSX.Element;
|
|
5282
|
+
/**
|
|
5283
|
+
* The canvas component: renders a `Scene` and wires the interaction stack
|
|
5284
|
+
* around it.
|
|
5285
|
+
*
|
|
5286
|
+
* Mounting one gives you the whole default kit — an adapter synthesized from
|
|
5287
|
+
* the scene, the built-in tools and actions, selection, undo, and the gesture
|
|
5288
|
+
* dispatcher — with each piece replaceable through props. This is the intended
|
|
5289
|
+
* entry point; the lower-level primitives it composes are not part of the
|
|
5290
|
+
* public surface.
|
|
5291
|
+
*
|
|
5292
|
+
* Its ref exposes a `SceneCanvasApi` for the imperative operations that do not
|
|
5293
|
+
* fit a prop (view control, hit queries, redraw requests).
|
|
5294
|
+
*/
|
|
5108
5295
|
declare const SceneCanvas: <TData, TLayer extends string, TPose>(props: SceneCanvasProps<TData, TLayer, TPose> & {
|
|
5109
5296
|
ref?: React__default.Ref<SceneCanvasApi>;
|
|
5110
5297
|
}) => ReturnType<typeof SceneCanvasInner>;
|
|
5111
5298
|
|
|
5299
|
+
/** Props for `<CursorCoordsHud>`. */
|
|
5112
5300
|
interface CursorCoordsHudProps {
|
|
5113
5301
|
canvasRef: React.RefObject<HTMLCanvasElement | null>;
|
|
5114
5302
|
viewRef: React.RefObject<View>;
|
|
@@ -5118,8 +5306,11 @@ interface CursorCoordsHudProps {
|
|
|
5118
5306
|
right?: number;
|
|
5119
5307
|
};
|
|
5120
5308
|
}
|
|
5309
|
+
/** Debug overlay showing the pointer's client and world coordinates and the
|
|
5310
|
+
* current frame rate, pinned to the canvas's top-right corner. */
|
|
5121
5311
|
declare function CursorCoordsHud({ canvasRef, viewRef, offset }: CursorCoordsHudProps): react_jsx_runtime.JSX.Element | null;
|
|
5122
5312
|
|
|
5313
|
+
/** Props for `<PickHud>`. */
|
|
5123
5314
|
interface PickHudProps {
|
|
5124
5315
|
canvasRef: React.RefObject<HTMLCanvasElement | null>;
|
|
5125
5316
|
viewRef: React.RefObject<View>;
|
|
@@ -5135,6 +5326,8 @@ interface PickHudProps {
|
|
|
5135
5326
|
right?: number;
|
|
5136
5327
|
};
|
|
5137
5328
|
}
|
|
5329
|
+
/** Debug overlay listing every node under the pointer, with the one a click
|
|
5330
|
+
* would actually select shown in bold. */
|
|
5138
5331
|
declare function PickHud({ canvasRef, viewRef, pickEvery, pickBest, offset }: PickHudProps): react_jsx_runtime.JSX.Element | null;
|
|
5139
5332
|
|
|
5140
5333
|
/**
|
|
@@ -5161,6 +5354,8 @@ interface ImageNodeData {
|
|
|
5161
5354
|
opacity?: number;
|
|
5162
5355
|
};
|
|
5163
5356
|
}
|
|
5357
|
+
/** Where an image is in its load: never requested, in flight, decoded, or
|
|
5358
|
+
* failed. Renderers paint a placeholder for anything but `'ready'`. */
|
|
5164
5359
|
type ImageStatus = 'idle' | 'loading' | 'ready' | 'error';
|
|
5165
5360
|
/** Synchronous read. Returns the decoded bitmap when ready; otherwise returns
|
|
5166
5361
|
* `undefined` and lazily starts a de-duped async load for `src`. */
|
|
@@ -5256,6 +5451,9 @@ interface NodeProperties {
|
|
|
5256
5451
|
/** Enumerate registered kinds in registration order. */
|
|
5257
5452
|
list(): readonly NodePropertiesEntry[];
|
|
5258
5453
|
}
|
|
5454
|
+
/** Build a registry of per-node-kind property descriptors, which schema-driven
|
|
5455
|
+
* property panels read to know what a node exposes. Registering a duplicate
|
|
5456
|
+
* kind name throws. */
|
|
5259
5457
|
declare function createNodeProperties(): NodeProperties;
|
|
5260
5458
|
|
|
5261
5459
|
/** Radians-stored / degrees-shown conversion for `pose.rotation` leaves.
|
|
@@ -5307,6 +5505,8 @@ declare const inferredNodeProperties: readonly NodePropertiesEntry[];
|
|
|
5307
5505
|
* group level (see `renderSceneToCanvas`'s implementation).
|
|
5308
5506
|
*/
|
|
5309
5507
|
type SceneViewDrawOne<TData, TLayer extends string, TPose> = (node: Node$1<TData, TLayer, TPose>, pose: TPose, view: View) => DrawCommand[];
|
|
5508
|
+
/** What to draw into an existing canvas: the scene, the view, and the same
|
|
5509
|
+
* painting hooks `<SceneCanvas>` takes. */
|
|
5310
5510
|
interface RenderSceneToCanvasArgs<TData, TLayer extends string, TPose> {
|
|
5311
5511
|
/** The DOM canvas to paint into. The helper owns its WebGL2 context: the
|
|
5312
5512
|
* first call on a given canvas creates a renderer and stashes it; subsequent
|
|
@@ -5379,6 +5579,7 @@ declare function buildSceneViewCommands<TData, TLayer extends string, TPose>(sce
|
|
|
5379
5579
|
*/
|
|
5380
5580
|
declare function renderSceneToCanvas<TData, TLayer extends string, TPose>(args: RenderSceneToCanvasArgs<TData, TLayer, TPose>): void;
|
|
5381
5581
|
|
|
5582
|
+
/** Props for `<SceneViewCanvas>`. */
|
|
5382
5583
|
interface SceneViewCanvasProps<TData, TLayer extends string, TPose> {
|
|
5383
5584
|
/** Scene to render. Must be the same `Scene` instance passed to whoever
|
|
5384
5585
|
* is mutating it; the component subscribes to its version stream and
|
|
@@ -5423,6 +5624,9 @@ declare function SceneViewCanvasInner<TData, TLayer extends string, TPose>(props
|
|
|
5423
5624
|
*/
|
|
5424
5625
|
declare const SceneViewCanvas: typeof SceneViewCanvasInner;
|
|
5425
5626
|
|
|
5627
|
+
/** Build a scene outside React. `useScene` is the usual entry point; reach for
|
|
5628
|
+
* this in tests, in headless rendering, or wherever a scene must outlive a
|
|
5629
|
+
* component. Throws if no system layers are declared. */
|
|
5426
5630
|
declare function createScene<TData, TLayer extends string, TPose = RectPose>(options: UseSceneOptions<TData, TLayer, TPose>): Scene<TData, TLayer, TPose>;
|
|
5427
5631
|
/** Reconstruct a Scene from a JSON snapshot produced by `scene.toJSON()`.
|
|
5428
5632
|
* Function fields (e.g., `clipFromPose`) are resolved by string key via the
|
|
@@ -5466,6 +5670,8 @@ type DefaultLayer = typeof DEFAULT_LAYER;
|
|
|
5466
5670
|
declare function useScene<TItem extends {
|
|
5467
5671
|
id: string;
|
|
5468
5672
|
}>(options: UseSceneTrivialOptions<TItem>): Scene<TItem, DefaultLayer, TItem>;
|
|
5673
|
+
/** The full call shape: explicit layers, initial nodes, custom ops, and
|
|
5674
|
+
* history configuration. */
|
|
5469
5675
|
declare function useScene<TData, TLayer extends string, TPose = RectPose>(options: UseSceneOptions<TData, TLayer, TPose>): Scene<TData, TLayer, TPose>;
|
|
5470
5676
|
|
|
5471
5677
|
/**
|
|
@@ -5545,6 +5751,7 @@ declare function computeFitView<TData, TLayer extends string, TPose>(scene: Scen
|
|
|
5545
5751
|
*/
|
|
5546
5752
|
declare function computeIndicatorCommand(mainView: View, mainViewDims: ViewportDims, style?: IndicatorStyle): PathDrawCommand;
|
|
5547
5753
|
|
|
5754
|
+
/** Props for `<MinimapCanvas>`. */
|
|
5548
5755
|
interface MinimapCanvasProps<TData, TLayer extends string, TPose> {
|
|
5549
5756
|
/** Same scene the main canvas is rendering. */
|
|
5550
5757
|
scene: Scene<TData, TLayer, TPose>;
|
|
@@ -5612,6 +5819,7 @@ interface HeadlessCanvasLike {
|
|
|
5612
5819
|
height: number;
|
|
5613
5820
|
getContext(contextId: 'webgl2', options?: WebGLContextAttributes): unknown;
|
|
5614
5821
|
}
|
|
5822
|
+
/** What to render, at what resolution, and with which quality settings. */
|
|
5615
5823
|
interface RenderSceneToPixelsArgs<TData, TLayer extends string, TPose> {
|
|
5616
5824
|
scene: Scene<TData, TLayer, TPose>;
|
|
5617
5825
|
/** Scene-space rect to render (origin + size in scene units). Output pixel
|
|
@@ -5655,6 +5863,8 @@ interface RenderSceneToPixelsArgs<TData, TLayer extends string, TPose> {
|
|
|
5655
5863
|
* `flattenTolerance`. Explicitly passing 0.25 is always valid. */
|
|
5656
5864
|
flattenTolerancePx?: number;
|
|
5657
5865
|
}
|
|
5866
|
+
/** The result of planning a headless render: how big the output is, the view
|
|
5867
|
+
* that maps the source rect onto it, and the commands to draw. */
|
|
5658
5868
|
interface PixelRenderPlan {
|
|
5659
5869
|
width: number;
|
|
5660
5870
|
height: number;
|
|
@@ -5665,6 +5875,15 @@ interface PixelRenderPlan {
|
|
|
5665
5875
|
* anisotropic `View`, and the full command list (background + view-wrapped
|
|
5666
5876
|
* scene). Exported for tests and for callers targeting their own renderer. */
|
|
5667
5877
|
declare function planPixelRender<TData, TLayer extends string, TPose>(args: Omit<RenderSceneToPixelsArgs<TData, TLayer, TPose>, 'gl' | 'createCanvas' | 'flattenTolerancePx'>): PixelRenderPlan;
|
|
5878
|
+
/**
|
|
5879
|
+
* Render part of a scene to raw pixels, with no canvas mounted and no React
|
|
5880
|
+
* involved — for export, thumbnails, print, and pixel-diff tests.
|
|
5881
|
+
*
|
|
5882
|
+
* Output size follows from the source rect and the requested scale, so
|
|
5883
|
+
* rendering the same region at a higher scale is a real resolution increase
|
|
5884
|
+
* rather than an upscale: curves are re-flattened and glyphs re-rasterized for
|
|
5885
|
+
* the output resolution.
|
|
5886
|
+
*/
|
|
5668
5887
|
declare function renderSceneToPixels<TData, TLayer extends string, TPose>(args: RenderSceneToPixelsArgs<TData, TLayer, TPose>): RasterImage;
|
|
5669
5888
|
|
|
5670
5889
|
/**
|
|
@@ -5741,22 +5960,36 @@ declare function SelectionContextProviderIfRoot({ children, }: {
|
|
|
5741
5960
|
*/
|
|
5742
5961
|
declare function usePublishSelection(ids: readonly NodeId[], kinds?: readonly (string | undefined)[]): void;
|
|
5743
5962
|
|
|
5963
|
+
/** Mount a `<PointerContextProvider>` only when none is already in scope. */
|
|
5744
5964
|
declare function PointerProviderIfRoot({ children }: {
|
|
5745
5965
|
children: ReactNode;
|
|
5746
5966
|
}): react_jsx_runtime.JSX.Element;
|
|
5747
5967
|
|
|
5968
|
+
/** Mount an `<ActionsProvider>` only when none is already in scope, so
|
|
5969
|
+
* nesting canvases share one action registry instead of shadowing it. */
|
|
5748
5970
|
declare function ActionsProviderIfRoot({ children }: {
|
|
5749
5971
|
children: ReactNode;
|
|
5750
5972
|
}): react_jsx_runtime.JSX.Element;
|
|
5751
5973
|
|
|
5974
|
+
/** Mount a `<DepRegistryProvider>` only when none is already in scope, so a
|
|
5975
|
+
* consumer's dep sources are not shadowed by a nested canvas. */
|
|
5752
5976
|
declare function DepRegistryProviderIfRoot({ children }: {
|
|
5753
5977
|
children: ReactNode;
|
|
5754
5978
|
}): react_jsx_runtime.JSX.Element;
|
|
5755
5979
|
|
|
5980
|
+
/**
|
|
5981
|
+
* Mounts every kit-wide provider at once — deps, actions, active tool,
|
|
5982
|
+
* selection and pointer — each only if one is not already in scope.
|
|
5983
|
+
*
|
|
5984
|
+
* `<SceneCanvas>` does this for itself, so this is for the case where kit
|
|
5985
|
+
* state has to be shared by things outside a canvas: a toolbar, a property
|
|
5986
|
+
* panel, or two canvases that should agree on the selection.
|
|
5987
|
+
*/
|
|
5756
5988
|
declare function WeaselProvider({ children }: {
|
|
5757
5989
|
children: ReactNode;
|
|
5758
5990
|
}): react_jsx_runtime.JSX.Element;
|
|
5759
5991
|
|
|
5992
|
+
/** Options for `useCanvasFocus`. */
|
|
5760
5993
|
interface UseCanvasFocusOptions {
|
|
5761
5994
|
/** Initial focus state. Default `false` — handles hidden until first click. */
|
|
5762
5995
|
initial?: boolean;
|
|
@@ -5764,6 +5997,8 @@ interface UseCanvasFocusOptions {
|
|
|
5764
5997
|
* document tab order). Set to `-1` for programmatic-only focus. */
|
|
5765
5998
|
tabIndex?: number;
|
|
5766
5999
|
}
|
|
6000
|
+
/** What `useCanvasFocus` hands back: the focus state, the props that
|
|
6001
|
+
* maintain it, and a getter for reading it from per-frame code. */
|
|
5767
6002
|
interface CanvasFocusReturn {
|
|
5768
6003
|
/** Live boolean — true when the element has DOM focus. Triggers re-renders
|
|
5769
6004
|
* when the focus state changes (set via React state). */
|
|
@@ -5783,6 +6018,8 @@ interface CanvasFocusReturn {
|
|
|
5783
6018
|
/** Imperative focus / blur. Useful for tests and programmatic control. */
|
|
5784
6019
|
setFocused: (next: boolean) => void;
|
|
5785
6020
|
}
|
|
6021
|
+
/** Track DOM focus on the canvas, so chrome that should only show while the
|
|
6022
|
+
* canvas is focused can be gated on it. */
|
|
5786
6023
|
declare function useCanvasFocus(options?: UseCanvasFocusOptions): CanvasFocusReturn;
|
|
5787
6024
|
|
|
5788
6025
|
/**
|
|
@@ -5796,6 +6033,7 @@ declare function useCanvasFocus(options?: UseCanvasFocusOptions): CanvasFocusRet
|
|
|
5796
6033
|
* construction time.
|
|
5797
6034
|
*/
|
|
5798
6035
|
|
|
6036
|
+
/** Options for `gateLayer`. */
|
|
5799
6037
|
interface GateLayerOptions<TData> {
|
|
5800
6038
|
/** The wrapped layer. Its `id`, `label`, `defaultVisible`, `alwaysOn`,
|
|
5801
6039
|
* `space` flow through unchanged. */
|
|
@@ -5803,6 +6041,9 @@ interface GateLayerOptions<TData> {
|
|
|
5803
6041
|
/** Returns `true` to render the layer this frame, `false` to skip. */
|
|
5804
6042
|
visible: () => boolean;
|
|
5805
6043
|
}
|
|
6044
|
+
/** Wrap a render layer so it only draws while `visible()` is true. The
|
|
6045
|
+
* predicate is consulted per frame, which is how chrome follows canvas focus
|
|
6046
|
+
* without the layer knowing anything about focus. */
|
|
5806
6047
|
declare function gateLayer<TData>(opts: GateLayerOptions<TData>): RenderLayer<TData>;
|
|
5807
6048
|
|
|
5808
6049
|
/**
|
|
@@ -5858,7 +6099,7 @@ declare function createChildrenLayer<TData = unknown>(opts: CreateChildrenLayerO
|
|
|
5858
6099
|
* don't fit the region model.
|
|
5859
6100
|
*/
|
|
5860
6101
|
declare function composeAffordanceLayer(id: string, label: string, affordances: readonly Affordance[]): RenderLayer<ChromeState> & {
|
|
5861
|
-
hitTest(wx: number, wy: number, state:
|
|
6102
|
+
hitTest(wx: number, wy: number, state: unknown, view: View, dims: {
|
|
5862
6103
|
width: number;
|
|
5863
6104
|
height: number;
|
|
5864
6105
|
}, isVisible?: (id: string) => boolean): LayerHit | null;
|
|
@@ -5928,6 +6169,8 @@ declare function annulusSemiAxes(shape: Extract<AffordanceRegion['shape'], {
|
|
|
5928
6169
|
ry: number;
|
|
5929
6170
|
};
|
|
5930
6171
|
|
|
6172
|
+
/** Options for `createCornerResizeAffordance` — the size and appearance of
|
|
6173
|
+
* the corner handles. */
|
|
5931
6174
|
interface CornerResizeAffordanceOptions {
|
|
5932
6175
|
/** Hit radius (screen-px) for the corner handles. Default 8. */
|
|
5933
6176
|
handleHitRadius?: number;
|
|
@@ -5936,6 +6179,8 @@ interface CornerResizeAffordanceOptions {
|
|
|
5936
6179
|
fill?: string;
|
|
5937
6180
|
stroke?: string;
|
|
5938
6181
|
}
|
|
6182
|
+
/** What a corner-resize hit hands to the resize action: which corner stays
|
|
6183
|
+
* put, what is being resized, and the world-space pivot to scale from. */
|
|
5939
6184
|
interface CornerResizeScratch extends CommonAffordanceScratch {
|
|
5940
6185
|
/** Resize anchor identifying the OPPOSITE corner (the one that stays
|
|
5941
6186
|
* fixed). Matches the kit's existing ResizeAnchor convention. */
|
|
@@ -5963,6 +6208,8 @@ interface CornerResizeScratch extends CommonAffordanceScratch {
|
|
|
5963
6208
|
*/
|
|
5964
6209
|
declare function createCornerResizeAffordance(opts?: CornerResizeAffordanceOptions): Affordance;
|
|
5965
6210
|
|
|
6211
|
+
/** Options for `createRotationAffordance` — how thick the rotate band is
|
|
6212
|
+
* outside the selection, and how (or whether) it is painted. */
|
|
5966
6213
|
interface RotationAffordanceOptions {
|
|
5967
6214
|
/** Minimum screen-space thickness of the rotate-zone band outside the
|
|
5968
6215
|
* selection AABB. The outer ellipse semi-axes are clamped to
|
|
@@ -5982,6 +6229,8 @@ interface RotationAffordanceOptions {
|
|
|
5982
6229
|
/** Cursor while hovering the ring. Defaults to `'grab'`. */
|
|
5983
6230
|
cursor?: string;
|
|
5984
6231
|
}
|
|
6232
|
+
/** What a rotation-handle hit hands to the rotate action: what is being
|
|
6233
|
+
* rotated, and the world-space pivot it turns around. */
|
|
5985
6234
|
interface RotationScratch extends CommonAffordanceScratch {
|
|
5986
6235
|
/** Id of the rotation target — single selection id, or
|
|
5987
6236
|
* `MULTI_RESIZE_TARGET_ID` for multi-selection. */
|
|
@@ -6036,12 +6285,16 @@ interface AnchorState {
|
|
|
6036
6285
|
/** Current editable path for a node id. Non-polygon values are ignored. */
|
|
6037
6286
|
getPose(id: string): unknown;
|
|
6038
6287
|
}
|
|
6288
|
+
/** Options for the path-anchor affordances. */
|
|
6039
6289
|
interface PathAnchorAffordanceOptions {
|
|
6040
6290
|
/** Hit radius (screen-px) for anchor and control points. Default 8. */
|
|
6041
6291
|
hitRadius?: number;
|
|
6042
6292
|
/** Cursor while hovering an anchor or control. Defaults to `'pointer'`. */
|
|
6043
6293
|
cursor?: string;
|
|
6044
6294
|
}
|
|
6295
|
+
/** What an anchor hit hands to the action that follows: which path, which
|
|
6296
|
+
* anchor, and whether the grab was on the anchor itself or one of its two
|
|
6297
|
+
* control points. */
|
|
6045
6298
|
interface AnchorScratch extends CommonAffordanceScratch {
|
|
6046
6299
|
/** Node id of the path the anchor belongs to. */
|
|
6047
6300
|
targetId: string;
|
|
@@ -6167,6 +6420,7 @@ interface MeasuredText {
|
|
|
6167
6420
|
/** Greedy word-wrap text measurement against `maxWidth`; preserves explicit `\n` breaks. */
|
|
6168
6421
|
declare function measureText(ctx: CanvasRenderingContext2D, text: string, maxWidth: number, style: ResolvedTextStyle): MeasuredText;
|
|
6169
6422
|
|
|
6423
|
+
/** Options for `measureTextBounds`. */
|
|
6170
6424
|
interface MeasureTextBoundsOpts {
|
|
6171
6425
|
/** Wrap width; words exceeding it start a new line. Default `Infinity` (no wrap). */
|
|
6172
6426
|
maxWidth?: number;
|
|
@@ -6277,10 +6531,12 @@ declare function caretIndexAt(ctx: CanvasRenderingContext2D, x: number, y: numbe
|
|
|
6277
6531
|
* closing edge from `polygon[N-1]` to `polygon[0]` is implicit. Even-odd
|
|
6278
6532
|
* fill rule (matches `pointInPath`).
|
|
6279
6533
|
*/
|
|
6534
|
+
/** A 2D point or vector. */
|
|
6280
6535
|
interface Vec2 {
|
|
6281
6536
|
x: number;
|
|
6282
6537
|
y: number;
|
|
6283
6538
|
}
|
|
6539
|
+
/** An axis-aligned rectangle. */
|
|
6284
6540
|
interface Rect {
|
|
6285
6541
|
x: number;
|
|
6286
6542
|
y: number;
|
|
@@ -6376,6 +6632,8 @@ declare function fitTextPose(ctx: CanvasRenderingContext2D, pose: TextPose, opts
|
|
|
6376
6632
|
* `isMixed` check, regardless of what's being aggregated.
|
|
6377
6633
|
*/
|
|
6378
6634
|
declare const MIXED: unique symbol;
|
|
6635
|
+
/** The type of {@link MIXED}. Property panels use it to say "the selection
|
|
6636
|
+
* does not agree on this value" without colliding with any real value. */
|
|
6379
6637
|
type Mixed = typeof MIXED;
|
|
6380
6638
|
|
|
6381
6639
|
/**
|
|
@@ -6701,6 +6959,8 @@ interface UseSceneTextEditReturn extends UseTextEditReturn {
|
|
|
6701
6959
|
* a caret offset via `caretIndexAt`, and starts edit on that node. */
|
|
6702
6960
|
onDoubleClick: (e: MouseEvent$1<HTMLElement>) => void;
|
|
6703
6961
|
}
|
|
6962
|
+
/** Wire double-click-to-edit text on a scene: mounts a DOM editing overlay
|
|
6963
|
+
* over the node being edited and writes the result back as an undoable op. */
|
|
6704
6964
|
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;
|
|
6705
6965
|
|
|
6706
6966
|
/**
|
|
@@ -6727,6 +6987,8 @@ declare function useSceneTextEdit<TData extends DefaultTextData, TLayer extends
|
|
|
6727
6987
|
|
|
6728
6988
|
/** The additive run flags. */
|
|
6729
6989
|
type FlagKey = 'bold' | 'italic' | 'underline' | 'strikethrough';
|
|
6990
|
+
/** The result of toggling a style flag over a text range: the rewritten runs
|
|
6991
|
+
* and node style, and whether the change could be made at all. */
|
|
6730
6992
|
interface SetFlagResult {
|
|
6731
6993
|
runs: StyledRun[];
|
|
6732
6994
|
style: TextStyle;
|
|
@@ -6763,6 +7025,9 @@ declare function setFlagOverRange(runs: readonly StyledRun[], style: TextStyle,
|
|
|
6763
7025
|
* silently different result.
|
|
6764
7026
|
*/
|
|
6765
7027
|
|
|
7028
|
+
/** Build a draw command for a single unstyled string. Text is laid out with
|
|
7029
|
+
* the registered font's metrics, wrapped at `maxWidth` and aligned within
|
|
7030
|
+
* `height` when both are given. */
|
|
6766
7031
|
declare function textCommand(x: number, y: number, text: string, style?: TextStyle, maxWidth?: number, height?: number, verticalAlign?: TextVerticalAlign): DrawCommand;
|
|
6767
7032
|
|
|
6768
7033
|
/**
|
|
@@ -6932,6 +7197,8 @@ declare function gradientForBounds(kind: GradientKind, bounds: {
|
|
|
6932
7197
|
* the renderer in one frame.
|
|
6933
7198
|
*/
|
|
6934
7199
|
|
|
7200
|
+
/** The box a `'bounds'` gradient's normalized geometry is mapped onto —
|
|
7201
|
+
* usually a node's bounds. */
|
|
6935
7202
|
interface FillPoseBox {
|
|
6936
7203
|
x: number;
|
|
6937
7204
|
y: number;
|
|
@@ -7142,6 +7409,9 @@ interface MoveToIndexArgs {
|
|
|
7142
7409
|
/** Op: move all `ids` to a contiguous block starting at `index` within `parentId`'s child order. */
|
|
7143
7410
|
declare function createMoveToIndexOp(args: MoveToIndexArgs): Op;
|
|
7144
7411
|
|
|
7412
|
+
/** The geometry fields a `setPath` op replaces together — the path itself,
|
|
7413
|
+
* whether it is closed, and the parameters it was generated from. They move
|
|
7414
|
+
* as one so a parametric shape and its baked path never disagree. */
|
|
7145
7415
|
interface SetPathFields {
|
|
7146
7416
|
path: unknown;
|
|
7147
7417
|
closed: boolean;
|
|
@@ -7187,6 +7457,7 @@ interface HitAdapter<TNode extends {
|
|
|
7187
7457
|
getPose: (id: string) => TPose;
|
|
7188
7458
|
getParent: (id: string) => string | null;
|
|
7189
7459
|
}
|
|
7460
|
+
/** Options for `nestedHitTester`. */
|
|
7190
7461
|
interface NestedHitOpts<TNode extends {
|
|
7191
7462
|
id: string;
|
|
7192
7463
|
}, TPose> {
|
|
@@ -7203,6 +7474,8 @@ interface NestedHitOpts<TNode extends {
|
|
|
7203
7474
|
* never (treat every object as hittable). */
|
|
7204
7475
|
isGroup?: (id: string, obj: TNode | undefined) => boolean;
|
|
7205
7476
|
}
|
|
7477
|
+
/** Hit-test entry points for a nested scene: one that always picks the
|
|
7478
|
+
* outermost ancestor, and one that steps deeper on alt-click. */
|
|
7206
7479
|
interface NestedHitTester {
|
|
7207
7480
|
/** Outermost-ancestor pick. Suitable as the chrome-level `pickEvery`: a
|
|
7208
7481
|
* casual click selects the whole top-level ancestor. Returns `null` on
|
|
@@ -7216,6 +7489,9 @@ interface NestedHitTester {
|
|
|
7216
7489
|
* Plug into `useSelectTool({ pickBest })`. */
|
|
7217
7490
|
pickBest: (worldX: number, worldY: number, alt: boolean, selection: readonly string[]) => string | null;
|
|
7218
7491
|
}
|
|
7492
|
+
/** Build hit-testers that respect containers: a plain click selects the
|
|
7493
|
+
* top-level ancestor, and alt-clicking descends one level at a time toward
|
|
7494
|
+
* the leaf actually under the pointer. */
|
|
7219
7495
|
declare function nestedHitTester<TNode extends {
|
|
7220
7496
|
id: string;
|
|
7221
7497
|
}, TPose>(adapter: HitAdapter<TNode, TPose>, opts: NestedHitOpts<TNode, TPose>): NestedHitTester;
|
|
@@ -7332,6 +7608,9 @@ declare function boundsOfPath(path: Path): RectPath;
|
|
|
7332
7608
|
* uses it to validate the array length in dev builds.
|
|
7333
7609
|
*/
|
|
7334
7610
|
|
|
7611
|
+
/** One anchor of an editable path: its on-curve point plus the two control
|
|
7612
|
+
* handles that shape the segments either side of it. Handles are in the same
|
|
7613
|
+
* space as the point, and absent when the adjoining segment is straight. */
|
|
7335
7614
|
interface PenAnchor {
|
|
7336
7615
|
x: number;
|
|
7337
7616
|
y: number;
|
|
@@ -7357,6 +7636,8 @@ declare function pathToAnchors(path: PolygonPath): {
|
|
|
7357
7636
|
anchors: PenAnchor[][];
|
|
7358
7637
|
closed: boolean[];
|
|
7359
7638
|
};
|
|
7639
|
+
/** How many anchors a path has. Matches the per-anchor arrays the renderer
|
|
7640
|
+
* expects for `vertexColors`. */
|
|
7360
7641
|
declare function countPathAnchors(path: Path): number;
|
|
7361
7642
|
|
|
7362
7643
|
interface Point {
|
|
@@ -7670,6 +7951,10 @@ declare function flattenQuadratic(x0: number, y0: number, x1: number, y1: number
|
|
|
7670
7951
|
* front.
|
|
7671
7952
|
*/
|
|
7672
7953
|
declare function flattenCubicWithArcLen(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, tolerance: number, out: number[], arcOut: number[]): number;
|
|
7954
|
+
/** Flatten a quadratic bezier into line segments within `tolerance`, appending
|
|
7955
|
+
* points to `out` and their cumulative arc lengths to `arcOut`. The arc
|
|
7956
|
+
* lengths are what lets per-anchor color and dash phase be interpolated
|
|
7957
|
+
* evenly along the curve rather than per segment. */
|
|
7673
7958
|
declare function flattenQuadraticWithArcLen(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, tolerance: number, out: number[], arcOut: number[]): number;
|
|
7674
7959
|
|
|
7675
7960
|
/**
|
|
@@ -7734,8 +8019,11 @@ declare function decomposePath(parent: Path, world: Path): Path;
|
|
|
7734
8019
|
* one subpath is also returned as a single-element array — a trivial pass.
|
|
7735
8020
|
*/
|
|
7736
8021
|
|
|
8022
|
+
/** Split a path into one path per subpath, cutting at each `M`. A path with a
|
|
8023
|
+
* single subpath comes back as a one-element array. */
|
|
7737
8024
|
declare function splitSubpaths(path: PolygonPath): PolygonPath[];
|
|
7738
8025
|
|
|
8026
|
+
/** Options for `splitByLine`. */
|
|
7739
8027
|
interface SplitByLineOptions {
|
|
7740
8028
|
/** Polyline flattening tolerance for the boundary-crossing gate. */
|
|
7741
8029
|
flattenTolerance?: number;
|
|
@@ -7795,6 +8083,7 @@ declare const pathOriginProjection: OriginProjection<Path>;
|
|
|
7795
8083
|
* argument.
|
|
7796
8084
|
*/
|
|
7797
8085
|
|
|
8086
|
+
/** Appearance of the pen tool's in-progress path. */
|
|
7798
8087
|
interface PenPreviewStyle {
|
|
7799
8088
|
anchorFill?: string;
|
|
7800
8089
|
anchorStroke?: string;
|
|
@@ -7803,12 +8092,16 @@ interface PenPreviewStyle {
|
|
|
7803
8092
|
closeHintFill?: string;
|
|
7804
8093
|
finishedSubpathStroke?: string;
|
|
7805
8094
|
}
|
|
8095
|
+
/** Options for `createPenPreviewLayer`. */
|
|
7806
8096
|
interface CreatePenPreviewLayerOptions {
|
|
7807
8097
|
/** The Tool returned by usePenTool. The layer reads its scratch via
|
|
7808
8098
|
* `tool.initScratch()` (the hook is contracted to return a stable ref). */
|
|
7809
8099
|
penTool: Tool<PenScratch>;
|
|
7810
8100
|
style?: PenPreviewStyle;
|
|
7811
8101
|
}
|
|
8102
|
+
/** Render layer that draws the pen tool's path as it is being placed —
|
|
8103
|
+
* committed anchors, the rubber band to the cursor, and the close hint. Draws
|
|
8104
|
+
* nothing when the pen is idle. */
|
|
7812
8105
|
declare function createPenPreviewLayer(opts: CreatePenPreviewLayerOptions): RenderLayer<unknown>;
|
|
7813
8106
|
|
|
7814
8107
|
/**
|
|
@@ -7833,6 +8126,8 @@ declare function createPenPreviewLayer(opts: CreatePenPreviewLayerOptions): Rend
|
|
|
7833
8126
|
* stay constant regardless of zoom.
|
|
7834
8127
|
*/
|
|
7835
8128
|
|
|
8129
|
+
/** Options for `createPathEditingOverlayLayer`. Everything is read per frame,
|
|
8130
|
+
* so the layer follows a changing edit target without being rebuilt. */
|
|
7836
8131
|
interface CreatePathEditingOverlayLayerOptions {
|
|
7837
8132
|
/** Returns the id of the polygon currently in anchor-edit mode, or null
|
|
7838
8133
|
* when no node is being edited. Read each frame so live selection /
|
|
@@ -7863,6 +8158,7 @@ interface CreatePathEditingOverlayLayerOptions {
|
|
|
7863
8158
|
/** Optional styling overrides. */
|
|
7864
8159
|
style?: PathEditingOverlayStyle;
|
|
7865
8160
|
}
|
|
8161
|
+
/** Appearance of the anchor and handle markers. */
|
|
7866
8162
|
interface PathEditingOverlayStyle {
|
|
7867
8163
|
anchorSizePx?: number;
|
|
7868
8164
|
handleDotRadiusPx?: number;
|
|
@@ -7882,6 +8178,9 @@ interface PathEditingOverlayStyle {
|
|
|
7882
8178
|
/** Fill of the marquee rubber band. */
|
|
7883
8179
|
marqueeFill?: string;
|
|
7884
8180
|
}
|
|
8181
|
+
/** Render layer that draws the anchors and control handles of the path
|
|
8182
|
+
* currently being anchor-edited. Draws nothing when no path is being
|
|
8183
|
+
* edited. */
|
|
7885
8184
|
declare function createPathEditingOverlayLayer(opts: CreatePathEditingOverlayLayerOptions): RenderLayer<unknown>;
|
|
7886
8185
|
|
|
7887
8186
|
/** Union of N paths. Commutative. Returns an empty path if all inputs are empty. */
|
|
@@ -7945,6 +8244,7 @@ interface SharedAnchor {
|
|
|
7945
8244
|
/** Spiro continuity class at this anchor. Default 'g2-smooth'. */
|
|
7946
8245
|
spiroType?: 'corner' | 'g2-smooth' | 'g4-smooth';
|
|
7947
8246
|
}
|
|
8247
|
+
/** Which curve representation an anchor set is interpreted through. */
|
|
7948
8248
|
type CurveRepKind = 'bezierCubic' | 'bezierQuadratic' | 'nurbs' | 'spiro';
|
|
7949
8249
|
/** A user-facing control surfaced by a representation. Rendered uniformly
|
|
7950
8250
|
* by the demo's panel sidebar. */
|
|
@@ -7987,14 +8287,19 @@ interface CurveRepresentation {
|
|
|
7987
8287
|
discriminators(anchors: SharedAnchor[]): Discriminator[];
|
|
7988
8288
|
}
|
|
7989
8289
|
|
|
8290
|
+
/** Cubic bezier: each segment takes two control handles. The familiar pen-tool curve, and what SVG path data stores natively. */
|
|
7990
8291
|
declare const bezierCubic: CurveRepresentation;
|
|
7991
8292
|
|
|
8293
|
+
/** Quadratic bezier: one control point per segment. Cheaper than cubic and what TrueType glyph outlines use, at the cost of expressiveness. */
|
|
7992
8294
|
declare const bezierQuadratic: CurveRepresentation;
|
|
7993
8295
|
|
|
8296
|
+
/** NURBS: anchors act as weighted control points the curve is pulled toward rather than passing through. Flattened to line segments when converted to a path. */
|
|
7994
8297
|
declare const nurbs: CurveRepresentation;
|
|
7995
8298
|
|
|
8299
|
+
/** Spiro (κ-curves): curvature-continuous through each anchor, so joins stay visually smooth without hand-tuned handles. Approximated as cubics when converted to a path. */
|
|
7996
8300
|
declare const spiro: CurveRepresentation;
|
|
7997
8301
|
|
|
8302
|
+
/** Every curve representation the kit ships, keyed by kind. */
|
|
7998
8303
|
declare const CURVE_REPS: Readonly<Record<CurveRepKind, CurveRepresentation>>;
|
|
7999
8304
|
|
|
8000
8305
|
/**
|
|
@@ -8218,6 +8523,8 @@ declare function guideSnapStrategy<TPose extends {
|
|
|
8218
8523
|
x: number;
|
|
8219
8524
|
y: number;
|
|
8220
8525
|
}>(getGuides: () => readonly Guide[], options?: Omit<GuideSnapOptions<TPose>, 'origin'>): SnapStrategy<TPose>;
|
|
8526
|
+
/** As above, for a `TPose` that is not a rect: `origin` tells the strategy how
|
|
8527
|
+
* to read and write the pose's origin. */
|
|
8221
8528
|
declare function guideSnapStrategy<TPose>(getGuides: () => readonly Guide[], options: GuideSnapOptions<TPose> & {
|
|
8222
8529
|
origin: OriginProjection<TPose>;
|
|
8223
8530
|
}): SnapStrategy<TPose>;
|
|
@@ -8288,6 +8595,9 @@ interface AlignBounds {
|
|
|
8288
8595
|
/** Which feature of a box to test against candidates, per axis.
|
|
8289
8596
|
* 'min' = left/top edge, 'center' = centerline, 'max' = right/bottom edge. */
|
|
8290
8597
|
type AlignAnchor = 'min' | 'center' | 'max';
|
|
8598
|
+
/** The correction an alignment match asks for: the translation that lands the
|
|
8599
|
+
* dragged bounds on the matched guides, and the guides themselves so they can
|
|
8600
|
+
* be drawn. */
|
|
8291
8601
|
interface AlignMatchResult {
|
|
8292
8602
|
dx: number;
|
|
8293
8603
|
dy: number;
|
|
@@ -8301,6 +8611,8 @@ interface AlignBoundsProjection<TPose> {
|
|
|
8301
8611
|
boundsOf(pose: TPose): AlignBounds;
|
|
8302
8612
|
translate(pose: TPose, dx: number, dy: number): TPose;
|
|
8303
8613
|
}
|
|
8614
|
+
/** Which candidate lines to derive from a set of bounds — edges, centers, or
|
|
8615
|
+
* both, and whether the page box contributes its own. */
|
|
8304
8616
|
interface DeriveAlignmentGuidesOptions {
|
|
8305
8617
|
/** Include the document/page box's edges + center as candidates. */
|
|
8306
8618
|
page?: AlignBounds;
|
|
@@ -8423,16 +8735,22 @@ declare function rotationHandle(pose: {
|
|
|
8423
8735
|
* handle's center on both axes. Mirrors `hitCornerHandle`. */
|
|
8424
8736
|
declare function hitRotationHandle(handle: RotationHandle, px: number, py: number, radius: number): boolean;
|
|
8425
8737
|
|
|
8738
|
+
/** A point in world coordinates. */
|
|
8426
8739
|
interface DragRectPoint {
|
|
8427
8740
|
x: number;
|
|
8428
8741
|
y: number;
|
|
8429
8742
|
}
|
|
8743
|
+
/** The axis-aligned box between the drag's two corners, always with
|
|
8744
|
+
* non-negative extents regardless of drag direction. */
|
|
8430
8745
|
interface DragRectBounds {
|
|
8431
8746
|
x: number;
|
|
8432
8747
|
y: number;
|
|
8433
8748
|
width: number;
|
|
8434
8749
|
height: number;
|
|
8435
8750
|
}
|
|
8751
|
+
/** Live state of a rectangle drag, handed to each lifecycle callback. Either
|
|
8752
|
+
* corner can be moved mid-gesture, which is how a tool re-anchors a drag
|
|
8753
|
+
* without restarting it. */
|
|
8436
8754
|
interface DragRectCtx<TScratch = unknown> {
|
|
8437
8755
|
start: DragRectPoint;
|
|
8438
8756
|
current: DragRectPoint;
|
|
@@ -8445,12 +8763,15 @@ interface DragRectCtx<TScratch = unknown> {
|
|
|
8445
8763
|
/** Override the current point mid-gesture (between start and end). */
|
|
8446
8764
|
setCurrent(p: DragRectPoint): void;
|
|
8447
8765
|
}
|
|
8766
|
+
/** The context handed to `onEnd`, adding whether the final box is too small
|
|
8767
|
+
* to be meaningful. */
|
|
8448
8768
|
interface DragRectEndCtx<TScratch = unknown> extends DragRectCtx<TScratch> {
|
|
8449
8769
|
/** True if the end-time bounds are at or below `minBounds` on either axis.
|
|
8450
8770
|
* Present-tense state check — distinct from the base's retrospective
|
|
8451
8771
|
* `wasSubThreshold`. Computed by this wrapper, not by `useDragGesture`. */
|
|
8452
8772
|
isSubThreshold: boolean;
|
|
8453
8773
|
}
|
|
8774
|
+
/** Options for `useDragRect`. */
|
|
8454
8775
|
interface UseDragRectOptions<TScratch = unknown> {
|
|
8455
8776
|
minBounds?: {
|
|
8456
8777
|
width: number;
|
|
@@ -8470,6 +8791,7 @@ interface UseDragRectOptions<TScratch = unknown> {
|
|
|
8470
8791
|
* behavior is identical to today (identity passthrough). */
|
|
8471
8792
|
snapPoint?: (p: DragRectPoint) => DragRectPoint;
|
|
8472
8793
|
}
|
|
8794
|
+
/** Drives a rectangle drag and publishes the live box for overlay drawing. */
|
|
8473
8795
|
interface DragRectController {
|
|
8474
8796
|
start(worldX: number, worldY: number, modifiers: ModifierState): void;
|
|
8475
8797
|
move(worldX: number, worldY: number, modifiers: ModifierState): boolean;
|
|
@@ -8482,6 +8804,14 @@ interface DragRectController {
|
|
|
8482
8804
|
} | null;
|
|
8483
8805
|
readonly isActive: boolean;
|
|
8484
8806
|
}
|
|
8807
|
+
/**
|
|
8808
|
+
* The gesture "the user drew a rectangle": press, drag, release, with the
|
|
8809
|
+
* resulting box reported live and at commit.
|
|
8810
|
+
*
|
|
8811
|
+
* It is a spatial input primitive, not an insert mechanism — what the box
|
|
8812
|
+
* means is entirely up to whoever consumes it. Marquee selection, cropping and
|
|
8813
|
+
* shape insertion all sit on top of the same gesture.
|
|
8814
|
+
*/
|
|
8485
8815
|
declare function useDragRect<TScratch = unknown>(options?: UseDragRectOptions<TScratch>): DragRectController;
|
|
8486
8816
|
|
|
8487
8817
|
/** Pointer position in both world (gesture-coord) and client (CSS-px) space. */
|
|
@@ -8504,11 +8834,15 @@ interface DragGestureCtx<TScratch = unknown> {
|
|
|
8504
8834
|
/** 'pending' or 'active'. Never 'idle' inside a callback. */
|
|
8505
8835
|
phase: 'pending' | 'active';
|
|
8506
8836
|
}
|
|
8837
|
+
/** The context handed to `onEnd`, adding whether the gesture ever passed its
|
|
8838
|
+
* activation threshold. */
|
|
8507
8839
|
interface DragGestureEndCtx<TScratch = unknown> extends DragGestureCtx<TScratch> {
|
|
8508
8840
|
/** True if phase never reached 'active'. Wrappers without thresholdReached
|
|
8509
8841
|
* always see false here (their gesture activates at start()). */
|
|
8510
8842
|
wasSubThreshold: boolean;
|
|
8511
8843
|
}
|
|
8844
|
+
/** Options for `useDragGesture`: when the gesture becomes active, and what to
|
|
8845
|
+
* do at each point in its lifecycle. */
|
|
8512
8846
|
interface UseDragGestureOptions<TScratch = unknown> {
|
|
8513
8847
|
initScratch?: () => TScratch;
|
|
8514
8848
|
/** Predicate consulted on each move while phase === 'pending'. Return true
|
|
@@ -8523,6 +8857,8 @@ interface UseDragGestureOptions<TScratch = unknown> {
|
|
|
8523
8857
|
onGestureStart?: () => void;
|
|
8524
8858
|
onGestureEnd?: (committed: boolean) => void;
|
|
8525
8859
|
}
|
|
8860
|
+
/** Drives a drag gesture. The owner feeds it pointer positions; it decides
|
|
8861
|
+
* when the drag has really begun and calls back accordingly. */
|
|
8526
8862
|
interface DragGestureController {
|
|
8527
8863
|
start(point: DragGesturePoint, modifiers: ModifierState): void;
|
|
8528
8864
|
move(point: DragGesturePoint, modifiers: ModifierState): boolean;
|
|
@@ -8531,25 +8867,41 @@ interface DragGestureController {
|
|
|
8531
8867
|
readonly phase: DragGesturePhase;
|
|
8532
8868
|
readonly isActive: boolean;
|
|
8533
8869
|
}
|
|
8870
|
+
/**
|
|
8871
|
+
* The base drag primitive: tracks a pointer from press to release, with an
|
|
8872
|
+
* optional threshold below which the gesture stays pending and commits
|
|
8873
|
+
* nothing.
|
|
8874
|
+
*
|
|
8875
|
+
* It is a gesture and only a gesture — it says where the pointer went, never
|
|
8876
|
+
* what that should do. `useDragRect` and `useDragRadial` build on it, and
|
|
8877
|
+
* actions decide what to make of the result.
|
|
8878
|
+
*/
|
|
8534
8879
|
declare function useDragGesture<TScratch = unknown>(options?: UseDragGestureOptions<TScratch>): DragGestureController;
|
|
8535
8880
|
|
|
8881
|
+
/** A point in world coordinates. */
|
|
8536
8882
|
interface DragRadialPoint {
|
|
8537
8883
|
x: number;
|
|
8538
8884
|
y: number;
|
|
8539
8885
|
}
|
|
8886
|
+
/** A radial drag expressed as its center and the polar coordinates of the
|
|
8887
|
+
* cursor relative to it. */
|
|
8540
8888
|
interface DragRadialState {
|
|
8541
8889
|
center: DragRadialPoint;
|
|
8542
8890
|
radius: number;
|
|
8543
8891
|
rotation: number;
|
|
8544
8892
|
}
|
|
8893
|
+
/** Live state of a radial drag, handed to each lifecycle callback. */
|
|
8545
8894
|
interface DragRadialCtx<TScratch = unknown> extends DragRadialState {
|
|
8546
8895
|
modifiers: ModifierState;
|
|
8547
8896
|
scratch: TScratch;
|
|
8548
8897
|
}
|
|
8898
|
+
/** The context handed to `onEnd`, adding whether the final radius is too
|
|
8899
|
+
* small to be meaningful. */
|
|
8549
8900
|
interface DragRadialEndCtx<TScratch = unknown> extends DragRadialCtx<TScratch> {
|
|
8550
8901
|
/** True at end time if the radius is at or below `minRadius`. */
|
|
8551
8902
|
isSubThreshold: boolean;
|
|
8552
8903
|
}
|
|
8904
|
+
/** Options for `useDragRadial`. */
|
|
8553
8905
|
interface UseDragRadialOptions<TScratch = unknown> {
|
|
8554
8906
|
minRadius?: number;
|
|
8555
8907
|
initScratch?: () => TScratch;
|
|
@@ -8566,6 +8918,8 @@ interface UseDragRadialOptions<TScratch = unknown> {
|
|
|
8566
8918
|
* When omitted, behavior is identical to today (identity passthrough). */
|
|
8567
8919
|
snapPoint?: (p: DragRadialPoint) => DragRadialPoint;
|
|
8568
8920
|
}
|
|
8921
|
+
/** Drives a radial drag and publishes the live center/radius/rotation for
|
|
8922
|
+
* overlay drawing. */
|
|
8569
8923
|
interface DragRadialController {
|
|
8570
8924
|
start(worldX: number, worldY: number, modifiers: ModifierState): void;
|
|
8571
8925
|
move(worldX: number, worldY: number, modifiers: ModifierState): boolean;
|
|
@@ -8685,6 +9039,7 @@ declare function setScratch<T>(store: ScratchStore, key: ScratchKey<T>, value: T
|
|
|
8685
9039
|
* `false` if it wasn't. */
|
|
8686
9040
|
declare function deleteScratch<T>(store: ScratchStore, key: ScratchKey<T>): boolean;
|
|
8687
9041
|
|
|
9042
|
+
/** Options for `selectFromLasso`. */
|
|
8688
9043
|
interface SelectFromLassoOptions {
|
|
8689
9044
|
/** Hit mode for `hitTestLasso`. Default 'intersect'. */
|
|
8690
9045
|
mode?: LassoHitMode;
|
|
@@ -8711,10 +9066,6 @@ interface UseAlignOptions<TPose> {
|
|
|
8711
9066
|
geometry?: PoseProjection<TPose>;
|
|
8712
9067
|
/** Label passed to applyOps. Default 'Align'. */
|
|
8713
9068
|
label?: string;
|
|
8714
|
-
/** Auto-register the six default align actions into a surrounding
|
|
8715
|
-
* `<ActionsProvider>`. Default `true`. Pass `false` to skip registration
|
|
8716
|
-
* (e.g. you're calling `align()` imperatively from your own UI). */
|
|
8717
|
-
enableKeyboard?: boolean;
|
|
8718
9069
|
}
|
|
8719
9070
|
/** Return shape of `useAlign`. */
|
|
8720
9071
|
interface UseAlignReturn {
|
|
@@ -8755,9 +9106,6 @@ interface UseDistributeOptions<TPose> {
|
|
|
8755
9106
|
defaultMode?: DistributeMode;
|
|
8756
9107
|
/** Label passed to applyOps. Default 'Distribute'. */
|
|
8757
9108
|
label?: string;
|
|
8758
|
-
/** Auto-register the two default distribute actions into a surrounding
|
|
8759
|
-
* `<ActionsProvider>`. Default `true`. Pass `false` to skip registration. */
|
|
8760
|
-
enableKeyboard?: boolean;
|
|
8761
9109
|
}
|
|
8762
9110
|
/** Return shape of `useDistribute`. */
|
|
8763
9111
|
interface UseDistributeReturn {
|
|
@@ -8769,6 +9117,8 @@ interface UseDistributeReturn {
|
|
|
8769
9117
|
* remaining items are repositioned. Single batch — one undo step. */
|
|
8770
9118
|
declare function useDistribute<TPose>(adapter: DistributeAdapter<TPose>, options?: UseDistributeOptions<TPose>): UseDistributeReturn;
|
|
8771
9119
|
|
|
9120
|
+
/** The six Boolean path operations, each acting on the current selection and
|
|
9121
|
+
* committing as one undo step. */
|
|
8772
9122
|
interface UseBooleansReturn {
|
|
8773
9123
|
union(): void;
|
|
8774
9124
|
intersect(): void;
|
|
@@ -8777,13 +9127,18 @@ interface UseBooleansReturn {
|
|
|
8777
9127
|
divide(): void;
|
|
8778
9128
|
crop(): void;
|
|
8779
9129
|
}
|
|
9130
|
+
/** Options for `useBooleans`. */
|
|
8780
9131
|
interface UseBooleansOptions {
|
|
8781
9132
|
/** No-op. Retained for source-compatibility; auto-registration is now
|
|
8782
9133
|
* handled by `useStandardActions` via the Pathfinder descriptors. */
|
|
8783
9134
|
enableActions?: boolean;
|
|
8784
9135
|
}
|
|
9136
|
+
/** Bind the Boolean path operations to an adapter that knows how to read the
|
|
9137
|
+
* selection, fetch world-space paths and mint result nodes. */
|
|
8785
9138
|
declare function useBooleans(adapter: BooleansAdapter, _options?: UseBooleansOptions): UseBooleansReturn;
|
|
8786
9139
|
|
|
9140
|
+
/** Publish a Boolean-ops adapter so the built-in Pathfinder actions can run.
|
|
9141
|
+
* Silently does nothing outside a `<DepRegistryProvider>`. */
|
|
8787
9142
|
declare function useBooleansAdapter(adapter: BooleansAdapter): void;
|
|
8788
9143
|
|
|
8789
9144
|
/**
|
|
@@ -8879,39 +9234,79 @@ declare const DEFAULT_DEBUG_THEME: DebugTheme;
|
|
|
8879
9234
|
*/
|
|
8880
9235
|
declare const DEFAULT_DEBUG_STROKES: DebugStrokes;
|
|
8881
9236
|
|
|
9237
|
+
/** No easing: constant rate from start to finish. */
|
|
8882
9238
|
declare const linear: EasingFn;
|
|
9239
|
+
/** Accelerates from a standstill, gently. */
|
|
8883
9240
|
declare const easeInQuad: EasingFn;
|
|
9241
|
+
/** Decelerates to a stop, gently. The safe default for UI motion. */
|
|
8884
9242
|
declare const easeOutQuad: EasingFn;
|
|
9243
|
+
/** Accelerates then decelerates, gently. */
|
|
8885
9244
|
declare const easeInOutQuad: EasingFn;
|
|
9245
|
+
/** Accelerates from a standstill, moderately. */
|
|
8886
9246
|
declare const easeInCubic: EasingFn;
|
|
9247
|
+
/** Decelerates to a stop, moderately. */
|
|
8887
9248
|
declare const easeOutCubic: EasingFn;
|
|
9249
|
+
/** Accelerates then decelerates, moderately. */
|
|
8888
9250
|
declare const easeInOutCubic: EasingFn;
|
|
9251
|
+
/** Accelerates from a standstill, sharply. */
|
|
8889
9252
|
declare const easeInQuart: EasingFn;
|
|
9253
|
+
/** Decelerates to a stop, sharply. */
|
|
8890
9254
|
declare const easeOutQuart: EasingFn;
|
|
9255
|
+
/** Accelerates then decelerates, sharply. */
|
|
8891
9256
|
declare const easeInOutQuart: EasingFn;
|
|
9257
|
+
/** Accelerates from a standstill, very sharply. */
|
|
8892
9258
|
declare const easeInQuint: EasingFn;
|
|
9259
|
+
/** Decelerates to a stop, very sharply. */
|
|
8893
9260
|
declare const easeOutQuint: EasingFn;
|
|
9261
|
+
/** Accelerates then decelerates, very sharply. */
|
|
8894
9262
|
declare const easeInOutQuint: EasingFn;
|
|
9263
|
+
/** Accelerates from a standstill along a sine curve — the mildest
|
|
9264
|
+
* acceleration of the built-ins. */
|
|
8895
9265
|
declare const easeInSine: EasingFn;
|
|
9266
|
+
/** Decelerates to a stop along a sine curve — the mildest
|
|
9267
|
+
* deceleration of the built-ins. */
|
|
8896
9268
|
declare const easeOutSine: EasingFn;
|
|
9269
|
+
/** Accelerates then decelerates along a sine curve. */
|
|
8897
9270
|
declare const easeInOutSine: EasingFn;
|
|
9271
|
+
/** Accelerates exponentially: barely moves at first, then rushes. */
|
|
8898
9272
|
declare const easeInExpo: EasingFn;
|
|
9273
|
+
/** Decelerates exponentially: leaps away, then creeps in. */
|
|
8899
9274
|
declare const easeOutExpo: EasingFn;
|
|
9275
|
+
/** Exponential at both ends — a very fast middle between two
|
|
9276
|
+
* near-still extremes. */
|
|
8900
9277
|
declare const easeInOutExpo: EasingFn;
|
|
9278
|
+
/** Accelerates along a circular arc: slow start, abrupt arrival. */
|
|
8901
9279
|
declare const easeInCirc: EasingFn;
|
|
9280
|
+
/** Decelerates along a circular arc: abrupt start, slow arrival. */
|
|
8902
9281
|
declare const easeOutCirc: EasingFn;
|
|
9282
|
+
/** Circular arcs at both ends. */
|
|
8903
9283
|
declare const easeInOutCirc: EasingFn;
|
|
9284
|
+
/** Pulls back past the start before moving forward. Overshoots below 0. */
|
|
8904
9285
|
declare const easeInBack: EasingFn;
|
|
9286
|
+
/** Overshoots the target, then settles back onto it. Exceeds 1. */
|
|
8905
9287
|
declare const easeOutBack: EasingFn;
|
|
9288
|
+
/** Overshoots at both ends. Leaves the 0–1 range on each side. */
|
|
8906
9289
|
declare const easeInOutBack: EasingFn;
|
|
9290
|
+
/** Oscillates around the start with growing amplitude, then snaps away. */
|
|
8907
9291
|
declare const easeInElastic: EasingFn;
|
|
9292
|
+
/** Springs past the target and wobbles into it. Exceeds 1. */
|
|
8908
9293
|
declare const easeOutElastic: EasingFn;
|
|
9294
|
+
/** Wobbles at both ends. Leaves the 0–1 range on each side. */
|
|
8909
9295
|
declare const easeInOutElastic: EasingFn;
|
|
9296
|
+
/** Lands on the target and bounces, in hops of decreasing height. */
|
|
8910
9297
|
declare const easeOutBounce: EasingFn;
|
|
9298
|
+
/** Bounces up to the start before departing — `easeOutBounce` reversed. */
|
|
8911
9299
|
declare const easeInBounce: EasingFn;
|
|
9300
|
+
/** Bounces at both ends. */
|
|
8912
9301
|
declare const easeInOutBounce: EasingFn;
|
|
9302
|
+
/** Alias for `easeInQuad`, kept for call sites that predate the
|
|
9303
|
+
* named-curve library. */
|
|
8913
9304
|
declare const easeIn: EasingFn;
|
|
9305
|
+
/** Alias for `easeOutQuad`, kept for call sites that predate the
|
|
9306
|
+
* named-curve library. */
|
|
8914
9307
|
declare const easeOut: EasingFn;
|
|
9308
|
+
/** Alias for `easeInOutQuad`, kept for call sites that predate the
|
|
9309
|
+
* named-curve library. */
|
|
8915
9310
|
declare const easeInOut: EasingFn;
|
|
8916
9311
|
/** All easings in one bag — useful for demos / pickers. */
|
|
8917
9312
|
declare const EASINGS: {
|
|
@@ -8947,11 +9342,18 @@ declare const EASINGS: {
|
|
|
8947
9342
|
readonly easeOutBounce: EasingFn;
|
|
8948
9343
|
readonly easeInOutBounce: EasingFn;
|
|
8949
9344
|
};
|
|
9345
|
+
/** The name of one of the built-in easing curves. */
|
|
8950
9346
|
type EasingName = keyof typeof EASINGS;
|
|
9347
|
+
/** Named spring tunings, from softest to firmest. Springs settle on a target
|
|
9348
|
+
* rather than running for a fixed duration, so these are an alternative to an
|
|
9349
|
+
* easing curve, not a modifier on one. */
|
|
8951
9350
|
declare const SPRING_PRESETS: Record<SpringPresetName, SpringPreset>;
|
|
8952
9351
|
|
|
9352
|
+
/** Create the animator for a canvas. One rAF loop drives every animation it
|
|
9353
|
+
* owns, and everything still running is cancelled on unmount. */
|
|
8953
9354
|
declare function useAnimator(opts?: UseAnimatorOptions): Animator;
|
|
8954
9355
|
|
|
9356
|
+
/** Options for `tweenPose`. */
|
|
8955
9357
|
interface TweenPoseOptions<TPose> {
|
|
8956
9358
|
id: string;
|
|
8957
9359
|
to: TPose;
|
|
@@ -8967,6 +9369,7 @@ interface TweenPoseOptions<TPose> {
|
|
|
8967
9369
|
opLabel?: string;
|
|
8968
9370
|
onDone?: () => void;
|
|
8969
9371
|
}
|
|
9372
|
+
/** Options for `springPose`. */
|
|
8970
9373
|
interface SpringPoseOptions<TPose> {
|
|
8971
9374
|
id: string;
|
|
8972
9375
|
to: TPose;
|
|
@@ -8979,13 +9382,25 @@ interface SpringPoseOptions<TPose> {
|
|
|
8979
9382
|
opLabel?: string;
|
|
8980
9383
|
onDone?: () => void;
|
|
8981
9384
|
}
|
|
9385
|
+
/**
|
|
9386
|
+
* Animate one node's pose to `to` over `ms`, writing each frame through the
|
|
9387
|
+
* adapter.
|
|
9388
|
+
*
|
|
9389
|
+
* Unlike the color helpers this really does move the node. Undo therefore has
|
|
9390
|
+
* to be considered: by default a single transform op covering the whole
|
|
9391
|
+
* animation is recorded up front, so one undo returns the node to where it
|
|
9392
|
+
* started rather than replaying frames.
|
|
9393
|
+
*/
|
|
8982
9394
|
declare function tweenPose<TNode extends {
|
|
8983
9395
|
id: string;
|
|
8984
9396
|
}, TPose>(animator: Animator, adapter: SceneAdapter<TNode, TPose>, opts: TweenPoseOptions<TPose>): AnimationHandle;
|
|
9397
|
+
/** `tweenPose` driven by a spring instead of a duration. Same op-recording
|
|
9398
|
+
* behavior. */
|
|
8985
9399
|
declare function springPose<TNode extends {
|
|
8986
9400
|
id: string;
|
|
8987
9401
|
}, TPose>(animator: Animator, adapter: SceneAdapter<TNode, TPose>, opts: SpringPoseOptions<TPose>): AnimationHandle;
|
|
8988
9402
|
|
|
9403
|
+
/** Options for `animateOnSetPose`. */
|
|
8989
9404
|
interface AnimateOnSetPoseOptions<TPose> {
|
|
8990
9405
|
/** Default: 200ms tween with easeOut. */
|
|
8991
9406
|
ms?: number;
|
|
@@ -9013,10 +9428,24 @@ interface AnimateOnSetPoseOptions<TPose> {
|
|
|
9013
9428
|
/** Op label for the recorded transform op. Default: `'animate'`. */
|
|
9014
9429
|
opLabel?: string;
|
|
9015
9430
|
}
|
|
9431
|
+
/**
|
|
9432
|
+
* Wrap an adapter so every `setPose` animates to the new pose instead of
|
|
9433
|
+
* jumping to it. Anything that moves a node — a layout strategy, an action, a
|
|
9434
|
+
* consumer's own code — is animated without knowing it, since the adapter is
|
|
9435
|
+
* the single write path.
|
|
9436
|
+
*
|
|
9437
|
+
* Poses written from inside another animation's tick, and (optionally) poses
|
|
9438
|
+
* written for a node currently under a gesture, are passed straight through:
|
|
9439
|
+
* animating those would fight whatever is already driving the node.
|
|
9440
|
+
*/
|
|
9016
9441
|
declare function animateOnSetPose<TNode extends {
|
|
9017
9442
|
id: string;
|
|
9018
9443
|
}, TPose>(adapter: SceneAdapter<TNode, TPose>, animator: Animator, opts?: AnimateOnSetPoseOptions<TPose>): SceneAdapter<TNode, TPose>;
|
|
9019
9444
|
|
|
9445
|
+
/** How nodes enter and leave. `enterFrom` derives the pose a new node starts
|
|
9446
|
+
* at, given where it belongs; `exitTo` derives the pose a departing node
|
|
9447
|
+
* animates to before it is actually removed. Omit either to leave that
|
|
9448
|
+
* transition instant. */
|
|
9020
9449
|
interface LifecycleAnimation<TPose> {
|
|
9021
9450
|
/** Pose to animate the new object FROM at insert. */
|
|
9022
9451
|
enterFrom?: (final: TPose) => TPose;
|
|
@@ -9026,11 +9455,14 @@ interface LifecycleAnimation<TPose> {
|
|
|
9026
9455
|
easing?: EasingFn;
|
|
9027
9456
|
geometry?: PoseProjection<TPose>;
|
|
9028
9457
|
}
|
|
9458
|
+
/** Wrap an adapter so inserts and removals animate — the scene-graph
|
|
9459
|
+
* equivalent of CSS enter/leave transitions. */
|
|
9029
9460
|
declare function animateLifecycle<TNode extends {
|
|
9030
9461
|
id: string;
|
|
9031
9462
|
pose?: TPose;
|
|
9032
9463
|
}, TPose>(adapter: SceneAdapter<TNode, TPose>, animator: Animator, opts: LifecycleAnimation<TPose>): SceneAdapter<TNode, TPose>;
|
|
9033
9464
|
|
|
9465
|
+
/** Options for the `momentum` move behavior. */
|
|
9034
9466
|
interface MomentumOptions {
|
|
9035
9467
|
/** Required: the per-Canvas animator that will own the decay. */
|
|
9036
9468
|
animator: Animator;
|
|
@@ -9067,10 +9499,24 @@ interface MomentumOptions {
|
|
|
9067
9499
|
*/
|
|
9068
9500
|
boundary?: 'stop' | 'continue';
|
|
9069
9501
|
}
|
|
9502
|
+
/**
|
|
9503
|
+
* Move behavior that keeps a dragged node coasting after the pointer is
|
|
9504
|
+
* released, at the velocity it was travelling, until friction brings it below
|
|
9505
|
+
* `threshold`.
|
|
9506
|
+
*
|
|
9507
|
+
* Plugs into the move action rather than replacing it, so the drag itself is
|
|
9508
|
+
* unchanged — this only decides what happens after the release. The whole
|
|
9509
|
+
* flick, coast included, records as one undoable transform.
|
|
9510
|
+
*/
|
|
9070
9511
|
declare function momentum<TPose>(opts: MomentumOptions): MoveBehavior<TPose>;
|
|
9071
9512
|
|
|
9513
|
+
/** Convert an 8-bit sRGB triple to OKLab. */
|
|
9072
9514
|
declare function srgbU8ToOklab(r: number, g: number, b: number): [number, number, number];
|
|
9515
|
+
/** Convert OKLab back to an 8-bit sRGB triple, clamped into gamut. */
|
|
9073
9516
|
declare function oklabToSrgbU8(L: number, A: number, B: number): [number, number, number];
|
|
9517
|
+
/** Blend two 8-bit sRGB colors through OKLab. Perceptually even, and it does
|
|
9518
|
+
* not pass through the muddy midpoints an sRGB blend produces between
|
|
9519
|
+
* complementary hues. */
|
|
9074
9520
|
declare function lerpOklab(from: readonly [number, number, number], to: readonly [number, number, number], t: number): [number, number, number];
|
|
9075
9521
|
/** Convert OKLab (L, a, b) to OKLCh (L, C, h). h is in radians, range [-π, π]. */
|
|
9076
9522
|
declare function oklabToOklch(L: number, A: number, B: number): [number, number, number];
|
|
@@ -9081,6 +9527,9 @@ declare function oklchToOklab(L: number, C: number, h: number): [number, number,
|
|
|
9081
9527
|
* is taken from the other endpoint (avoids hue snap-from-undefined).
|
|
9082
9528
|
* h inputs are in radians. */
|
|
9083
9529
|
declare function lerpOklch(from: readonly [number, number, number], to: readonly [number, number, number], t: number): [number, number, number];
|
|
9530
|
+
/** Which space a color blend is computed in. `'rgb'` is cheapest; `'oklab'`
|
|
9531
|
+
* is perceptually even; `'oklch'` additionally travels around the hue wheel
|
|
9532
|
+
* rather than through it. */
|
|
9084
9533
|
type ColorSpace = 'rgb' | 'oklab' | 'oklch';
|
|
9085
9534
|
/** Lerp a flat RGBA color array `from` toward `to`. Inputs are 0..1
|
|
9086
9535
|
* floats (the renderer's color space); outputs are 0..1 floats too.
|
|
@@ -9100,6 +9549,7 @@ declare function lerpColorArray(from: readonly number[], to: readonly number[],
|
|
|
9100
9549
|
* when a custom color-space or shaping is needed.
|
|
9101
9550
|
*/
|
|
9102
9551
|
type ColorInterpolate = (from: readonly number[], to: readonly number[], t: number) => number[];
|
|
9552
|
+
/** Options for `tweenVertexColors`. */
|
|
9103
9553
|
interface TweenVertexColorsOptions {
|
|
9104
9554
|
id: string;
|
|
9105
9555
|
channel: VertexColorChannel;
|
|
@@ -9116,7 +9566,17 @@ interface TweenVertexColorsOptions {
|
|
|
9116
9566
|
interpolate?: ColorInterpolate;
|
|
9117
9567
|
onDone?: () => void;
|
|
9118
9568
|
}
|
|
9569
|
+
/**
|
|
9570
|
+
* Animate one node's per-anchor colors from `from` to `to` over `ms`.
|
|
9571
|
+
*
|
|
9572
|
+
* The colors are published to the animator's `colorOverrides` registry rather
|
|
9573
|
+
* than written into the scene, so nothing is recorded in history and the
|
|
9574
|
+
* node's own data is untouched; the override is dropped when the animation
|
|
9575
|
+
* finishes. Starting another color animation on the same node and channel
|
|
9576
|
+
* cancels this one.
|
|
9577
|
+
*/
|
|
9119
9578
|
declare function tweenVertexColors(animator: Animator, opts: TweenVertexColorsOptions): AnimationHandle;
|
|
9579
|
+
/** Options for `springVertexColors`. */
|
|
9120
9580
|
interface SpringVertexColorsOptions {
|
|
9121
9581
|
id: string;
|
|
9122
9582
|
channel: VertexColorChannel;
|
|
@@ -9132,7 +9592,10 @@ interface SpringVertexColorsOptions {
|
|
|
9132
9592
|
interpolate?: ColorInterpolate;
|
|
9133
9593
|
onDone?: () => void;
|
|
9134
9594
|
}
|
|
9595
|
+
/** `tweenVertexColors` driven by a spring instead of a duration. Same override
|
|
9596
|
+
* semantics. */
|
|
9135
9597
|
declare function springVertexColors(animator: Animator, opts: SpringVertexColorsOptions): AnimationHandle;
|
|
9598
|
+
/** Options for `cycleVertexColors`. */
|
|
9136
9599
|
interface CycleVertexColorsOptions {
|
|
9137
9600
|
id: string;
|
|
9138
9601
|
channel: VertexColorChannel;
|
|
@@ -9144,6 +9607,9 @@ interface CycleVertexColorsOptions {
|
|
|
9144
9607
|
* progress `t` in 0..1; returns the blended array in 0..1 floats. */
|
|
9145
9608
|
interpolate?: ColorInterpolate;
|
|
9146
9609
|
}
|
|
9610
|
+
/** Removes an installed color cycle. Unlike the other color helpers this is
|
|
9611
|
+
* not an `AnimationHandle`, because a cycle has no progress to pause or
|
|
9612
|
+
* scale — it only ends. */
|
|
9147
9613
|
interface CycleHandle {
|
|
9148
9614
|
cancel(): void;
|
|
9149
9615
|
}
|
|
@@ -9158,6 +9624,9 @@ interface CycleHandle {
|
|
|
9158
9624
|
* cycleVertexColors holds an `animator.keepAlive()` entry for the
|
|
9159
9625
|
* lifetime of the cycle; `cancel()` releases it. */
|
|
9160
9626
|
declare function cycleVertexColors(animator: Animator, opts: CycleVertexColorsOptions): CycleHandle;
|
|
9627
|
+
/** Options for `staggerVertexColors`. `origin` picks which anchor the wave
|
|
9628
|
+
* starts from and `perAnchorDelay` how far behind each successive anchor
|
|
9629
|
+
* runs. */
|
|
9161
9630
|
interface StaggerVertexColorsOptions {
|
|
9162
9631
|
id: string;
|
|
9163
9632
|
channel: VertexColorChannel;
|
|
@@ -9173,6 +9642,9 @@ interface StaggerVertexColorsOptions {
|
|
|
9173
9642
|
interpolate?: ColorInterpolate;
|
|
9174
9643
|
onDone?: () => void;
|
|
9175
9644
|
}
|
|
9645
|
+
/** Run the same color change across a node's anchors as a wave, each anchor
|
|
9646
|
+
* starting later than the one before it. Same override semantics as
|
|
9647
|
+
* `tweenVertexColors`. */
|
|
9176
9648
|
declare function staggerVertexColors(animator: Animator, opts: StaggerVertexColorsOptions): AnimationHandle;
|
|
9177
9649
|
/** Build an n-anchor rainbow RGBA array sweeping the hue wheel. The
|
|
9178
9650
|
* output is suitable to pass directly into `stroke.vertexColors`,
|
|
@@ -9188,8 +9660,14 @@ declare function rainbowVertexColors(n: number, opts?: {
|
|
|
9188
9660
|
* `to`-target typically needs. */
|
|
9189
9661
|
declare function solidVertexColors(n: number, r: number, g: number, b: number, a?: number): number[];
|
|
9190
9662
|
|
|
9663
|
+
/** Snap policy that never picks a target — every drop is rejected, which is
|
|
9664
|
+
* what a free-form container wants. */
|
|
9191
9665
|
declare function none<TPose>(): LayoutSnap<TPose>;
|
|
9666
|
+
/** Snap policy that always picks the target closest to the pointer, however
|
|
9667
|
+
* far away it is. */
|
|
9192
9668
|
declare function nearest<TPose>(): LayoutSnap<TPose>;
|
|
9669
|
+
/** Snap policy that picks the closest target, but only within `tolerance`
|
|
9670
|
+
* world units — beyond that the drop is rejected. */
|
|
9193
9671
|
declare function nearestWithin<TPose>(opts: {
|
|
9194
9672
|
tolerance: number;
|
|
9195
9673
|
}): LayoutSnap<TPose>;
|
|
@@ -9211,6 +9689,7 @@ declare function containedThenNearest<TPose>(): LayoutSnap<TPose>;
|
|
|
9211
9689
|
*/
|
|
9212
9690
|
declare function cellAt<TPose>(): LayoutSnap<TPose>;
|
|
9213
9691
|
|
|
9692
|
+
/** Options for `freeform`. */
|
|
9214
9693
|
interface FreeformOptions<TPose> {
|
|
9215
9694
|
snap?: LayoutSnap<TPose>;
|
|
9216
9695
|
}
|
|
@@ -9222,6 +9701,7 @@ interface FreeformOptions<TPose> {
|
|
|
9222
9701
|
*/
|
|
9223
9702
|
declare function freeform<TPose>(opts?: FreeformOptions<TPose>): LayoutStrategy<TPose>;
|
|
9224
9703
|
|
|
9704
|
+
/** Options for `tileGrid`. */
|
|
9225
9705
|
interface TileGridOptions<TPose> {
|
|
9226
9706
|
cols: number;
|
|
9227
9707
|
rows: number;
|
|
@@ -9241,9 +9721,14 @@ interface TileGridOptions<TPose> {
|
|
|
9241
9721
|
height: number;
|
|
9242
9722
|
}, dragged: TPose): TPose;
|
|
9243
9723
|
}
|
|
9724
|
+
/** Layout strategy that arranges children into a fixed grid of cells, one
|
|
9725
|
+
* child per cell. A drag reflows the others to make room, and the container
|
|
9726
|
+
* holds at most `cols × rows` children. */
|
|
9244
9727
|
declare function tileGrid<TPose>(opts: TileGridOptions<TPose>): LayoutStrategy<TPose>;
|
|
9245
9728
|
|
|
9729
|
+
/** Which points within a container a child can snap to. */
|
|
9246
9730
|
type SnapPattern = 'corners' | 'edges' | 'center' | 'grid';
|
|
9731
|
+
/** Options for `snapPoint`. */
|
|
9247
9732
|
interface SnapPointOptions<TPose> {
|
|
9248
9733
|
pattern: SnapPattern;
|
|
9249
9734
|
/** Spacing for the 'grid' pattern, in world units. Default 50. */
|
|
@@ -9252,10 +9737,14 @@ interface SnapPointOptions<TPose> {
|
|
|
9252
9737
|
tolerance?: number;
|
|
9253
9738
|
snap?: LayoutSnap<TPose>;
|
|
9254
9739
|
}
|
|
9740
|
+
/** A point in world coordinates. */
|
|
9255
9741
|
type Pt = {
|
|
9256
9742
|
x: number;
|
|
9257
9743
|
y: number;
|
|
9258
9744
|
};
|
|
9745
|
+
/** Layout strategy that leaves children where they are but offers a fixed set
|
|
9746
|
+
* of points — corners, edge midpoints, center, or a grid — for a dragged
|
|
9747
|
+
* child to land on. */
|
|
9259
9748
|
declare function snapPoint<TPose extends Pt>(opts: SnapPointOptions<TPose>): LayoutStrategy<TPose>;
|
|
9260
9749
|
|
|
9261
9750
|
/**
|
|
@@ -9372,11 +9861,17 @@ declare function HandIcon({ className, size }: IconProps): react_jsx_runtime.JSX
|
|
|
9372
9861
|
* inside — readable, debuggable, not hidden. */
|
|
9373
9862
|
declare function UnknownIcon({ className, size }: IconProps): react_jsx_runtime.JSX.Element;
|
|
9374
9863
|
|
|
9864
|
+
/** Icon for the union operation: two overlapping circles merged into one filled shape. */
|
|
9375
9865
|
declare function UnionIcon(): react_jsx_runtime.JSX.Element;
|
|
9866
|
+
/** Icon for the intersect operation: only the overlap of two circles filled. */
|
|
9376
9867
|
declare function IntersectIcon(): react_jsx_runtime.JSX.Element;
|
|
9868
|
+
/** Icon for the subtract operation: the front circle removed from the back one. */
|
|
9377
9869
|
declare function SubtractIcon(): react_jsx_runtime.JSX.Element;
|
|
9870
|
+
/** Icon for the exclude operation: both circles filled except their overlap. */
|
|
9378
9871
|
declare function ExcludeIcon(): react_jsx_runtime.JSX.Element;
|
|
9872
|
+
/** Icon for the divide operation: two circles split into their separate regions. */
|
|
9379
9873
|
declare function DivideIcon(): react_jsx_runtime.JSX.Element;
|
|
9874
|
+
/** Icon for the crop operation: the back shape clipped to the front one. */
|
|
9380
9875
|
declare function CropIcon(): react_jsx_runtime.JSX.Element;
|
|
9381
9876
|
|
|
9382
9877
|
/** What the registry knows at dispatch time. */
|
|
@@ -9416,6 +9911,7 @@ declare function scopeBindings(entries: Iterable<Contribution>, state: Eligibili
|
|
|
9416
9911
|
*/
|
|
9417
9912
|
declare function mergeContributions(...bundles: readonly Contribution[][]): Contribution[];
|
|
9418
9913
|
|
|
9914
|
+
/** Appearance of the dashed box drawn during a marquee or insert drag. */
|
|
9419
9915
|
interface InsertOverlayStyle {
|
|
9420
9916
|
fill?: string;
|
|
9421
9917
|
stroke?: string;
|
|
@@ -9423,4 +9919,4 @@ interface InsertOverlayStyle {
|
|
|
9423
9919
|
lineWidth?: number;
|
|
9424
9920
|
}
|
|
9425
9921
|
|
|
9426
|
-
export { ANCHOR_HIT_BASE_PX, Action, ActionsProp, ActionsProviderIfRoot, ActionsRegistry, Affordance, AffordanceBinding, AffordanceHit, AffordanceRegion, type AffordanceRegionHit, type AlignAdapter, type AlignAnchor, type AlignBounds, type AlignBoundsProjection, type AlignEdge, type AlignMatchResult, type AlignMoveArgs, type AlignmentBehaviorBase, type AnchorHit, type AnchorScratch, type AnchorState, type AnimateOnSetPoseOptions, type AnimateToBoundsOptions, type AnimationHandle, type Animator, AnyTool, AreaSelectAdapter, type ArrayAdapter, type ArrayAdapterConfig, BUNDLE_TOOLS, BindingScope, BooleansAdapter, Bounds, BoundsConstraint, type BuildChromeCtxArgs, type BuiltinShapeToolId, type BuiltinToolId, type BuiltinToolOptions, COARSE_TARGET_SCALE, CURVE_REPS, type CanvasExtensionApi, type CanvasFocusReturn, type CanvasHelpers, type CanvasProps, type CanvasSelectionMode, type CanvasSize, type CanvasSizeSnapshot, type CellHighlightLayerOpts, ChromeCtx, ChromeId, ChromeState, type ClampBounds, ClipboardSnapshot, type CoalescedCtx, type ColorInterpolate, type ColorOverride, type ColorOverrideFn, ColorOverrideRegistry, type ColorSpace, CommonAffordanceScratch, type ComposeSelectionPoseOpts, type ComputeFitViewOptions, Condition, ContentHandlerEntry, Contribution, type CornerResizeAffordanceOptions, type CornerResizeScratch, type CreateChildrenLayerOpts, type CreateParallaxLayerOpts, type CreatePathEditingOverlayLayerOptions, type CreatePathLayerOpts, type CreatePenPreviewLayerOptions, type CreateTextLayerOpts, type CreateViewportLayerOpts, CropIcon, CursorCoordsHud, type CursorCoordsHudProps, type CurveRepKind, type CurveRepresentation, type CustomLayerEntry, type CycleHandle, type CycleVertexColorsOptions, DEFAULT_ALPHA_DECAY, DEFAULT_ALPHA_MIN, DEFAULT_DEBUG_STROKES, DEFAULT_DEBUG_THEME, DEFAULT_DEVICE_PROFILE, DEFAULT_FILL_COLOR, DEFAULT_FLATTEN_TOLERANCE, DEFAULT_GUIDE_TOLERANCE_PX, DEFAULT_HANDLE_SIZE, DEFAULT_PALETTE, DEFAULT_ROTATION_HANDLE_DISTANCE, DEFAULT_STROKE_COLOR, DEFAULT_VELOCITY_DECAY, DebugConfig, DebugSink, DebugSnapshot, DebugStrokes, DebugTheme, type DecayLoopConfig, type DecayOptions, type DefaultTextData, DepRegistryProviderIfRoot, DepSchema, type DeriveAlignmentGuidesOptions, DetectedDeviceFacts, DeviceProfile, DeviceProfileProvider, type DeviceProfileProviderProps, Dims, type Discriminator, Dispatcher, type DistributeAdapter, type DistributeAxis, type DistributeMode, DivideIcon, type DragGestureController, type DragGestureCtx, type DragGestureEndCtx, type DragGesturePhase, type DragGesturePoint, type DragHandleOptions, 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, EASINGS, type EasingFn, type EasingName, Eligibility, type EligibilityState, EllipseIcon, ExcludeIcon, EyedropperIcon, FALLBACK_FIT_VIEW, type FillPoseBox, FillStyle, type FitTextPoseOptions, FitViewToBoundsOptions, type FlagKey, type FreeformOptions, GHOST_STROKE, type GateLayerOptions, GeometryProjection, type GestureSource, GradStop, GradientFill, GradientKind, type GridLayerOpts, type GridSlotConfig, Guide, type GuideSnapOptions, type GuidesLayerOpts, HANDLE_BASE_PX, HandIcon, type InertiaConfig as HandToolInertiaConfig, type HandleDragPoint, type HeadlessCanvasLike, HotkeyTrigger, type IconProps, type ImageNodeData, type ImageStatus, type IndicatorStyle, InsertAdapter, InsertBehavior, InsertExtras, type InsertNodeFactory, type InsertOp, type InsertOverlayStyle, type Interpolate, type InterpolatorFactory, IntersectIcon, KIT_SHAPE_KINDS, type LabelOptions, LassoHitMode, LassoIcon, LassoSelectAdapter, LassoSelectBehavior, LayerEnumerableAdapter, LayerHit, type LayerSlotValue, type LayersMap, type LayoutLine, type LayoutResult, LayoutSnap, LayoutStrategy, type LifecycleAnimation, LineIcon, type LinePoint, type LoopFactory, type LoopOptions, MIXED, MOVE_ANCHORS, type MarkdownFontOptions, type MeasureFn, type MeasureTextBoundsOpts, type MeasuredText, MinimapCanvas, type MinimapCanvasProps, type MinimapFit, type Mixed, ModifierState, type MomentumOptions, MoveAdapter, MoveBehavior, type NestedHitOpts, type NestedHitTester, type NodeClientRect, type NodeFill, NodeId, type NodeInk, type NodePaintCtx, type NodeProperties, type NodePropertiesEntry, type NodeRouting, type NodeRoutingEntry, type NodeShapeEntry, type OpenFilePickerOptions, OrderedAdapter, OriginProjection, OverlayPosition, PATH_ANCHOR_CHROME_ID, type PanBounds, type ParallaxOpts, Path, type PathAnchor, type PathAnchorAffordanceOptions, PathBuilder, PathDrawCommand, type PathEditingOverlayStyle, PathFillRule, type PathInWorldPose, type PenAnchor, PenIcon, type PenPreviewStyle, type PenScratch, type PenSubpath, PencilIcon, type PencilPoint, type PhysicsHandle, type PhysicsOptions, PickHud, type PickHudProps, type PickTopMostHitAdapter, type PinchZoomToolOpts, type PixelRenderPlan, type PointInPathOptions, type PointInTextPoseOpts, PointSnapBehavior, PointerProviderIfRoot, type PointerSample, type PointerStylusState, PolygonIcon, PolygonPath, type PolygonPoint, PoseProjection, type PoseRotation, type PositionedRun, type PressureToWidthOptions, type Pt, RECT_ALIGN_PROJECTION, ROTATION_HANDLE_BASE_PX, type RangeStyle, type RasterImage, type Rect, RectIcon, RectPath, RectPose, type RegisterNodeShapeOptions, RegisteredOp, RenderLayer, type RenderSceneToCanvasArgs, type RenderSceneToPixelsArgs, type ReorderDirection, ResizeAdapter, ResizeAnchor, ResizePose, ResolvedTextStyle, RotateAdapter, RotateBehavior, type RotateGeometry, RotatedPose, type RotationAffordanceOptions, type RotationHandle, type RotationScratch, Rule, RuleCtx, type RunStylePatch, SPRING_PRESETS, 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, ScopedBinding, type ScratchKey, type ScratchStore, type SelectAdapter, type SelectFromLassoOptions, SelectIcon, SelectionApi, SelectionContextProvider, SelectionContextProviderIfRoot, type SelectionContextValue, type SelectionHandlesLayerOpts, type SelectionOutlineLayerOpts, type SelectionOverlayLayerOpts, type SelectionOverlaySlotConfig, SerializedScene, type SetFlagResult, type SetPathFields, ShaderProgramHandle, type ShapeCoversPointOptions, type SharedAnchor, type Simulation, type SimulationForce, type SimulationNode, SliceDep, type SnapPattern, type SnapPointOptions, SnapStrategy, type SplitByLineOptions, type SpringOptions, type SpringPoseOptions, type SpringPreset, type SpringPresetName, type SpringVertexColorsOptions, type StaggerBuilder, type StaggerDelay, type StaggerFactory, type StaggerOptions, type StaggerPerItem, type StaggerSpringPoseOptions, type StaggerTweenOptions, type StaggerVertexColorsOptions, type StandardSlotConfig, type StandardSlotName, StarIcon, type StarPoint, type StartEditOptions, Stroke, type StyleKey, StyledRun, type StylusData, SubtractIcon, SvgIngestOptions, type TextEditScreenPose, type TextEditSelection, TextIcon, type TextLineBoxesOpts, type TextPose, type TextRenderer, TextStyle, TextVerticalAlign, TextureHandle, type ThresholdDragHandle, type ThresholdDragOptions, type TileGridOptions, type TilePatternOpts, TilePatternSpec, Tool, type ToolBundle, ToolCtx, ToolDef, ToolKeybinding, type ToolPref, type ToolPrefBoolean, type ToolPrefBooleanControl, type ToolPrefColor, type ToolPrefCustom, type ToolPrefEnum, type ToolPrefEnumControl, type ToolPrefGroup, type ToolPrefKind, type ToolPrefLeaf, type ToolPrefNumber, type ToolPrefNumberControl, type ToolPrefNumberUnit, type ToolPrefPaint, type ToolPrefString, type ToolPrefStringControl, type ToolsApi, type TweenLoopOptions, type TweenOptions, type TweenPoseOptions, type TweenVertexColorsOptions, UnionIcon, UnitSystem, UnitValue, UnknownIcon, type UseAlignOptions, type UseAlignReturn, type UseAnimatorOptions, type UseArrayAdapterOptions, type UseBooleansOptions, type UseBooleansReturn, type UseCanvasFocusOptions, type UseDistributeOptions, type UseDistributeReturn, type UseDragGestureOptions, type UseDragRadialOptions, type UseDragRectOptions, type UseEyedropperToolOptions, type UseGestureDispatcherOptions, type UseGridCellHoverOptions, type UseGridCellHoverReturn, type UseGuidesReturn, type UseHandToolOptions, type UseHandleDragOptions, type UseHandleDragReturn, type UseHoverTrackingArgs, type UseImageToolOptions, type UseKeybindingsOptions, type UseLassoSelectOptions, type UseLassoToolOptions, UseMoveOptions, type UsePenToolOptions, type UsePointerStylusOptions, type UsePolygonToolOptions, UseResizeOptions, type UseResizePolicyOptions, type UseRotateOptions, type UseRotateToolOptions, UseSceneOptions, type UseSceneTextEditOptions, type UseSceneTextEditReturn, type UseSceneTrivialOptions, type UseSelectToolOptions, UseSelectionOptions, type UseSimulationOptions, type UseStandardActionsOptions, type UseStarToolOptions, type UseTextEditOptions, type UseTextEditReturn, type UseToolsOptions, type UseZoomOptions, type UseZoomReturn, VERSION, type Vec2, type VertexColorChannel, View, ViewTransform, type ViewportConfig, ViewportDims, type ViewportLayer, ViewportToolDef, type ViewportZoomOptions, VisibilityRules, WeaselProvider, type WheelInput, type WheelState, ZoomBound, type ZoomBounds, type ZoomClampOpts, ZoomFactor, aabbCenter, actionIs, alignDeltaFor, alignInsertBehavior, alignMoveBehavior, alignResizeBehavior, always, and, animateLifecycle, animateOnSetPose, annulusSemiAxes, applyHitExistingGate, applyOpsTo, applyStyleToRange, areaSelectAction, arrayAdapter, bezierCubic, bezierQuadratic, boundsOfPath, buildChromeCtx, buildSceneViewCommands, canBringForward, canHover, canSendBackward, capabilityAll, capabilityIn, capabilityIs, capabilityNot, caretIndexAt, cellAt, charOffsetToDomPosition, clampView, clearSelectionAction, clientToCanvas, cloneAction, coarsePointer, composeAffordanceLayer, composePath, composeSelectionPose, computeFitView, computeIndicatorCommand, computeWheelAction, cond, constrainTo45, containedThenNearest, countPathAnchors, createCellHighlightLayer, createChildrenLayer, createCornerResizeAffordance, createDebugOverlayLayer, createDebugSink, createDeleteOp, createGridLayer, createGuidesLayer, createHistory, createInsertOp, createMarkdownRenderer, createMoveToIndexOp, createNodeProperties, createNodeRouting, createParallaxLayer, createPathAnchorAffordances, createPathEditingOverlayLayer, createPathLayer, createPenPreviewLayer, createReorderOp, createReparentOp, createRotationAffordance, createScene, createSelectionHandlesLayer, createSelectionOutlineLayer, createSelectionOverlayLayer, createSetDataOp, createSetLayerOp, createSetPathOp, createSetSelectionOp, createSetTextOp, createTextLayer, createTilePattern, createTransformOp, createViewportLayer, cycleVertexColors, decomposePath, defaultCommitAdapter, defaultDrawOne, defaultLabelTextRenderer, defaultNodeProperties, defaultNodeRouting, defaultVisibilityRules, defineTool, defineViewportTool, deleteScratch, deriveAlignmentGuides, deriveParallaxView, dispatchApplyBatch, dlog, domPositionToCharOffset, domToRuns, dwarn, easeIn, easeInBack, easeInBounce, easeInCirc, easeInCubic, easeInElastic, easeInExpo, easeInOut, easeInOutBack, easeInOutBounce, easeInOutCirc, easeInOutCubic, easeInOutElastic, easeInOutExpo, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInOutSine, easeInQuad, easeInQuart, easeInQuint, easeInSine, easeOut, easeOutBack, easeOutBounce, easeOutCirc, easeOutCubic, easeOutElastic, easeOutExpo, easeOutQuad, easeOutQuart, easeOutQuint, easeOutSine, editAnchorsAction, ellipsePath, enumerateAnchors, fillInPoseFrame, fillToBoundsFrame, findNodeShape, findShapeInk, findShapeSilhouette, fitTextPose, fitToBounds, fitZoom, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, focused, forEachCoalesced, freeform, gateLayer, gesturing, getAlpha01, getImageBitmap, getNodeShapes, getScratch, getStylusData, gradientForBounds, gradientGeometry, guideSnapStrategy, hexToRgba, hitAffordanceRegions, hitAnchor, hitRotationHandle, hovering, hoveringSelected, imageStatus, inferredNodeProperties, inferredNodeRouting, insertAction, isDebugEnabled, isEditableTarget, isPatternSpec, lassoSelectAction, layoutMarkdown, lerpColorArray, lerpOklab, lerpOklch, linePath, linear, liveScope, makeViewportZoomAction, matchAlignment, matchesKeyBinding, meanScale, measureText, measureTextBounds, measuredWidth, mergeAlphaFromPrev, mergeContributions, modeIn, modeIs, modeNot, modifierHeld, momentum, moveAction, multiActive, nearest, nearestWithin, nestedHitTester, never, nodeHasFlag, none, normalizeHex, not, nurbs, oklabToOklch, oklabToSrgbU8, oklchToOklab, openFilePicker, or, parseColor, parseColorToRgba255, parseDebugFlags, pathContainsPoint, pathContainsPolygon, pathContainsRect, pathDistanceToPoint, pathDivide, pathExclude, pathFromD, pathInPoseFrame, pathInWorld, pathIntersect, pathIntersectsPolygon, pathIntersectsRect, pathOriginProjection, pathPoseDescriptor, pathSubtract, pathToAnchors, pathUnion, pickTopMostHit, pinchZoomAction, planPixelRender, pointInPath, pointInRotatedRect, pointInTextPose, polygonFromPoints, poseRotationOf, pressureToWidth, pxExtent, rainbowVertexColors, rebuildOp, rectCorners, rectPath, registerNodeShape, registerOpFactory, regularPolygonPath, renderLabel, renderSceneToCanvas, renderSceneToPixels, resizeAction, resolveColor, resolveDeviceProfile, resolveFillPattern, resolvePatternSpec, resolveVisibility, rgbaToHex, rotateAction, rotateAroundAABBCenter, rotatePathAround, rotatePoint, rotatedRectCorners, rotationDegreesUnit, rotationHandle, roundToCell, runsToDom, sampleGradientStops, scaleDelta, scalePathToBounds, sceneFromJSON, sceneNodeClientRect, sceneToAdapter, scopeBindings, scratchKey, selectFromLasso, selectionAtLeast, selectionEmpty, selectionIs, setFlagOverRange, setScratch, shapeCoversPoint, snap, snapPoint, solidVertexColors, spiro, splitPathByLine, splitSubpaths, springPose, springVertexColors, srgbU8ToOklab, staggerVertexColors, starPath, startThresholdDrag, styleAtRange, subscribeImageReady, textCommand, textLineBoxes, tileGrid, toHex8, transformPath, translatePath, translatePolygonInPlace, translatePoseViaDescriptor, tweenPose, tweenVertexColors, unionBounds, unionBoundsPath, useAlign, useAnimator, useArrayAdapter, useAutoCenter, useBooleans, useBooleansAdapter, useCanvasFocus, useCanvasSize, useDecayLoop, useDeviceProfile, useDistribute, useDragGesture, useDragHandle, useDragRadial, useDragRect, useDropZone, useEllipseTool, useEyedropperTool, useGestureDispatcher, useGridCellHover, useGuides, useHandTool, useHandleDrag, useHoverTracking, useImageTool, useKeybindings, useLassoTool, useLineTool, usePenTool, usePencilTool, usePinchGesture, usePinchZoomTool, usePointerStylus, usePolygonTool, usePublishSelection, useRectTool, useResizePolicy, useRotateTool, useScene, useSceneAdapter, useSceneTextEdit, useSelectTool, useSelectionContext, useSimulation, useSliceDep, useStandardActions, useStarTool, useTextEdit, useTextTool, useTools, useVelocityTracker, useViewAnimation, useViewTween, useZoom, viewportDragPanAction, viewportZoomAction, viewportsAt, when, withAlpha01, withCoord, withGradientKind, withinPxBox, withinPxRadius, worldEditToStorage, zoomAt, zoomAtLeast };
|
|
9922
|
+
export { ANCHOR_HIT_BASE_PX, Action, ActionsProp, ActionsProviderIfRoot, ActionsRegistry, Affordance, AffordanceBinding, AffordanceHit, AffordanceRegion, type AffordanceRegionHit, type AlignAdapter, type AlignAnchor, type AlignBounds, type AlignBoundsProjection, type AlignEdge, type AlignMatchResult, type AlignMoveArgs, type AlignmentBehaviorBase, type AnchorHit, type AnchorScratch, type AnchorState, type AnimateOnSetPoseOptions, type AnimateToBoundsOptions, type AnimationHandle, type Animator, AnyTool, AreaSelectAdapter, type ArrayAdapter, type ArrayAdapterConfig, BUNDLE_TOOLS, BindingScope, BooleansAdapter, Bounds, BoundsConstraint, type BuildChromeCtxArgs, type BuiltinShapeToolId, type BuiltinToolId, type BuiltinToolOptions, COARSE_TARGET_SCALE, CURVE_REPS, type CanvasExtensionApi, type CanvasFocusReturn, type CanvasHelpers, type CanvasProps, type CanvasSelectionMode, type CanvasSize, type CanvasSizeSnapshot, type CellHighlightLayerOpts, ChromeCtx, ChromeId, ChromeState, type ClampBounds, ClipboardSnapshot, type CoalescedCtx, type ColorInterpolate, type ColorOverride, type ColorOverrideFn, ColorOverrideRegistry, type ColorSpace, CommonAffordanceScratch, type ComposeSelectionPoseOpts, type ComputeFitViewOptions, Condition, ContentHandlerEntry, Contribution, type CornerResizeAffordanceOptions, type CornerResizeScratch, type CreateChildrenLayerOpts, type CreateParallaxLayerOpts, type CreatePathEditingOverlayLayerOptions, type CreatePathLayerOpts, type CreatePenPreviewLayerOptions, type CreateTextLayerOpts, type CreateViewportLayerOpts, CropIcon, CursorCoordsHud, type CursorCoordsHudProps, type CurveRepKind, type CurveRepresentation, type CustomLayerEntry, type CycleHandle, type CycleVertexColorsOptions, DEFAULT_ALPHA_DECAY, DEFAULT_ALPHA_MIN, DEFAULT_DEBUG_STROKES, DEFAULT_DEBUG_THEME, DEFAULT_DEVICE_PROFILE, DEFAULT_FILL_COLOR, DEFAULT_FLATTEN_TOLERANCE, DEFAULT_GUIDE_TOLERANCE_PX, DEFAULT_HANDLE_SIZE, DEFAULT_PALETTE, DEFAULT_ROTATION_HANDLE_DISTANCE, DEFAULT_STROKE_COLOR, DEFAULT_VELOCITY_DECAY, DebugConfig, DebugSink, DebugSnapshot, DebugStrokes, DebugTheme, type DecayLoopConfig, type DecayOptions, type DefaultTextData, DepRegistryProviderIfRoot, DepSchema, type DeriveAlignmentGuidesOptions, DetectedDeviceFacts, DeviceProfile, DeviceProfileProvider, type DeviceProfileProviderProps, Dims, type Discriminator, Dispatcher, type DistributeAdapter, type DistributeAxis, type DistributeMode, DivideIcon, type DragGestureController, type DragGestureCtx, type DragGestureEndCtx, type DragGesturePhase, type DragGesturePoint, type DragHandleOptions, 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, EASINGS, type EasingFn, type EasingName, Eligibility, type EligibilityState, EllipseIcon, ExcludeIcon, EyedropperIcon, FALLBACK_FIT_VIEW, type FillPoseBox, FillStyle, type FitTextPoseOptions, FitViewToBoundsOptions, type FlagKey, type FreeformOptions, GHOST_STROKE, type GateLayerOptions, GeometryProjection, type GestureSource, GradStop, GradientFill, GradientKind, type GridLayerOpts, type GridSlotConfig, Guide, type GuideSnapOptions, type GuidesLayerOpts, HANDLE_BASE_PX, HandIcon, type InertiaConfig as HandToolInertiaConfig, type HandleDragPoint, type HeadlessCanvasLike, HotkeyTrigger, type IconProps, type ImageNodeData, type ImageStatus, type IndicatorStyle, InsertAdapter, InsertBehavior, InsertExtras, type InsertNodeFactory, type InsertOp, type InsertOverlayStyle, type Interpolate, type InterpolatorFactory, IntersectIcon, KIT_SHAPE_KINDS, type LabelOptions, LassoHitMode, LassoIcon, LassoSelectAdapter, LassoSelectBehavior, LayerEnumerableAdapter, LayerHit, type LayerSlotValue, type LayersMap, type LayoutLine, type LayoutResult, LayoutSnap, LayoutStrategy, type LifecycleAnimation, LineIcon, type LinePoint, type LoopFactory, type LoopOptions, MIXED, MOVE_ANCHORS, type MarkdownFontOptions, type MeasureFn, type MeasureTextBoundsOpts, type MeasuredText, MinimapCanvas, type MinimapCanvasProps, type MinimapFit, type Mixed, ModifierState, type MomentumOptions, MoveAdapter, MoveBehavior, type NestedHitOpts, type NestedHitTester, type NodeClientRect, type NodeFill, NodeId, type NodeInk, type NodePaintCtx, type NodeProperties, type NodePropertiesEntry, type NodeRouting, type NodeRoutingEntry, type NodeShapeEntry, type OpenFilePickerOptions, OrderedAdapter, OriginProjection, OverlayPosition, PATH_ANCHOR_CHROME_ID, type PanBounds, type ParallaxOpts, Path, type PathAnchor, type PathAnchorAffordanceOptions, PathBuilder, PathDrawCommand, type PathEditingOverlayStyle, PathFillRule, type PathInWorldPose, type PenAnchor, PenIcon, type PenPreviewStyle, type PenScratch, type PenSubpath, PencilIcon, type PencilPoint, type PhysicsHandle, type PhysicsOptions, PickHud, type PickHudProps, type PickTopMostHitAdapter, type PinchZoomToolOpts, type PixelRenderPlan, type PointInPathOptions, type PointInTextPoseOpts, PointSnapBehavior, PointerProviderIfRoot, type PointerSample, type PointerStylusState, PolygonIcon, PolygonPath, type PolygonPoint, PoseProjection, type PoseRotation, type PositionedRun, type PressureToWidthOptions, type Pt, RECT_ALIGN_PROJECTION, ROTATION_HANDLE_BASE_PX, type RangeStyle, type RasterImage, type Rect, RectIcon, RectPath, RectPose, type RegisterNodeShapeOptions, RegisteredOp, RenderLayer, type RenderSceneToCanvasArgs, type RenderSceneToPixelsArgs, type ReorderDirection, ResizeAdapter, ResizeAnchor, ResizePose, ResolvedTextStyle, RotateAdapter, RotateBehavior, type RotateGeometry, RotatedPose, type RotationAffordanceOptions, type RotationHandle, type RotationScratch, Rule, RuleCtx, type RunStylePatch, SPRING_PRESETS, 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, ScopedBinding, type ScratchKey, type ScratchStore, type SelectAdapter, type SelectFromLassoOptions, SelectIcon, SelectionApi, SelectionContextProvider, SelectionContextProviderIfRoot, type SelectionContextValue, type SelectionHandlesLayerOpts, type SelectionOutlineLayerOpts, type SelectionOverlayLayerOpts, type SelectionOverlaySlotConfig, SerializedScene, type SetFlagResult, type SetPathFields, ShaderProgramHandle, type ShapeCoversPointOptions, type SharedAnchor, type Simulation, type SimulationForce, type SimulationNode, SliceDep, type SnapPattern, type SnapPointOptions, SnapStrategy, type SplitByLineOptions, type SpringOptions, type SpringPoseOptions, type SpringPreset, type SpringPresetName, type SpringVertexColorsOptions, type StaggerBuilder, type StaggerDelay, type StaggerFactory, type StaggerOptions, type StaggerPerItem, type StaggerSpringPoseOptions, type StaggerTweenOptions, type StaggerVertexColorsOptions, type StandardSlotConfig, type StandardSlotName, StarIcon, type StarPoint, type StartEditOptions, Stroke, type StyleKey, StyledRun, type StylusData, SubtractIcon, SvgIngestOptions, type TextEditScreenPose, type TextEditSelection, TextIcon, type TextLineBoxesOpts, type TextPose, type TextRenderer, TextStyle, TextVerticalAlign, TextureHandle, type ThresholdDragHandle, type ThresholdDragOptions, type TileGridOptions, type TilePatternOpts, TilePatternSpec, Tool, type ToolBundle, ToolDef, ToolKeybinding, type ToolPref, type ToolPrefBoolean, type ToolPrefBooleanControl, type ToolPrefColor, type ToolPrefCustom, type ToolPrefEnum, type ToolPrefEnumControl, type ToolPrefGroup, type ToolPrefKind, type ToolPrefLeaf, type ToolPrefNumber, type ToolPrefNumberControl, type ToolPrefNumberUnit, type ToolPrefPaint, type ToolPrefString, type ToolPrefStringControl, type ToolsApi, type TweenLoopOptions, type TweenOptions, type TweenPoseOptions, type TweenVertexColorsOptions, UnionIcon, UnitSystem, UnitValue, UnknownIcon, type UseAlignOptions, type UseAlignReturn, type UseAnimatorOptions, type UseArrayAdapterOptions, type UseBooleansOptions, type UseBooleansReturn, type UseCanvasFocusOptions, type UseDistributeOptions, type UseDistributeReturn, type UseDragGestureOptions, type UseDragRadialOptions, type UseDragRectOptions, type UseEyedropperToolOptions, type UseGestureDispatcherOptions, type UseGridCellHoverOptions, type UseGridCellHoverReturn, type UseGuidesReturn, type UseHandToolOptions, type UseHandleDragOptions, type UseHandleDragReturn, type UseHoverTrackingArgs, type UseImageToolOptions, type UseKeybindingsOptions, type UseLassoSelectOptions, type UseLassoToolOptions, UseMoveOptions, type UsePenToolOptions, type UsePointerStylusOptions, type UsePolygonToolOptions, UseResizeOptions, type UseResizePolicyOptions, type UseRotateOptions, type UseRotateToolOptions, UseSceneOptions, type UseSceneTextEditOptions, type UseSceneTextEditReturn, type UseSceneTrivialOptions, type UseSelectToolOptions, UseSelectionOptions, type UseSimulationOptions, type UseStandardActionsOptions, type UseStarToolOptions, type UseTextEditOptions, type UseTextEditReturn, type UseToolsOptions, type UseZoomOptions, type UseZoomReturn, VERSION, type Vec2, type VertexColorChannel, View, ViewTransform, type ViewportConfig, ViewportDims, type ViewportLayer, ViewportToolDef, type ViewportZoomOptions, VisibilityRules, WeaselProvider, type WheelInput, type WheelState, ZoomBound, type ZoomBounds, type ZoomClampOpts, ZoomFactor, aabbCenter, actionIs, alignDeltaFor, alignInsertBehavior, alignMoveBehavior, alignResizeBehavior, always, and, animateLifecycle, animateOnSetPose, annulusSemiAxes, applyOpsTo, applyStyleToRange, areaSelectAction, arrayAdapter, bezierCubic, bezierQuadratic, boundsOfPath, buildChromeCtx, buildSceneViewCommands, canBringForward, canHover, canSendBackward, capabilityAll, capabilityIn, capabilityIs, capabilityNot, caretIndexAt, cellAt, charOffsetToDomPosition, clampView, clearSelectionAction, clientToCanvas, cloneAction, coarsePointer, composeAffordanceLayer, composePath, composeSelectionPose, computeFitView, computeIndicatorCommand, computeWheelAction, cond, constrainTo45, containedThenNearest, countPathAnchors, createCellHighlightLayer, createChildrenLayer, createCornerResizeAffordance, createDebugOverlayLayer, createDebugSink, createDeleteOp, createGridLayer, createGuidesLayer, createHistory, createInsertOp, createMarkdownRenderer, createMoveToIndexOp, createNodeProperties, createNodeRouting, createParallaxLayer, createPathAnchorAffordances, createPathEditingOverlayLayer, createPathLayer, createPenPreviewLayer, createReorderOp, createReparentOp, createRotationAffordance, createScene, createSelectionHandlesLayer, createSelectionOutlineLayer, createSelectionOverlayLayer, createSetDataOp, createSetLayerOp, createSetPathOp, createSetSelectionOp, createSetTextOp, createTextLayer, createTilePattern, createTransformOp, createViewportLayer, cycleVertexColors, decomposePath, defaultCommitAdapter, defaultDrawOne, defaultLabelTextRenderer, defaultNodeProperties, defaultNodeRouting, defaultVisibilityRules, defineTool, defineViewportTool, deleteScratch, deriveAlignmentGuides, deriveParallaxView, dispatchApplyBatch, dlog, domPositionToCharOffset, domToRuns, dwarn, easeIn, easeInBack, easeInBounce, easeInCirc, easeInCubic, easeInElastic, easeInExpo, easeInOut, easeInOutBack, easeInOutBounce, easeInOutCirc, easeInOutCubic, easeInOutElastic, easeInOutExpo, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInOutSine, easeInQuad, easeInQuart, easeInQuint, easeInSine, easeOut, easeOutBack, easeOutBounce, easeOutCirc, easeOutCubic, easeOutElastic, easeOutExpo, easeOutQuad, easeOutQuart, easeOutQuint, easeOutSine, editAnchorsAction, ellipsePath, enumerateAnchors, fillInPoseFrame, fillToBoundsFrame, findNodeShape, findShapeInk, findShapeSilhouette, fitTextPose, fitToBounds, fitZoom, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, focused, forEachCoalesced, freeform, gateLayer, gesturing, getAlpha01, getImageBitmap, getNodeShapes, getScratch, getStylusData, gradientForBounds, gradientGeometry, guideSnapStrategy, hexToRgba, hitAffordanceRegions, hitAnchor, hitRotationHandle, hovering, hoveringSelected, imageStatus, inferredNodeProperties, inferredNodeRouting, insertAction, isDebugEnabled, isEditableTarget, isPatternSpec, lassoSelectAction, layoutMarkdown, lerpColorArray, lerpOklab, lerpOklch, linePath, linear, liveScope, makeViewportZoomAction, matchAlignment, matchesKeyBinding, meanScale, measureText, measureTextBounds, measuredWidth, mergeAlphaFromPrev, mergeContributions, modeIn, modeIs, modeNot, modifierHeld, momentum, moveAction, multiActive, nearest, nearestWithin, nestedHitTester, never, nodeHasFlag, none, normalizeHex, not, nurbs, oklabToOklch, oklabToSrgbU8, oklchToOklab, openFilePicker, or, parseColor, parseColorToRgba255, parseDebugFlags, pathContainsPoint, pathContainsPolygon, pathContainsRect, pathDistanceToPoint, pathDivide, pathExclude, pathFromD, pathInPoseFrame, pathInWorld, pathIntersect, pathIntersectsPolygon, pathIntersectsRect, pathOriginProjection, pathPoseDescriptor, pathSubtract, pathToAnchors, pathUnion, pickTopMostHit, pinchZoomAction, planPixelRender, pointInPath, pointInRotatedRect, pointInTextPose, polygonFromPoints, poseRotationOf, pressureToWidth, pxExtent, rainbowVertexColors, rebuildOp, rectCorners, rectPath, registerNodeShape, registerOpFactory, regularPolygonPath, renderLabel, renderSceneToCanvas, renderSceneToPixels, resizeAction, resolveColor, resolveDeviceProfile, resolveFillPattern, resolvePatternSpec, resolveVisibility, rgbaToHex, rotateAction, rotateAroundAABBCenter, rotatePathAround, rotatePoint, rotatedRectCorners, rotationDegreesUnit, rotationHandle, roundToCell, runsToDom, sampleGradientStops, scaleDelta, scalePathToBounds, sceneFromJSON, sceneNodeClientRect, sceneToAdapter, scopeBindings, scratchKey, selectFromLasso, selectionAtLeast, selectionEmpty, selectionIs, setFlagOverRange, setScratch, shapeCoversPoint, snap, snapPoint, solidVertexColors, spiro, splitPathByLine, splitSubpaths, springPose, springVertexColors, srgbU8ToOklab, staggerVertexColors, starPath, startThresholdDrag, styleAtRange, subscribeImageReady, textCommand, textLineBoxes, tileGrid, toHex8, transformPath, translatePath, translatePolygonInPlace, translatePoseViaDescriptor, tweenPose, tweenVertexColors, unionBounds, unionBoundsPath, useAlign, useAnimator, useArrayAdapter, useAutoCenter, useBooleans, useBooleansAdapter, useCanvasFocus, useCanvasSize, useDecayLoop, useDeviceProfile, useDistribute, useDragGesture, useDragHandle, useDragRadial, useDragRect, useDropZone, useEllipseTool, useEyedropperTool, useGestureDispatcher, useGridCellHover, useGuides, useHandTool, useHandleDrag, useHoverTracking, useImageTool, useKeybindings, useLassoTool, useLineTool, usePenTool, usePencilTool, usePinchGesture, usePinchZoomTool, usePointerStylus, usePolygonTool, usePublishSelection, useRectTool, useResizePolicy, useRotateTool, useScene, useSceneAdapter, useSceneTextEdit, useSelectTool, useSelectionContext, useSimulation, useSliceDep, useStandardActions, useStarTool, useTextEdit, useTextTool, useTools, useVelocityTracker, useViewAnimation, useViewTween, useZoom, viewportDragPanAction, viewportZoomAction, viewportsAt, when, withAlpha01, withCoord, withGradientKind, withinPxBox, withinPxRadius, worldEditToStorage, zoomAt, zoomAtLeast };
|