@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
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { N as NodeId, R as RectPose, S as Scene } from './types-
|
|
2
|
-
import { M as ModifierState, A as ActionBehavior, c as ResizeAnchor, R as ResizePose, B as BoundsConstraint, P as PointSnapBehavior } from './types-
|
|
1
|
+
import { N as NodeId, R as RectPose, S as Scene } from './types-vqxpCFVp.js';
|
|
2
|
+
import { M as ModifierState, A as ActionBehavior, c as ResizeAnchor, R as ResizePose, B as BoundsConstraint, P as PointSnapBehavior } from './types-ByZxoD6P.js';
|
|
3
3
|
import { V as View } from './view-DSQgxBJB.js';
|
|
4
4
|
import { CapabilityTag } from '@weasel-js/modes';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { MutableRefObject, ReactNode, ReactElement } from 'react';
|
|
7
7
|
import { GestureSpec, IngestItem, InputEvent } from '@weasel-js/gestures';
|
|
8
|
-
import { B as Bounds, P as PoseProjection } from './geometry-
|
|
8
|
+
import { B as Bounds, P as PoseProjection } from './geometry-5X6TrAkX.js';
|
|
9
9
|
import { F as FillStyle, S as Stroke } from './paint-types-CnLIzqq1.js';
|
|
10
|
-
import { D as DrawCommand } from './DrawCommand-
|
|
10
|
+
import { D as DrawCommand } from './DrawCommand-BbPrSTra.js';
|
|
11
11
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
12
12
|
import { P as Path } from './path-B6MMiodD.js';
|
|
13
13
|
import { Op, History } from '@weasel-js/history';
|
|
14
|
-
import { L as LayoutStrategy, I as InsertAdapter } from './types-
|
|
15
|
-
import { D as DebugSink } from './types-
|
|
14
|
+
import { L as LayoutStrategy, I as InsertAdapter } from './types-DpQ0cWYC.js';
|
|
15
|
+
import { D as DebugSink } from './types-BHK2dkMu.js';
|
|
16
16
|
import { Mat3 } from '@weasel-js/geom';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -455,6 +455,8 @@ interface RuleCtx {
|
|
|
455
455
|
* an absent profile is behavior-preserving by construction. */
|
|
456
456
|
readonly device?: DeviceProfile;
|
|
457
457
|
}
|
|
458
|
+
/** The live state a `RuleCtx` is assembled from — the chrome context plus
|
|
459
|
+
* what the active mode allows. */
|
|
458
460
|
interface BuildRuleCtxArgs {
|
|
459
461
|
focused: boolean;
|
|
460
462
|
selection: readonly NodeId[];
|
|
@@ -475,6 +477,8 @@ interface BuildRuleCtxArgs {
|
|
|
475
477
|
/** Optional — omitted means {@link DEFAULT_DEVICE_PROFILE}. */
|
|
476
478
|
device?: DeviceProfile;
|
|
477
479
|
}
|
|
480
|
+
/** Gather the current canvas and mode state into the context that action
|
|
481
|
+
* eligibility and chrome-visibility rules are evaluated against. */
|
|
478
482
|
declare function buildRuleCtx(args: BuildRuleCtxArgs): RuleCtx;
|
|
479
483
|
|
|
480
484
|
/**
|
|
@@ -535,6 +539,7 @@ type Rule = Selector | {
|
|
|
535
539
|
};
|
|
536
540
|
/** Constant rules. Kept here so they have a single source. */
|
|
537
541
|
declare const ALWAYS: Rule;
|
|
542
|
+
/** A rule that never passes. `any` of nothing is false. */
|
|
538
543
|
declare const NEVER: Rule;
|
|
539
544
|
/**
|
|
540
545
|
* Render a {@link Rule} as a short human-readable string, for inspectors and
|
|
@@ -551,6 +556,8 @@ declare const NEVER: Rule;
|
|
|
551
556
|
* on a cyclic value and renders the `when` arm as a useless `{}`.
|
|
552
557
|
*/
|
|
553
558
|
declare function describeRule(rule: Rule): string;
|
|
559
|
+
/** Evaluate a rule against a context. Pure, and cheap enough to run per
|
|
560
|
+
* frame for every piece of chrome. */
|
|
554
561
|
declare function evaluate(rule: Rule, ctx: RuleCtx): boolean;
|
|
555
562
|
|
|
556
563
|
/**
|
|
@@ -1008,6 +1015,9 @@ type Invoker = ImmediateInvoker | OngoingInvoker;
|
|
|
1008
1015
|
* See `docs/superpowers/specs/2026-05-16-registry-unification-design.md`.
|
|
1009
1016
|
*/
|
|
1010
1017
|
|
|
1018
|
+
/** An interaction: a gesture spec composed with the id of the action it
|
|
1019
|
+
* invokes. Tools declare arrays of these; the dispatcher matches an incoming
|
|
1020
|
+
* input event against them and runs the winner's action. */
|
|
1011
1021
|
interface GestureBinding {
|
|
1012
1022
|
spec: GestureSpec;
|
|
1013
1023
|
actionId: string;
|
|
@@ -1169,6 +1179,15 @@ type BooleanOpResult = {
|
|
|
1169
1179
|
kind: 'noop';
|
|
1170
1180
|
reason: 'no-paths' | 'too-few-for-subtract' | 'empty-result';
|
|
1171
1181
|
};
|
|
1182
|
+
/**
|
|
1183
|
+
* Run one Boolean operation over the selected paths and commit the result as a
|
|
1184
|
+
* single undoable batch.
|
|
1185
|
+
*
|
|
1186
|
+
* Operands are ordered back-to-front, which is what makes `subtract` mean
|
|
1187
|
+
* "everything in front removed from the backmost shape". Returns without
|
|
1188
|
+
* mutating anything when the selection holds no paths, or too few for the
|
|
1189
|
+
* requested operation.
|
|
1190
|
+
*/
|
|
1172
1191
|
declare function applyBooleanOp(adapter: BooleansAdapter, op: BooleanOp): BooleanOpResult;
|
|
1173
1192
|
|
|
1174
1193
|
/**
|
|
@@ -1291,6 +1310,9 @@ interface IngestCtx {
|
|
|
1291
1310
|
/** Full action-deps bag, for consumer handlers that need more. */
|
|
1292
1311
|
deps: ActionDeps;
|
|
1293
1312
|
}
|
|
1313
|
+
/** A handler for content arriving by paste, drop or file picker. Handlers are
|
|
1314
|
+
* matched by MIME glob or predicate and run highest-priority first; the kit's
|
|
1315
|
+
* own register at a low priority so a consumer's handler wins by default. */
|
|
1294
1316
|
interface ContentHandlerEntry {
|
|
1295
1317
|
/** Stable identifier — used for unregistration and debugging
|
|
1296
1318
|
* (`'kit:image'`, `'app:csv'`). */
|
|
@@ -1357,6 +1379,9 @@ declare function PointerContextProvider({ children }: {
|
|
|
1357
1379
|
* no provider is in scope. */
|
|
1358
1380
|
declare function usePointerContext(): PointerContextValue | null;
|
|
1359
1381
|
|
|
1382
|
+
/** Which tool is active, plus the stack of tools temporarily held active by a
|
|
1383
|
+
* hotkey (space-for-hand and the like). The dispatcher reads this to decide
|
|
1384
|
+
* whose bindings are in scope. */
|
|
1360
1385
|
interface ActiveToolContextValue {
|
|
1361
1386
|
active: string;
|
|
1362
1387
|
hotkeyStack: string[];
|
|
@@ -1364,11 +1389,15 @@ interface ActiveToolContextValue {
|
|
|
1364
1389
|
pushHotkey(id: string): void;
|
|
1365
1390
|
popHotkey(): void;
|
|
1366
1391
|
}
|
|
1392
|
+
/** Props for `<ActiveToolContextProvider>`. */
|
|
1367
1393
|
interface ActiveToolContextProviderProps {
|
|
1368
1394
|
children: ReactNode;
|
|
1369
1395
|
initialActive?: string;
|
|
1370
1396
|
}
|
|
1397
|
+
/** Provides active-tool state for a canvas. `<SceneCanvas>` mounts one. */
|
|
1371
1398
|
declare function ActiveToolContextProvider({ children, initialActive, }: ActiveToolContextProviderProps): react_jsx_runtime.JSX.Element;
|
|
1399
|
+
/** The active-tool state in scope. Throws outside a provider; use
|
|
1400
|
+
* `useActiveToolContextOptional` where one is not guaranteed. */
|
|
1372
1401
|
declare function useActiveToolContext(): ActiveToolContextValue;
|
|
1373
1402
|
/**
|
|
1374
1403
|
* Like `useActiveToolContext`, but returns `null` when no
|
|
@@ -1600,6 +1629,8 @@ type NodeAtPointDep = (point: {
|
|
|
1600
1629
|
x: number;
|
|
1601
1630
|
y: number;
|
|
1602
1631
|
}, exclude?: Iterable<NodeId>) => NodeId | null;
|
|
1632
|
+
/** What an area-selecting action needs: a way to ask what a region covers,
|
|
1633
|
+
* and a way to read and replace the selection. */
|
|
1603
1634
|
interface AreaSelectDep {
|
|
1604
1635
|
/** Return ids of all scene nodes whose AABB overlaps `bounds`. */
|
|
1605
1636
|
hitTestArea(bounds: {
|
|
@@ -1938,6 +1969,14 @@ interface ResizePolicy<TPose> {
|
|
|
1938
1969
|
interface LayoutDep {
|
|
1939
1970
|
getLayout(containerId: string): LayoutStrategy<unknown> | null;
|
|
1940
1971
|
}
|
|
1972
|
+
/**
|
|
1973
|
+
* The names an action may declare in `requires`, and what each resolves to.
|
|
1974
|
+
*
|
|
1975
|
+
* This is the whole vocabulary of things an action can reach — selection,
|
|
1976
|
+
* scene, view, history, and the rest. Consumers add their own entries by
|
|
1977
|
+
* augmenting the interface (`declare module '@weasel-js/core'`), which is what
|
|
1978
|
+
* makes a custom dep name type-check in `requires` and in the deps bag.
|
|
1979
|
+
*/
|
|
1941
1980
|
interface DepSchema {
|
|
1942
1981
|
/** Kit selection state — ids of currently selected nodes. */
|
|
1943
1982
|
selection: SelectionApi;
|
|
@@ -2124,13 +2163,19 @@ interface DepSchema {
|
|
|
2124
2163
|
*/
|
|
2125
2164
|
type DepName = keyof DepSchema;
|
|
2126
2165
|
|
|
2166
|
+
/** Holds the live sources an action's declared dependencies resolve to.
|
|
2167
|
+
* Sources are thunks, read at invocation time, so an action never captures
|
|
2168
|
+
* stale state. */
|
|
2127
2169
|
interface DepRegistry {
|
|
2128
2170
|
register<K extends DepName>(name: K, source: () => DepSchema[K]): () => void;
|
|
2129
2171
|
get<K extends DepName>(name: K): DepSchema[K] | undefined;
|
|
2130
2172
|
}
|
|
2173
|
+
/** Provides the dep registry for a canvas. `<SceneCanvas>` mounts one; a
|
|
2174
|
+
* consumer registering its own dep sources must be inside it. */
|
|
2131
2175
|
declare function DepRegistryProvider({ children }: {
|
|
2132
2176
|
children: ReactNode;
|
|
2133
2177
|
}): react_jsx_runtime.JSX.Element;
|
|
2178
|
+
/** The dep registry in scope. Throws outside a `<DepRegistryProvider>`. */
|
|
2134
2179
|
declare function useDepRegistry(): DepRegistry;
|
|
2135
2180
|
/**
|
|
2136
2181
|
* Like `useDepRegistry`, but returns `null` when no `<DepRegistryProvider>` is
|
|
@@ -2207,6 +2252,15 @@ interface ToolKeybinding {
|
|
|
2207
2252
|
*/
|
|
2208
2253
|
shift?: boolean | 'optional';
|
|
2209
2254
|
}
|
|
2255
|
+
/**
|
|
2256
|
+
* What a tool declares.
|
|
2257
|
+
*
|
|
2258
|
+
* A tool is a declarative shell, not an event handler: it names the gestures
|
|
2259
|
+
* it responds to and, for each, the action to invoke. The dispatcher owns the
|
|
2260
|
+
* gesture, and the action owns the preview and the commit — so a tool
|
|
2261
|
+
* definition is mostly `bindings`, plus presentation and any actions the tool
|
|
2262
|
+
* itself introduces.
|
|
2263
|
+
*/
|
|
2210
2264
|
interface ToolDef<TScratch = void> {
|
|
2211
2265
|
id: string;
|
|
2212
2266
|
/** Capability tags for modality eligibility. Forwarded onto `Tool.capabilities`. */
|
|
@@ -2411,7 +2465,11 @@ type AnyTool = Tool<any>;
|
|
|
2411
2465
|
* binding-scope / matchBest logic on top.
|
|
2412
2466
|
*/
|
|
2413
2467
|
|
|
2468
|
+
/** Where a binding came from, which is also its priority: a held hotkey beats
|
|
2469
|
+
* the active tool, which beats bindings that are always in scope. */
|
|
2414
2470
|
type BindingScope = 'ambient' | 'active' | 'hotkey';
|
|
2471
|
+
/** A binding paired with where it came from, ready to be matched against an
|
|
2472
|
+
* event. */
|
|
2415
2473
|
interface ScopedBinding {
|
|
2416
2474
|
binding: GestureBinding;
|
|
2417
2475
|
scope: BindingScope;
|
|
@@ -2420,6 +2478,7 @@ interface ScopedBinding {
|
|
|
2420
2478
|
* Action with no owning tool. */
|
|
2421
2479
|
ownerToolId: string | null;
|
|
2422
2480
|
}
|
|
2481
|
+
/** The binding that won a match. */
|
|
2423
2482
|
interface MatchResult {
|
|
2424
2483
|
binding: GestureBinding;
|
|
2425
2484
|
scope: BindingScope;
|
|
@@ -2479,6 +2538,11 @@ declare function specificity(spec: GestureSpec): readonly [number, number, numbe
|
|
|
2479
2538
|
* the misconfiguration at dev time.
|
|
2480
2539
|
*/
|
|
2481
2540
|
|
|
2541
|
+
/** Everything the dispatcher must consult to route one input event: the
|
|
2542
|
+
* registered actions and their deps, which tool is active, which hotkeys are
|
|
2543
|
+
* held, and — optionally — the chrome state that action eligibility rules are
|
|
2544
|
+
* evaluated against. Rebuilt per event rather than held, so the dispatcher
|
|
2545
|
+
* itself stays stateless apart from in-flight gestures. */
|
|
2482
2546
|
interface DispatcherContext {
|
|
2483
2547
|
/** All registered actions; the dispatcher walks `.defaultBinding` for ambient bindings. */
|
|
2484
2548
|
actions: ActionsRegistry;
|
|
@@ -2584,6 +2648,15 @@ interface ResolveAllOptions {
|
|
|
2584
2648
|
*/
|
|
2585
2649
|
evaluateShadowed?: boolean;
|
|
2586
2650
|
}
|
|
2651
|
+
/**
|
|
2652
|
+
* Routes input events to actions.
|
|
2653
|
+
*
|
|
2654
|
+
* For each event it assembles the bindings in scope (hotkey, then active tool,
|
|
2655
|
+
* then ambient), matches them in specificity order, filters by eligibility and
|
|
2656
|
+
* each action's `enabled` gate, and invokes the first survivor. Ongoing
|
|
2657
|
+
* actions — anything that runs across a drag — are kept in flight here and
|
|
2658
|
+
* pumped with subsequent moves until the gesture ends.
|
|
2659
|
+
*/
|
|
2587
2660
|
interface Dispatcher {
|
|
2588
2661
|
/**
|
|
2589
2662
|
* Route an input event through the binding pipeline. Returns `'handled'`
|
|
@@ -2720,6 +2793,8 @@ interface Dispatcher {
|
|
|
2720
2793
|
*/
|
|
2721
2794
|
beginUiOngoing(actionId: string, deps: ActionDeps, params?: Record<string, unknown>): UiOngoingControl | null;
|
|
2722
2795
|
}
|
|
2796
|
+
/** Build a dispatcher. `getAction` overrides how action ids are resolved;
|
|
2797
|
+
* by default the `DispatcherContext`'s registry is used. */
|
|
2723
2798
|
declare function createDispatcher(opts?: {
|
|
2724
2799
|
getAction?: (id: string) => Action | undefined;
|
|
2725
2800
|
}): Dispatcher;
|
|
@@ -2873,6 +2948,7 @@ declare const ActionDisabledReason: {
|
|
|
2873
2948
|
/** Sentinel: the predicate threw. Surfaced by `evaluateEnabled`'s catch. */
|
|
2874
2949
|
readonly PredicateThrew: "predicate-threw";
|
|
2875
2950
|
};
|
|
2951
|
+
/** Why an action is unavailable right now. */
|
|
2876
2952
|
type ActionDisabledReason = (typeof ActionDisabledReason)[keyof typeof ActionDisabledReason];
|
|
2877
2953
|
/**
|
|
2878
2954
|
* @experimental
|
|
@@ -2882,6 +2958,14 @@ interface ActionEnabledResult {
|
|
|
2882
2958
|
enabled: boolean;
|
|
2883
2959
|
reason?: ActionDisabledReason;
|
|
2884
2960
|
}
|
|
2961
|
+
/**
|
|
2962
|
+
* @experimental
|
|
2963
|
+
* Safely evaluate an action's `enabled` predicate. Returns `{enabled: true}`
|
|
2964
|
+
* when no predicate is supplied. Catches throws and treats them as disabled
|
|
2965
|
+
* with reason `'(predicate threw)'`. In dev mode, warns once per action id
|
|
2966
|
+
* when a single call exceeds 4ms (single frame at 240fps — generous; real
|
|
2967
|
+
* predicates should be sub-millisecond).
|
|
2968
|
+
*/
|
|
2885
2969
|
declare function evaluateEnabled(action: Action, deps?: ActionDeps): ActionEnabledResult;
|
|
2886
2970
|
/**
|
|
2887
2971
|
* @experimental
|
|
@@ -2959,4 +3043,4 @@ declare function useActionsRegistry(): ActionsRegistry | null;
|
|
|
2959
3043
|
*/
|
|
2960
3044
|
declare function useAction(action: Action): void;
|
|
2961
3045
|
|
|
2962
|
-
export { type
|
|
3046
|
+
export { type BooleanOp as $, type Action as A, type BooleansAdapter as B, type Condition as C, type Dims as D, type Eligibility as E, ALWAYS as F, type GeometryProjection as G, type HotkeyTrigger as H, type InsertExtras as I, type ActionDeps as J, ActionDisabledReason as K, type LayerHit as L, type ActionEnabledResult as M, type ActionEntry as N, type OverlayPosition as O, ActionsProvider as P, ActiveToolContextProvider as Q, type RenderLayer as R, type SliceDep as S, type Tool as T, type UseSelectionOptions as U, type VisibilityRules as V, ActiveToolContextProviderIfRoot as W, type ActiveToolContextProviderProps as X, type ActiveToolContextValue as Y, type AreaSelectDep as Z, type BindingOpts as _, type DeviceProfile as a, evaluateEnabled as a$, type BooleanOpResult as a0, type BoundGesture as a1, type BuildRuleCtxArgs as a2, type ClaimableGesture as a3, type ClipboardDep as a4, type ClipboardIngestCtx as a5, type CustomPaintContext as a6, type DepName as a7, type DepRegistry as a8, DepRegistryProvider as a9, type ResolveAllOptions as aA, type ResolveOnlyResult as aB, type ResolvedCandidate as aC, type SelectionExtendKey as aD, type SelectionMode as aE, type Selector as aF, type SnapDep as aG, type SvgUnpacker as aH, type TextEditDep as aI, type ToolCtx as aJ, type ToolModifiers as aK, type ToolPresentation as aL, type ToolSlot as aM, type UiOngoingControl as aN, type ViewApi as aO, applyBooleanOp as aP, buildRuleCtx as aQ, clipboardCopyAction as aR, clipboardCutAction as aS, composeRectPose as aT, composeWorldPose as aU, createDispatcher as aV, decomposeRectPose as aW, describeRule as aX, drawLayers as aY, enterTextEditAction as aZ, evaluate as a_, type DispatcherContext as aa, type DragSample as ab, type EditAnchorsDep as ac, type GestureBinding as ad, IDENTITY_POSE_COMPOSITION as ae, type ImmediateInvoker as af, type IngestCtx as ag, type IngestionDep as ah, type InsertDep as ai, type InvocationCtx as aj, type Invoker as ak, type LassoSelectDep as al, type LayoutDep as am, type MatchResult as an, NEVER as ao, type NodeAtPointDep as ap, type OngoingHandle as aq, type OngoingInvoker as ar, type OngoingOverlay as as, type Point2 as at, PointerContextProvider as au, type PointerContextValue as av, type PointerWorldPos as aw, type PoseAdapter as ax, type PoseComposition as ay, type ResizePolicy as az, type DetectedDeviceFacts as b, rebaseLocalPose as b0, registerContentHandler as b1, sliceAction as b2, specificity as b3, translateRectPose as b4, useAction as b5, useActionsRegistry as b6, useActiveToolContext as b7, useDepRegistry as b8, useDepSource as b9, useOptionalActiveToolContext as ba, useOptionalDepRegistry as bb, usePointerContext as bc, useSelection as bd, worldPoseLookup as be, type Rule as c, type RuleCtx as d, type ChromeCtx as e, type ChromeId as f, type DepSchema as g, type ActionsRegistry as h, type AffordanceHit as i, type Dispatcher as j, type ToolDef as k, type ViewportToolDef as l, type AnyTool as m, type ToolKeybinding as n, type ChromeState as o, type SelectionApi as p, type ContentHandlerEntry as q, type SvgIngestOptions as r, type ActionsProp as s, type Affordance as t, type AffordanceRegion as u, type AffordanceBinding as v, type CommonAffordanceScratch as w, type BindingScope as x, type Contribution as y, type ScopedBinding as z };
|
package/dist/renderer.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { I as ImageMinification, G as GLImageCache } from './viewToMat3-
|
|
2
|
-
export { V as ViewLike, v as viewToMat3 } from './viewToMat3-
|
|
1
|
+
import { I as ImageMinification, G as GLImageCache } from './viewToMat3-CQW_YqDw.js';
|
|
2
|
+
export { V as ViewLike, v as viewToMat3 } from './viewToMat3-CQW_YqDw.js';
|
|
3
3
|
import { G as GradStop, S as Stroke } from './paint-types-CnLIzqq1.js';
|
|
4
4
|
export { a as TextureHandle, r as registerTexture } from './paint-types-CnLIzqq1.js';
|
|
5
|
-
import { M as Mat3, S as ShaderProgramHandle, D as DrawCommand } from './DrawCommand-
|
|
6
|
-
export { G as GroupDrawCommand, I as ImageDrawCommand, P as PathDrawCommand, a as ShaderDrawCommand, b as ShaderUniform, c as SolidPaint, T as TextDrawCommand, m as mat3, r as registerProgram } from './DrawCommand-
|
|
5
|
+
import { M as Mat3, S as ShaderProgramHandle, D as DrawCommand } from './DrawCommand-BbPrSTra.js';
|
|
6
|
+
export { G as GroupDrawCommand, I as ImageDrawCommand, P as PathDrawCommand, a as ShaderDrawCommand, b as ShaderUniform, c as SolidPaint, T as TextDrawCommand, m as mat3, r as registerProgram } from './DrawCommand-BbPrSTra.js';
|
|
7
7
|
import { P as Path } from './path-B6MMiodD.js';
|
|
8
8
|
export { canQueryLocalFonts, enableLocalFontOutlines, hasFontOutlines, isCanvasFont, listFontOutlines, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, subscribeGlyphReady, unregisterCanvasFont, unregisterFontOutlines } from '@weasel-js/font';
|
|
9
9
|
|
|
@@ -16,6 +16,8 @@ export { canQueryLocalFonts, enableLocalFontOutlines, hasFontOutlines, isCanvasF
|
|
|
16
16
|
* via the recorder Proxy without further special-casing.
|
|
17
17
|
*/
|
|
18
18
|
type Stage = 'vertex' | 'fragment' | 'link';
|
|
19
|
+
/** Thrown when a shader fails to compile or link, carrying which stage failed
|
|
20
|
+
* and the driver's log. */
|
|
19
21
|
declare class ShaderCompileError extends Error {
|
|
20
22
|
readonly stage: Stage;
|
|
21
23
|
readonly log: string;
|
|
@@ -157,7 +159,8 @@ declare class GLMeshCache {
|
|
|
157
159
|
* GL texture upload + cache for MSDF font atlases (and future images).
|
|
158
160
|
*
|
|
159
161
|
* Textures are keyed by a string id (the font family name or image id).
|
|
160
|
-
*
|
|
162
|
+
* Pixels are uploaded once per id; a later upload of the same id reuses the
|
|
163
|
+
* texture and only re-applies its wrap mode when that changed.
|
|
161
164
|
* The cache is GL-context-bound; discard and create a new one on context loss.
|
|
162
165
|
*
|
|
163
166
|
* Atlas format: RGBA UNSIGNED_BYTE, linear filtering, no mipmaps.
|
|
@@ -172,11 +175,15 @@ type TextureWrap = 'clamp' | 'repeat';
|
|
|
172
175
|
declare class GLTextureCache {
|
|
173
176
|
private readonly gl;
|
|
174
177
|
private readonly map;
|
|
178
|
+
private readonly wraps;
|
|
175
179
|
constructor(gl: WebGL2RenderingContext);
|
|
176
180
|
has(id: string): boolean;
|
|
177
|
-
/** Uploads once per id
|
|
178
|
-
*
|
|
181
|
+
/** Uploads the pixels once per id. `wrap` is re-applied whenever it differs
|
|
182
|
+
* from what the id was last uploaded under: the same registered image can
|
|
183
|
+
* be a clamped shader texture in one draw and a repeating pattern tile in
|
|
184
|
+
* the next, and first-upload-wins gave the second one the first one's mode. */
|
|
179
185
|
upload(id: string, source: TexSource, wrap?: TextureWrap): string;
|
|
186
|
+
private applyWrap;
|
|
180
187
|
/** Create a single-channel R8 texture from raw bytes (full upload).
|
|
181
188
|
* No-op if `id` already exists. Same LINEAR/CLAMP params as `upload`;
|
|
182
189
|
* UNPACK_ALIGNMENT dropped to 1 for non-4-aligned row widths. */
|
|
@@ -203,6 +210,8 @@ declare class GLTextureCache {
|
|
|
203
210
|
* shader applies premultiplication before writing outColor.
|
|
204
211
|
*/
|
|
205
212
|
|
|
213
|
+
/** Bake gradient stops into a 256-entry RGBA lookup strip, which the shader
|
|
214
|
+
* samples instead of evaluating stops per fragment. */
|
|
206
215
|
declare function buildGradientRamp(stops: GradStop[]): Uint8ClampedArray;
|
|
207
216
|
declare class GradientRampCache {
|
|
208
217
|
private readonly gl;
|
|
@@ -241,6 +250,9 @@ declare class GroupState {
|
|
|
241
250
|
get alpha(): number;
|
|
242
251
|
get colorMatrix(): Float32Array;
|
|
243
252
|
push(frame: GroupFrame): void;
|
|
253
|
+
/** Drop every pushed frame, leaving the root. A frame that throws part-way
|
|
254
|
+
* down the tree never pops, and the next frame would draw under leftovers. */
|
|
255
|
+
reset(): void;
|
|
244
256
|
pop(): void;
|
|
245
257
|
}
|
|
246
258
|
|
|
@@ -257,16 +269,22 @@ declare class GroupState {
|
|
|
257
269
|
|
|
258
270
|
declare class SolidBatch {
|
|
259
271
|
private readonly gl;
|
|
260
|
-
private readonly
|
|
261
|
-
private readonly
|
|
262
|
-
|
|
272
|
+
private readonly aPos;
|
|
273
|
+
private readonly aColor;
|
|
274
|
+
/** Cycled per flush, and created on first use so a renderer that flushes
|
|
275
|
+
* rarely allocates as few slots as it flushes. */
|
|
276
|
+
private readonly ring;
|
|
277
|
+
private next;
|
|
278
|
+
/** The same, for flushes past a slot's capacity; these sets grow to fit. */
|
|
279
|
+
private readonly largeRing;
|
|
280
|
+
private nextLarge;
|
|
263
281
|
private verts;
|
|
264
282
|
private idx;
|
|
265
283
|
private nVerts;
|
|
266
284
|
private nIdx;
|
|
267
|
-
/**
|
|
268
|
-
|
|
269
|
-
private
|
|
285
|
+
/** Whether the staged run is rects alone, so its indices are the canonical
|
|
286
|
+
* quad pattern and a slot already holding that pattern needs no upload. */
|
|
287
|
+
private pureRects;
|
|
270
288
|
constructor(gl: WebGL2RenderingContext, prog: ShaderProgram);
|
|
271
289
|
get length(): number;
|
|
272
290
|
/** Whether staging `vertices` more would put the run past the per-flush cap. */
|
|
@@ -283,17 +301,22 @@ declare class SolidBatch {
|
|
|
283
301
|
* index buffer is uploaded per flush rather than written once.
|
|
284
302
|
*/
|
|
285
303
|
pushMesh(mesh: Mesh, m: Mat3, r: number, g: number, b: number, a: number): void;
|
|
286
|
-
/** Upload the staged geometry and bind
|
|
287
|
-
* count for the caller's `drawElements`. */
|
|
304
|
+
/** Upload the staged geometry into the next set of buffers and bind its VAO.
|
|
305
|
+
* Returns the index count for the caller's `drawElements`. */
|
|
288
306
|
uploadAndBind(): number;
|
|
289
307
|
reset(): void;
|
|
290
308
|
dispose(): void;
|
|
291
309
|
/** Grow the CPU arrays so `vertices` / `indices` more fit. */
|
|
292
310
|
private reserve;
|
|
293
|
-
|
|
294
|
-
private
|
|
311
|
+
private nextRingSlot;
|
|
312
|
+
private nextLargeSlot;
|
|
313
|
+
private createSet;
|
|
314
|
+
private deleteSet;
|
|
295
315
|
}
|
|
296
316
|
|
|
317
|
+
/** How to construct a `WeaselRenderer`: the GL context or canvas to draw
|
|
318
|
+
* into, the output size, and the quality knobs that separate screen
|
|
319
|
+
* rendering from print. */
|
|
297
320
|
interface WeaselRendererOptions {
|
|
298
321
|
gl?: WebGL2RenderingContext;
|
|
299
322
|
canvas?: HTMLCanvasElement;
|
|
@@ -326,6 +349,14 @@ interface WeaselRendererOptions {
|
|
|
326
349
|
* print has no reason to sample a field it could evaluate exactly). */
|
|
327
350
|
textOutlineMinScreenSize?: number;
|
|
328
351
|
}
|
|
352
|
+
/**
|
|
353
|
+
* The WebGL2 renderer: takes a list of draw commands and paints them.
|
|
354
|
+
*
|
|
355
|
+
* It knows nothing about the scene — commands are the whole interface, which
|
|
356
|
+
* is what lets layers, HUD widgets and overlays all draw through the same
|
|
357
|
+
* pipeline. GPU resources (meshes, textures, gradient ramps) are cached across
|
|
358
|
+
* frames and keyed by identity, so re-issuing the same command is cheap.
|
|
359
|
+
*/
|
|
329
360
|
declare class WeaselRenderer {
|
|
330
361
|
private readonly gl;
|
|
331
362
|
private pathFill;
|
|
@@ -433,12 +464,18 @@ declare class WeaselRenderer {
|
|
|
433
464
|
/** @internal */ _dpr(): number;
|
|
434
465
|
}
|
|
435
466
|
|
|
467
|
+
/** Options for `tessellate`. A smaller tolerance means more triangles and
|
|
468
|
+
* smoother curves; it is in path-local units, so callers rendering at a
|
|
469
|
+
* larger scale should tighten it. */
|
|
436
470
|
interface TessellateOptions {
|
|
437
471
|
/** Flatness tolerance for bezier subdivision in path-local units. */
|
|
438
472
|
flattenTolerance?: number;
|
|
439
473
|
}
|
|
474
|
+
/** Turn a path into a triangle mesh the renderer can draw: curves flattened to
|
|
475
|
+
* line segments, then the resulting polygon triangulated. */
|
|
440
476
|
declare function tessellate(path: Path, opts?: TessellateOptions): Mesh;
|
|
441
477
|
|
|
478
|
+
/** Options for stroke tessellation. */
|
|
442
479
|
interface StrokeOptions {
|
|
443
480
|
flattenTolerance?: number;
|
|
444
481
|
}
|
package/dist/renderer.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { IDENTITY_COLOR_MATRIX, OUTLINE_MIN_SCREEN_PX, ShaderCompileError, WeaselRenderer, buildGradientRamp, canQueryLocalFonts, enableLocalFontOutlines, hasFontOutlines, isCanvasFont, listFontOutlines, mat3, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, registerProgram, subscribeGlyphReady, tessellate, tessellateStroke, unregisterCanvasFont, unregisterFontOutlines, viewToMat3 } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
1
|
+
export { IDENTITY_COLOR_MATRIX, OUTLINE_MIN_SCREEN_PX, ShaderCompileError, WeaselRenderer, buildGradientRamp, canQueryLocalFonts, enableLocalFontOutlines, hasFontOutlines, isCanvasFont, listFontOutlines, mat3, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, registerProgram, subscribeGlyphReady, tessellate, tessellateStroke, unregisterCanvasFont, unregisterFontOutlines, viewToMat3 } from './chunk-AYGSXNY3.js';
|
|
2
|
+
import './chunk-J3YC3GVF.js';
|
|
3
|
+
import './chunk-CSMF654J.js';
|
|
4
|
+
import './chunk-J7LUY47N.js';
|
|
5
|
+
import './chunk-4Z6J4IVH.js';
|
|
6
|
+
import './chunk-JOSUVS6C.js';
|
|
7
7
|
import './chunk-UGFFCMQP.js';
|
|
8
8
|
import './chunk-BHVYVFGV.js';
|
|
9
9
|
import './chunk-GVCNT7UH.js';
|
|
10
|
-
export { registerTexture } from './chunk-
|
|
10
|
+
export { registerTexture } from './chunk-HGF5X6MZ.js';
|
|
11
11
|
//# sourceMappingURL=renderer.js.map
|
|
12
12
|
//# sourceMappingURL=renderer.js.map
|
package/dist/resize.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
export { C as CORNER_ANCHORS, a as CornerAnchor, b as CornerHandle, U as UseResizeOptions, c as cornerPoint, d as cornerResizeHandles, f as fixedCornerOf, h as hitCornerHandle, p as pointSnapToGrid } from './pointSnapToGrid-
|
|
2
|
-
export { P as PoseProjection, R as RECT_POSE_DESCRIPTOR, a as ROTATED_POSE_DESCRIPTOR } from './geometry-
|
|
3
|
-
import { R as ResizePose, B as BoundsConstraint, M as ModifierState } from './types-
|
|
1
|
+
export { C as CORNER_ANCHORS, a as CornerAnchor, b as CornerHandle, U as UseResizeOptions, c as cornerPoint, d as cornerResizeHandles, f as fixedCornerOf, h as hitCornerHandle, p as pointSnapToGrid } from './pointSnapToGrid-C3wowsQy.js';
|
|
2
|
+
export { P as PoseProjection, R as RECT_POSE_DESCRIPTOR, a as ROTATED_POSE_DESCRIPTOR } from './geometry-5X6TrAkX.js';
|
|
3
|
+
import { R as ResizePose, B as BoundsConstraint, M as ModifierState } from './types-ByZxoD6P.js';
|
|
4
4
|
import { G as Guide } from './types-D2tTKEU0.js';
|
|
5
5
|
import { V as View } from './view-DSQgxBJB.js';
|
|
6
|
-
import './types-
|
|
6
|
+
import './types-BHK2dkMu.js';
|
|
7
7
|
import '@weasel-js/history';
|
|
8
|
-
import './types-
|
|
8
|
+
import './types-DpQ0cWYC.js';
|
|
9
9
|
|
|
10
|
+
/** Resize constraint that stops a node shrinking past a minimum. The anchored
|
|
11
|
+
* edge stays put, so clamping pushes the dragged edge back rather than moving
|
|
12
|
+
* the node. */
|
|
10
13
|
declare function clampMinSize<TPose extends ResizePose>(args: {
|
|
11
14
|
minWidth: number;
|
|
12
15
|
minHeight: number;
|
|
@@ -39,6 +42,10 @@ declare function lockAspectWithModifier<TPose extends ResizePose>(opts?: {
|
|
|
39
42
|
}): BoundsConstraint<TPose>;
|
|
40
43
|
|
|
41
44
|
type ModKey$1 = keyof ModifierState;
|
|
45
|
+
/** Resize constraint that snaps the moving edges to a grid, leaving the
|
|
46
|
+
* anchored ones where they are. By default a node already smaller than one
|
|
47
|
+
* grid cell on an axis is left unsnapped on that axis, so it stays resizable
|
|
48
|
+
* at sub-grid sizes. */
|
|
42
49
|
declare function snapToGrid<TPose extends ResizePose>(args: {
|
|
43
50
|
spacing: number;
|
|
44
51
|
bypassKey?: ModKey$1;
|
package/dist/resize.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CORNER_ANCHORS, DEFAULT_RESIZE_BEHAVIORS, clampMinSize, cornerPoint, cornerResizeHandles, fixedCornerOf, hitCornerHandle, lockAspectWithModifier, pointSnapToGrid, snapToGrid, snapToGuides } from './chunk-
|
|
2
|
-
export { RECT_POSE_DESCRIPTOR, ROTATED_POSE_DESCRIPTOR } from './chunk-
|
|
1
|
+
export { CORNER_ANCHORS, DEFAULT_RESIZE_BEHAVIORS, clampMinSize, cornerPoint, cornerResizeHandles, fixedCornerOf, hitCornerHandle, lockAspectWithModifier, pointSnapToGrid, snapToGrid, snapToGuides } from './chunk-J7LUY47N.js';
|
|
2
|
+
export { RECT_POSE_DESCRIPTOR, ROTATED_POSE_DESCRIPTOR } from './chunk-4Z6J4IVH.js';
|
|
3
3
|
//# sourceMappingURL=resize.js.map
|
|
4
4
|
//# sourceMappingURL=resize.js.map
|
package/dist/routing.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { ParsedModifiers, GestureName, GestureSpec } from '@weasel-js/gestures';
|
|
2
2
|
export { ChannelRef, DescribeRouteOptions, GESTURE_DESCRIPTORS, GestureArgSpec, GestureDescriptor, GestureName, ModRequirement, ModifierKey, ParsedModifiers, ParsedRoute, PhaseAtom, RESERVED_ID_NAMES, RESERVED_ID_PREFIXES, ROUTE_FIELD_DEFINITIONS, ROUTE_TERMS, RouteDescriptionPart, RouteFieldName, RouteTermLabel, canonicalModifiers, collapseShiftPairs, describeRoute, describeRouteParts, formatPhaseAtom, formatRoute, getGestureDescriptor, isKnownGestureName, parseRoute } from '@weasel-js/gestures';
|
|
3
|
-
import { T as Tool } from './registry-
|
|
4
|
-
import './types-
|
|
3
|
+
import { T as Tool } from './registry-QRg8KiNM.js';
|
|
4
|
+
import './types-vqxpCFVp.js';
|
|
5
5
|
import '@weasel-js/history';
|
|
6
6
|
import './path-B6MMiodD.js';
|
|
7
|
-
import './types-
|
|
8
|
-
import './types-
|
|
7
|
+
import './types-ByZxoD6P.js';
|
|
8
|
+
import './types-DpQ0cWYC.js';
|
|
9
9
|
import './view-DSQgxBJB.js';
|
|
10
10
|
import '@weasel-js/modes';
|
|
11
11
|
import 'react';
|
|
12
|
-
import './geometry-
|
|
12
|
+
import './geometry-5X6TrAkX.js';
|
|
13
13
|
import './paint-types-CnLIzqq1.js';
|
|
14
|
-
import './DrawCommand-
|
|
14
|
+
import './DrawCommand-BbPrSTra.js';
|
|
15
15
|
import 'react/jsx-runtime';
|
|
16
|
-
import './types-
|
|
16
|
+
import './types-BHK2dkMu.js';
|
|
17
17
|
import '@weasel-js/geom';
|
|
18
18
|
|
|
19
19
|
/**
|
package/dist/routing.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { GESTURE_DESCRIPTORS, RESERVED_ID_NAMES, RESERVED_ID_PREFIXES, ROUTE_FIELD_DEFINITIONS, ROUTE_TERMS, buildRouteRegistry, canonicalModifiers, collapseShiftPairs, describeRoute, describeRouteParts, findConflicts, formatPhaseAtom, formatRoute, getGestureDescriptor, isKnownGestureName, parseRoute } from './chunk-
|
|
1
|
+
export { GESTURE_DESCRIPTORS, RESERVED_ID_NAMES, RESERVED_ID_PREFIXES, ROUTE_FIELD_DEFINITIONS, ROUTE_TERMS, buildRouteRegistry, canonicalModifiers, collapseShiftPairs, describeRoute, describeRouteParts, findConflicts, formatPhaseAtom, formatRoute, getGestureDescriptor, isKnownGestureName, parseRoute } from './chunk-J3YC3GVF.js';
|
|
2
2
|
//# sourceMappingURL=routing.js.map
|
|
3
3
|
//# sourceMappingURL=routing.js.map
|
|
@@ -20,7 +20,10 @@ interface DebugConfig {
|
|
|
20
20
|
* {@link DEFAULT_DEBUG_STROKES}. */
|
|
21
21
|
strokes?: Partial<DebugStrokes>;
|
|
22
22
|
}
|
|
23
|
+
/** The name of one debug-overlay feature — the keys of {@link DebugConfig}
|
|
24
|
+
* that toggle a visualization. */
|
|
23
25
|
type DebugFeature = 'hitboxes' | 'handles' | 'bounds' | 'origins' | 'snap' | 'layers' | 'ids' | 'fps';
|
|
26
|
+
/** Colors the debug overlay draws with, one entry per feature. */
|
|
24
27
|
interface DebugTheme {
|
|
25
28
|
hitboxFill: string;
|
|
26
29
|
hitboxStroke: string;
|
|
@@ -52,7 +55,10 @@ interface DebugStrokes {
|
|
|
52
55
|
/** Rejected snap candidates only; accepted ones paint as a filled dot. */
|
|
53
56
|
snap: DebugStroke;
|
|
54
57
|
}
|
|
58
|
+
/** Which kind of handle a recorded handle marker represents. */
|
|
55
59
|
type HandleKind = 'corner' | 'rotation' | 'anchor';
|
|
60
|
+
/** The geometry a hit region actually tests against, as reported to the debug
|
|
61
|
+
* sink so the overlay can draw the real shape rather than its bounding box. */
|
|
56
62
|
type HitShape = {
|
|
57
63
|
kind: 'rect';
|
|
58
64
|
x: number;
|
|
@@ -69,11 +75,13 @@ type HitShape = {
|
|
|
69
75
|
kind: 'path';
|
|
70
76
|
d: Path2D;
|
|
71
77
|
};
|
|
78
|
+
/** A hit region tested during the current frame. */
|
|
72
79
|
interface RecordedHitbox {
|
|
73
80
|
id: string;
|
|
74
81
|
kind: 'body' | 'handle' | 'rotation' | 'anchor';
|
|
75
82
|
shape: HitShape;
|
|
76
83
|
}
|
|
84
|
+
/** A handle drawn during the current frame, and where. */
|
|
77
85
|
interface RecordedHandle {
|
|
78
86
|
id: string;
|
|
79
87
|
position: {
|
|
@@ -82,6 +90,7 @@ interface RecordedHandle {
|
|
|
82
90
|
};
|
|
83
91
|
kind: HandleKind;
|
|
84
92
|
}
|
|
93
|
+
/** A node's bounds as computed during the current frame. */
|
|
85
94
|
interface RecordedBounds {
|
|
86
95
|
id: string;
|
|
87
96
|
bounds: {
|
|
@@ -91,6 +100,7 @@ interface RecordedBounds {
|
|
|
91
100
|
height: number;
|
|
92
101
|
};
|
|
93
102
|
}
|
|
103
|
+
/** A node's transform origin as used during the current frame. */
|
|
94
104
|
interface RecordedOrigin {
|
|
95
105
|
id: string;
|
|
96
106
|
point: {
|
|
@@ -98,6 +108,9 @@ interface RecordedOrigin {
|
|
|
98
108
|
y: number;
|
|
99
109
|
};
|
|
100
110
|
}
|
|
111
|
+
/** A snap candidate considered during the current gesture, and whether it
|
|
112
|
+
* won. Unlike the other records these survive across frames, until the
|
|
113
|
+
* gesture ends. */
|
|
101
114
|
interface RecordedSnap {
|
|
102
115
|
point: {
|
|
103
116
|
x: number;
|
|
@@ -105,12 +118,14 @@ interface RecordedSnap {
|
|
|
105
118
|
};
|
|
106
119
|
accepted: boolean;
|
|
107
120
|
}
|
|
121
|
+
/** A render layer that drew during the current frame. */
|
|
108
122
|
interface RecordedLayer {
|
|
109
123
|
id: string;
|
|
110
124
|
label: string;
|
|
111
125
|
space: 'world' | 'screen';
|
|
112
126
|
index: number;
|
|
113
127
|
}
|
|
128
|
+
/** Everything the sink collected, ready for the overlay to draw. */
|
|
114
129
|
interface DebugSnapshot {
|
|
115
130
|
hitboxes: RecordedHitbox[];
|
|
116
131
|
handles: RecordedHandle[];
|
|
@@ -119,6 +134,14 @@ interface DebugSnapshot {
|
|
|
119
134
|
snap: RecordedSnap[];
|
|
120
135
|
layers: RecordedLayer[];
|
|
121
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* Where the kit reports what it is doing so the debug overlay can draw it.
|
|
139
|
+
*
|
|
140
|
+
* Recording is push-based and cheap: hit-testers, handle painters and snap
|
|
141
|
+
* strategies call these as they run, whether or not any overlay is watching.
|
|
142
|
+
* Nothing here affects behavior — a sink that discards everything is a valid
|
|
143
|
+
* sink.
|
|
144
|
+
*/
|
|
122
145
|
interface DebugSink {
|
|
123
146
|
recordHitbox(id: string, kind: 'body' | 'handle' | 'rotation' | 'anchor', shape: HitShape): void;
|
|
124
147
|
recordHandle(id: string, position: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Op } from '@weasel-js/history';
|
|
2
|
-
import { S as SnapTarget, M as MoveAdapter, I as InsertAdapter } from './types-
|
|
2
|
+
import { S as SnapTarget, M as MoveAdapter, I as InsertAdapter } from './types-DpQ0cWYC.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Snapshot of modifier-key state at gesture dispatch.
|