@weasel-js/routing 1.13.0 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- import { ModifierKey, ClaimableGesture, GestureSpec, InputEvent, TargetSpec, IngestItem, BodyTarget, BindingOverrideInput, KeyHeldSpec, TargetPredicate, KeySpec, ClickSpec, DoubleClickSpec, DragSpec, ContextMenuSpec, ParsedModifiers, GestureName } from '@weasel-js/gestures';
1
+ import { ModifierKey, ClaimableGesture, GestureSpec, InputEvent, TargetSpec, IngestItem, BodyTarget, BindingOverrideInput, BodyKind, KeyHeldSpec, TargetPredicate, KeySpec, ClickSpec, DoubleClickSpec, DragSpec, ContextMenuSpec, ParsedModifiers, GestureName } from '@weasel-js/gestures';
2
2
  import { FramedBox, View, Point } from '@weasel-js/geom';
3
3
  import { CursorSpec } from '@weasel-js/cursor';
4
4
  import { MenuEntry, Rect, MenuSide, MenuShortcut } from '@weasel-js/menu';
5
- import { PrefGroup } from '@weasel-js/prefs';
5
+ import { PrefGroup, PrefLeaf } from '@weasel-js/prefs';
6
6
  import { CapabilityTag, ActiveMode, ModeRegistry } from '@weasel-js/modes';
7
7
  import * as _weasel_js_icons from '@weasel-js/icons';
8
8
  import { IconRef } from '@weasel-js/icons';
@@ -190,6 +190,8 @@ type OverlayRole =
190
190
  | 'falloff'
191
191
  /** What a lock holds a dragged point to — a line, a circle. */
192
192
  | 'lock'
193
+ /** What a dragged item would be dropped on: the box it would go into. */
194
+ | 'target'
193
195
  /** Where a dragged item would land: a reorder's insertion bar. */
194
196
  | 'insert'
195
197
  /** Where a dragged item is over and cannot land. */
@@ -286,6 +288,18 @@ type OngoingOverlay = {
286
288
  /** World affines the shape will also be drawn under once it lands, by
287
289
  * the container it is drawn into: the preview is painted under each. */
288
290
  copies?: readonly (readonly [number, number, number, number, number, number])[];
291
+ } | {
292
+ /**
293
+ * Why the gesture cannot land where it is, in words for the user: a
294
+ * refusal's reason. A surface shows `text` beside the pointer, which
295
+ * `at` is, in world coordinates.
296
+ */
297
+ kind: 'reason';
298
+ at: {
299
+ x: number;
300
+ y: number;
301
+ };
302
+ text: string;
289
303
  };
290
304
  /** A handle's overlays as a list: empty when it has none. */
291
305
  declare function overlaysOf(handle: OngoingHandle): readonly OngoingOverlay[];
@@ -332,6 +346,15 @@ declare function roleReader<R extends ModifierRoles>(roles: R): (ctx: {
332
346
 
333
347
  /** A 2D point in either world or screen coordinates; geom's `Point`. */
334
348
  type Point2 = Point;
349
+ /**
350
+ * A point in the space the dispatcher's `clientToWorld` maps the pointer into:
351
+ * the world, on a 2D canvas. A host with a camera of its own, such as a
352
+ * `@weasel-js/kernel3d` scene, passes identity, so there it is the pane's
353
+ * screen point and the deps reading it cast a ray through the camera they
354
+ * close over. Every world point the dispatcher hands out, and every dep
355
+ * payload it reaches, is one of these.
356
+ */
357
+ type WorldPoint = Point2;
335
358
  /**
336
359
  * Which UI affordance was hit at pointerdown. Populated by the dispatcher when
337
360
  * the `affordanceAt` thunk is provided to `useGestureDispatcher`.
@@ -385,7 +408,7 @@ interface AffordanceHit {
385
408
  * The stylus fields are absent for mouse/touch on browsers that don't report
386
409
  * them, and for synthetic events.
387
410
  */
388
- interface DragSample extends Point2 {
411
+ interface DragSample extends WorldPoint {
389
412
  /** 0..1. Mouse/touch report 0.5 while a button is held, per the spec. */
390
413
  pressure?: number;
391
414
  /** Degrees, ±90. Zero for mouse/touch. */
@@ -397,7 +420,7 @@ interface DragSample extends Point2 {
397
420
  * Gesture-kind-specific fields (`drag`, `wheel`, `multiTouch`, `key`) are
398
421
  * populated only for matching gesture kinds. */
399
422
  interface InvocationCtx {
400
- world: Point2;
423
+ world: WorldPoint;
401
424
  /**
402
425
  * The pointer in client/screen pixels, for an action that has to place DOM
403
426
  * at the pointer. Absent on every invocation whose event carries no client
@@ -412,12 +435,14 @@ interface InvocationCtx {
412
435
  modifiers: ModifierState;
413
436
  deps: ActionDeps;
414
437
  drag?: {
415
- start: Point2;
416
- current: Point2;
438
+ start: WorldPoint;
439
+ current: WorldPoint;
417
440
  delta: Point2;
418
441
  /**
419
- * Drag delta in client/screen coordinates (CSS pixels from the drag
420
- * origin). Use this — never `delta` — for any action whose effect
442
+ * Drag delta in the surface's own CSS pixels from the drag origin: client
443
+ * pixels, or through the host's `clientToLocal` where it supplies one, so
444
+ * a canvas under a scaled ancestor pans with the pointer. Use this — never
445
+ * `delta` — for any action whose effect
421
446
  * mutates the viewport itself (pan, view-zoom), because world-space
422
447
  * deltas become self-referential as the view shifts mid-drag.
423
448
  *
@@ -550,6 +575,9 @@ interface BindingOpts {
550
575
  * id, over the action's defaults and any tuning's.
551
576
  */
552
577
  roles?: RoleRebinds;
578
+ /** Screen travel, in CSS pixels, a drag makes before this binding's ongoing action starts, over the
579
+ * action's own `dragThresholdPx`. See {@link OngoingInvoker.dragThresholdPx}. */
580
+ dragThresholdPx?: number;
553
581
  }
554
582
  /** Resolve `BindingOpts.params` to a concrete record (calling the thunk if
555
583
  * needed). Returns `undefined` for absent params. */
@@ -582,7 +610,14 @@ interface OngoingHandle {
582
610
  * rotate glyph turning about its pivot. `undefined` defers to the action.
583
611
  */
584
612
  cursor?(): CursorSpec | undefined;
585
- onMove?(ctx: InvocationCtx): void;
613
+ /**
614
+ * A move of the gesture. Return `'pass'` from a pointer drag's move to hand
615
+ * the drag off: the dispatcher ends this handle with `'cancel'`, offers the
616
+ * drag as it was pressed to every other candidate in rank order, and the one
617
+ * that takes it starts as if it had won the press, then sees this move. With
618
+ * no taker the drag is over. A drag never returns to an action that passed it.
619
+ */
620
+ onMove?(ctx: InvocationCtx): void | 'pass';
586
621
  onEnd?(ctx: InvocationCtx, reason: 'commit' | 'cancel'): void;
587
622
  /**
588
623
  * Optional preview surface: the in-flight state the canvas's preview-ghost
@@ -643,14 +678,26 @@ interface ImmediateInvoker {
643
678
  timing: 'immediate';
644
679
  /** `params` carries the matched binding's opts.params. Invoked from the
645
680
  * command palette, or anywhere else with no per-binding context, `params`
646
- * is undefined; descriptors should default to a sensible variant. */
647
- run(deps: ActionDeps, params?: Record<string, unknown>): void;
681
+ * is undefined; descriptors should default to a sensible variant.
682
+ *
683
+ * Return `'pass'` when, having looked at the event, there is nothing to do
684
+ * with it — a scroll already at the end of its range — and the dispatcher
685
+ * walks on to the next matching binding, as for a declined `enabled()`.
686
+ * Prediction cannot run the invoker, so it still names this action. */
687
+ run(deps: ActionDeps, params?: Record<string, unknown>): void | 'pass';
648
688
  }
649
689
  /** Phase-machine invocation. `start` opens the phase and returns the handle
650
690
  * the dispatcher pumps. */
651
691
  interface OngoingInvoker {
652
692
  timing: 'ongoing';
653
693
  start(ctx: InvocationCtx, opts?: BindingOpts): OngoingHandle;
694
+ /**
695
+ * Screen travel, in CSS pixels, a pointer drag makes before the dispatcher calls `start`; a
696
+ * binding's own `dragThresholdPx` wins over it. Until then the gesture is held for this action and
697
+ * nothing else takes it, and a release short of it ends the gesture with `start` never called.
698
+ * Unset, the action starts once the press is a drag at all (`gestures.dragPx`).
699
+ */
700
+ dragThresholdPx?: number;
654
701
  }
655
702
  /** Pluggable invocation strategy for an Action. */
656
703
  type Invoker = ImmediateInvoker | OngoingInvoker;
@@ -946,7 +993,8 @@ type WalkStep = {
946
993
  kind: 'declined';
947
994
  reason: string;
948
995
  }
949
- /** An ongoing action's `start()` returned an empty handle. */
996
+ /** An ongoing action's `start()` returned an empty handle, or an
997
+ * immediate one's `run()` returned `'pass'`. */
950
998
  | {
951
999
  kind: 'empty-handle';
952
1000
  }
@@ -1425,7 +1473,7 @@ interface ActionDispatch extends BindingSource {
1425
1473
  * (on a path segment, say) refuses other points here, so the dispatcher
1426
1474
  * falls through to the next binding and hover prediction shows the
1427
1475
  * action's `cursor` only where it would act. `trigger` passes the
1428
- * `worldX`/`worldY` its params carry, so a menu row is run under the
1476
+ * `world` its params carry, so a menu row is run under the
1429
1477
  * question it was shown enabled for. Palettes and keystrokes pass no
1430
1478
  * point; treat absent as "anywhere".
1431
1479
  *
@@ -1552,6 +1600,12 @@ interface OwnedMenuDef {
1552
1600
  owner: string | null;
1553
1601
  }
1554
1602
 
1603
+ /** How values are read and written where a set of rows is drawn. */
1604
+ interface MenuAccess {
1605
+ values(path: string): unknown;
1606
+ onChange?: (path: string, value: unknown) => void;
1607
+ }
1608
+
1555
1609
  /** What resolving reads: the registered actions, each one's deps, how to run
1556
1610
  * one, and the values behind the schema's value leaves. */
1557
1611
  interface MenuSources {
@@ -1565,16 +1619,27 @@ interface MenuSources {
1565
1619
  onChange?(path: string, value: unknown): void;
1566
1620
  /** The schema an `alias` leaf's `of` is read in. Default: the menu's own. */
1567
1621
  over?: PrefGroup;
1622
+ /** The rows of an app-defined leaf, which a menu otherwise leaves out. `values` and `onChange` read and write
1623
+ * where the leaf sits, inside an object or a list entry as at the top. */
1624
+ customRows?(leaf: PrefLeaf, at: MenuCustomAt): readonly MenuEntry[];
1625
+ }
1626
+ /** Where {@link MenuSources.customRows} draws a leaf: the row key, the value's path, and how to reach it. */
1627
+ interface MenuCustomAt extends MenuAccess {
1628
+ key: string;
1629
+ path: string;
1630
+ disabled: boolean;
1568
1631
  }
1569
1632
  /**
1570
1633
  * Draw a prefs schema as menu entries. Action leaves become items from the
1571
1634
  * registry (one per variant for a parametric action), an `actions` leaf one
1572
1635
  * item per action in its group, a boolean a checked item, an enum radio
1573
- * rows, and a number and a string a row edited in place (all through `src.values`/`src.onChange`);
1574
- * a color shows as a swatch, read-only, and so does a string as a disabled row when it is a readout
1636
+ * rows, and a number, a string and a color a row edited in place (all through `src.values`/`src.onChange`);
1637
+ * a color shows read-only, and a string as a disabled row, when it is a readout
1575
1638
  * or nothing writes it. A group drawn `as` a
1576
1639
  * `menu`, `page`, `tab`, or `panel` is a submenu, and any other group's rows
1577
- * sit inline between separators. Paint, field, compound, and app-defined leaves are left out.
1640
+ * sit inline between separators, and so does a section, whose key adds nothing to its rows' paths. An object, a
1641
+ * list, a map, a union, and a field reference are each a submenu (see `compoundRows`), and a paint a color row while
1642
+ * it is solid or none; an app-defined leaf is drawn by `src.customRows`, and left out without it.
1578
1643
  * `at` is the world point the menu was opened at and reaches `enabled` and
1579
1644
  * every action's params; `params` go to every action, under its own.
1580
1645
  */
@@ -1970,8 +2035,8 @@ interface ToolPresentation {
1970
2035
  /** The tool's icon, by qualified name: `icon('rect')` in the package that draws it. */
1971
2036
  icon?: _weasel_js_icons.IconRef;
1972
2037
  /** Palette grouping key. Tools sharing a group render contiguously
1973
- * with separators between groups. Free-form string; the kit
1974
- * recommends 'select' | 'shape' | 'draw' | 'type' | 'view'. */
2038
+ * with separators between groups. Free-form string; core's
2039
+ * `TOOL_GROUP_ORDER` names the kit's own groups, in palette order. */
1975
2040
  group?: string;
1976
2041
  /** Display override for the keyboard shortcut. When omitted the palette
1977
2042
  * derives one from `Tool.keybinding` via its own formatter. */
@@ -2106,6 +2171,15 @@ interface DispatcherContext {
2106
2171
  * is, the rest only while it holds them. Absent, every binding is live.
2107
2172
  */
2108
2173
  keyReach?: KeyReach;
2174
+ /**
2175
+ * Maps a client point to the surface's own pixels, for a host drawn under a
2176
+ * CSS transform. `InvocationCtx.drag.screenDelta` is measured through it, so
2177
+ * a pan under a scaled ancestor moves with the pointer. Absent: client pixels.
2178
+ */
2179
+ toLocal?: (clientX: number, clientY: number) => {
2180
+ x: number;
2181
+ y: number;
2182
+ };
2109
2183
  /** The keymaps open on this surface. Absent: none can open. */
2110
2184
  keymaps?: KeymapStack;
2111
2185
  /** Which bindings this pass of an input reaches while a keymap is open:
@@ -2432,10 +2506,10 @@ interface ActionsRegistry {
2432
2506
  * forwarded to `ImmediateInvoker.run` as its second argument — use it for
2433
2507
  * parametric actions (e.g. `trigger('tool.activate', { toolId: 'rect' })`).
2434
2508
  * Returns whether it ran one: `false` for an unknown id, for an action
2435
- * whose `enabled` refuses, and for an ongoing-invoker action, which
2509
+ * whose `enabled` refuses or whose `run` returns `'pass'`, and for an
2510
+ * ongoing-invoker action, which
2436
2511
  * `trigger` cannot reach (see `begin`). `enabled` is asked at
2437
- * `{ x: params.worldX, y: params.worldY }` when both are numbers, and with
2438
- * no point otherwise. */
2512
+ * `params.world`, and with no point when that is absent. */
2439
2513
  trigger(id: string, params?: Record<string, unknown>): boolean;
2440
2514
  /** Show what firing `id` with `params` would do, by its `Action.preview`,
2441
2515
  * and return what takes it down; calling that twice is harmless. Shows
@@ -2493,6 +2567,24 @@ declare function validateActionId(id: string): void;
2493
2567
  * (Tool.bindings) are the right place for '&' atoms. */
2494
2568
  declare function validateActionDefaultBinding(action: Action): void;
2495
2569
 
2570
+ /**
2571
+ * An action as a hold: bound to a held key, the press shows what it would do
2572
+ * through its `preview`, the release runs it, and a cancel — Escape, through
2573
+ * the kit's cancel-gesture action — takes the preview down and runs nothing.
2574
+ */
2575
+
2576
+ /** The id {@link holdPreview} gives the hold of action `id`. */
2577
+ declare const holdPreviewId: (id: string) => string;
2578
+ /**
2579
+ * `action` as a hold, under {@link holdPreviewId}. Bind it to a `held(…)` key,
2580
+ * in a keymap or anywhere else; the binding's params reach both the preview
2581
+ * and the run. It is enabled, eligible and requires what `action` does, so it
2582
+ * is skipped wherever `action` would be. An action with no `preview` shows
2583
+ * nothing and still runs on release; one whose invoker is not immediate is
2584
+ * not run.
2585
+ */
2586
+ declare function holdPreview(action: Action): Action;
2587
+
2496
2588
  /** What the dispatcher reads straight off an input event. */
2497
2589
 
2498
2590
  /**
@@ -2510,6 +2602,37 @@ declare function modifierStateOf(e: {
2510
2602
  metaKey: boolean;
2511
2603
  shiftKey: boolean;
2512
2604
  }): ModifierState;
2605
+ /**
2606
+ * What the dispatcher puts in an immediate invoker's `params`, beneath the
2607
+ * binding's own params, which win on a clash. Each field is present only for
2608
+ * the events that carry it. `run` takes the bag as `Record<string, unknown>`,
2609
+ * so a reader casts it to this.
2610
+ */
2611
+ type ImmediateParams = {
2612
+ /** Where the event landed; a click's release. */
2613
+ world?: WorldPoint;
2614
+ /** Where a click's press landed. Geometry placed at a click pins here, so
2615
+ * the drift between press and release can't move a snapped point. */
2616
+ press?: WorldPoint;
2617
+ clientX?: number;
2618
+ clientY?: number;
2619
+ deltaX?: number;
2620
+ deltaY?: number;
2621
+ scale?: number;
2622
+ rotation?: number;
2623
+ affordance?: unknown;
2624
+ bodyTarget?: BodyTarget;
2625
+ bodyKind?: BodyKind;
2626
+ mods?: ModifierState;
2627
+ /** A hover's: whether a button was down. */
2628
+ held?: boolean;
2629
+ carry?: {
2630
+ type: string;
2631
+ value: unknown;
2632
+ };
2633
+ items?: readonly IngestItem[];
2634
+ via?: 'drop' | 'paste';
2635
+ };
2513
2636
 
2514
2637
  /** Canonical id of the consolidated tool-offhand action. One descriptor
2515
2638
  * serves every tool; the matched binding supplies `params.toolId` to select
@@ -2942,7 +3065,7 @@ interface KeymapDef<TOverlay = never> {
2942
3065
  /** The keystroke, or keystrokes, that open it. A `key-held` spec is read as
2943
3066
  * its `key` form: holding the key is what holds the keymap open. */
2944
3067
  leader: GestureSpec | readonly GestureSpec[];
2945
- /** The keymap's own bindings. Escape is not one: it always closes the keymap. */
3068
+ /** The keymap's own bindings. Escape is not one: it cancels a gesture in flight, or else closes the keymap. */
2946
3069
  bindings: readonly GestureBinding[];
2947
3070
  /** Actions the bindings name that are not registered elsewhere. */
2948
3071
  actions?: readonly Action[];
@@ -3525,14 +3648,25 @@ declare function itemsFromFiles(files: File[]): IngestItem[];
3525
3648
  /** Materialize a drop's `DataTransfer`. MUST be called during the `drop`
3526
3649
  * event dispatch (see module doc). */
3527
3650
  declare function itemsFromDataTransfer(dt: DataTransfer): Promise<IngestItem[]>;
3528
- /**
3529
- * What a drag still in flight says it carries: one item per flavor, MIME
3530
- * only. A browser withholds contents until the drop, so nothing may read
3531
- * `file` or `text` off these; they exist to ask which bindings would match.
3651
+ /** What a drag still in flight says of one item: whether it is a file or a
3652
+ * string, and its MIME. No `file` or `text` until the drop. */
3653
+ interface PendingIngestItem {
3654
+ readonly pending: 'file' | 'string';
3655
+ readonly mime: string;
3656
+ }
3657
+ /**
3658
+ * What a drag still in flight says it carries: one item per flavor, kind and
3659
+ * MIME only. A browser withholds contents until the drop, so nothing may read
3660
+ * `file` or `text` off these; they exist to ask which bindings would match and
3661
+ * to preview what the drop would make. Each is typed `IngestItem` so a drop
3662
+ * spec can be asked about it; {@link pendingKindOf} tells them apart.
3532
3663
  * A file the browser does not name yet (Firefox reports
3533
3664
  * `application/x-moz-file`, others only a `Files` type) is `UNKNOWN_MIME`.
3534
3665
  */
3535
3666
  declare function itemTypesFromDataTransfer(dt: DataTransfer): readonly IngestItem[];
3667
+ /** Whether an item from {@link itemTypesFromDataTransfer} is a file or a
3668
+ * string; undefined for a materialized item, which has its `kind`. */
3669
+ declare function pendingKindOf(item: IngestItem): PendingIngestItem['pending'] | undefined;
3536
3670
  /** Materialize a paste's `clipboardData`. Fully synchronous. */
3537
3671
  declare function itemsFromClipboardData(cd: DataTransfer): IngestItem[];
3538
3672
 
@@ -3673,4 +3807,4 @@ type KernelOverlay = OverlaySchema extends {
3673
3807
  overlay: infer O;
3674
3808
  } ? O : unknown;
3675
3809
 
3676
- export { type BindingScope as $, type Action as A, type BoundGesture as B, type Contribution as C, type DepRegistry as D, type ActionParams as E, type ActionPresentation as F, type ActionSettings as G, type ActionSettingsState as H, type ActionShortcut as I, type ActionSource as J, type KeymapDescription as K, type LongPressOptions as L, type MenuHost as M, type NodeId as N, type OverlayPosition as O, type ActionTuning as P, type ActionTunings as Q, type RuleCtx as R, ScopeNode as S, ToolNode as T, type ActionUnavailable as U, type ActionsProp as V, type AnyTool as W, type AssemblyInputs as X, BROWSER_RESERVED_CHORDS as Y, type BindingOpts as Z, type BindingOverrides as _, type DepName as a, NEVER as a$, type BindingSource as a0, type BodyPredicate as a1, type Bounds as a2, type BuildRuleCtxArgs as a3, COARSE_TARGET_SCALE as a4, type CaptureGestureOptions as a5, type CaptureKeyOptions as a6, type CaptureKind as a7, type CapturedSpec as a8, type Carried as a9, type HitShape as aA, type HotkeyTrigger as aB, INGEST_STRING_MIMES as aC, type ImmediateInvoker as aD, type InvocationCtx as aE, type Invoker as aF, KEYMAP_HOLD as aG, type KeyBinding as aH, type KeyReach as aI, type KeymapDef as aJ, type KeymapRow as aK, type KeymapStack as aL, type KeymapUnbound as aM, type KeymapVerdict as aN, type LongPressState as aO, type LongPressStore as aP, type MatchOutcome as aQ, type MatchResult as aR, type MenuHit as aS, type MenuOpenRequest as aT, type MenuSources as aU, type MenuWhen as aV, type ModeShortcutHandlers as aW, type ModeSwitchLogEntry as aX, type ModifierRole as aY, type ModifierRoles as aZ, type ModifierState as a_, type Carry as aa, type CarryCallbacks as ab, type CarryPayload as ac, type CarryPointer as ad, type CarryStage as ae, type Condition as af, type Conflict as ag, type ContributionChrome as ah, type ContributionDeps as ai, type ContributionRouting as aj, DEFAULT_ALLOWED_CAPABILITIES as ak, DEFAULT_DEVICE_PROFILE as al, type DebugSink as am, type DepListing as an, type DetectedDeviceFacts as ao, type DeviceProfile as ap, type DispatchRecord as aq, type DispatchRecordInput as ar, type DispatcherContext as as, type DragSample as at, type DroppedCandidate as au, type Eligibility as av, type EligibilityState as aw, type GestureBinding as ax, type GestureKitSettings as ay, type HandleKind as az, type DepSource as b, buildRuleCtx as b$, type OngoingHandle as b0, type OngoingInvoker as b1, type OngoingOverlay as b2, type OpenKeymap as b3, type OpenMenu as b4, type OverlayRole as b5, type OverlaySchema as b6, type OwnedMenuDef as b7, PREDICATE_TARGET as b8, type PendingLongPress as b9, type ToolEntry as bA, type ToolKeybinding as bB, type ToolModifiers as bC, type ToolOffhandBindingSpec as bD, type ToolPresentation as bE, type ToolScopes as bF, type ToolSet as bG, type ToolSlot as bH, type TraceLogEntry as bI, type TraceRing as bJ, type TunedBinding as bK, type UiOngoingControl as bL, type ViewportGestureKind as bM, type WalkStep as bN, actionBindings as bO, actionCursor as bP, actionItemTitle as bQ, actionItems as bR, actionSettingsParams as bS, actionShortcuts as bT, actionsTagged as bU, admitIngestMime as bV, assembleEntries as bW, bindingId as bX, browserReservedChord as bY, buildDepsFromRequires as bZ, buildRouteRegistry as b_, type PlacedBy as ba, type Point2 as bb, type PointerSession as bc, type PointerSessionCallbacks as bd, type PointerSessionCancelReason as be, type PointerSessionOptions as bf, type RankedCandidate as bg, type RecordCandidate as bh, type RegistryEntry as bi, type ReservedChord as bj, type ResizeAnchor as bk, type ResolveAllOptions as bl, type ResolveOnlyResult as bm, type ResolvedBindingOverrides as bn, type ResolvedCandidate as bo, type RoleKeys as bp, type RoleRebinds as bq, type Rule as br, type ScopedBinding as bs, type ScratchKey as bt, type ScratchStore as bu, type SelectionApi as bv, type Selector as bw, type SpecificityPart as bx, TOOL_OFFHAND_ID as by, type ToolDef as bz, type ActionDeps as c, multiTouchGestureId as c$, buildToolOffhandBindings as c0, captureGesture as c1, captureKey as c2, clientToCanvas as c3, clientToCanvasRect as c4, createDepRegistry as c5, createDispatchTrace as c6, createDispatcher as c7, createKeymapStack as c8, createLongPressStore as c9, isSegment as cA, isSelectedBody as cB, isTool as cC, isToolSet as cD, isUnselectedBody as cE, itemTypesFromDataTransfer as cF, itemsFromClipboardData as cG, itemsFromDataTransfer as cH, itemsFromFiles as cI, keySpecShortcut as cJ, keymapContribution as cK, keymapLeaderBindingId as cL, keymapLeaderId as cM, keymapShortcuts as cN, keysHeld as cO, liveScope as cP, makeToolOffhandAction as cQ, matchActionItem as cR, matchBest as cS, matchSorted as cT, matchSortedWithBarred as cU, matchesKeyBinding as cV, mergeContributions as cW, mergeMenuDefs as cX, modeShortcutSpec as cY, modeShortcuts as cZ, modifierStateOf as c_, createMenuHost as ca, createTraceRing as cb, defineTool as cc, deleteScratch as cd, describeKeymap as ce, describeRule as cf, dlog as cg, dwarn as ch, evaluate as ci, evaluateActive as cj, evaluateEnabled as ck, findConflicts as cl, getScratch as cm, heldKeySpec as cn, historyKey as co, isAnchor as cp, isAnchorOrControl as cq, isBalanceGrip as cr, isBody as cs, isControlHandle as ct, isCornerWidget as cu, isDebugEnabled as cv, isEmpty as cw, isPathEditPart as cx, isResizeHandle as cy, isRotateHandle as cz, type ActionsRegistry as d, offhandKeyFor as d0, openPointerSession as d1, overlaysOf as d2, overriddenBindings as d3, pickMenu as d4, pointerGestureId as d5, readActionSettings as d6, reportRouteConflicts as d7, resolveBindingOverrides as d8, resolveDeviceProfile as d9, resolveMenu as da, resolveParams as db, resolveSchemaMenu as dc, roleReader as dd, routesForSpec as de, ruleCanHoldIn as df, rulesExclusive as dg, scopeBindings as dh, scratchKey as di, setScratch as dj, startCarry as dk, taggedActionItems as dl, targetConsultsAffordance as dm, toolIdsOf as dn, toolSet as dp, toolSetHas as dq, tuneAction as dr, validateActionDefaultBinding as ds, validateActionId as dt, withoutTools as du, ActionDisabledReason as e, type ActionVariant as f, type MenuDef as g, DepNode as h, type KernelOverlay as i, type Tool as j, ActiveToolContextProvider as k, ActiveToolContextProviderIfRoot as l, type ActiveToolContextProviderProps as m, type ActiveToolContextValue as n, useOptionalActiveToolContext as o, type Dispatcher as p, type AffordanceHit as q, type DispatchTrace as r, type DepSchema as s, ALWAYS as t, useActiveToolContext as u, type ActionDispatch as v, type ActionEnabledResult as w, type ActionEntry as x, type ActionItem as y, type ActionParamSchema as z };
3810
+ export { type BindingOverrides as $, type Action as A, type BoundGesture as B, type Contribution as C, type DepRegistry as D, type ActionParams as E, type ActionPresentation as F, type ActionSettings as G, type ActionSettingsState as H, type ActionShortcut as I, type ActionSource as J, type KeymapDescription as K, type LongPressOptions as L, type MenuHost as M, type NodeId as N, type OverlayPosition as O, type ActionTuning as P, type ActionTunings as Q, type RuleCtx as R, ScopeNode as S, ToolNode as T, type ActionUnavailable as U, type ActionsProp as V, type WorldPoint as W, type AnyTool as X, type AssemblyInputs as Y, BROWSER_RESERVED_CHORDS as Z, type BindingOpts as _, type DepName as a, type ModeSwitchLogEntry as a$, type BindingScope as a0, type BindingSource as a1, type BodyPredicate as a2, type Bounds as a3, type BuildRuleCtxArgs as a4, COARSE_TARGET_SCALE as a5, type CaptureGestureOptions as a6, type CaptureKeyOptions as a7, type CaptureKind as a8, type CapturedSpec as a9, type HandleKind as aA, type HitShape as aB, type HotkeyTrigger as aC, INGEST_STRING_MIMES as aD, type ImmediateInvoker as aE, type ImmediateParams as aF, type InvocationCtx as aG, type Invoker as aH, KEYMAP_HOLD as aI, type KeyBinding as aJ, type KeyReach as aK, type KeymapDef as aL, type KeymapRow as aM, type KeymapStack as aN, type KeymapUnbound as aO, type KeymapVerdict as aP, type LongPressState as aQ, type LongPressStore as aR, type MatchOutcome as aS, type MatchResult as aT, type MenuAccess as aU, type MenuCustomAt as aV, type MenuHit as aW, type MenuOpenRequest as aX, type MenuSources as aY, type MenuWhen as aZ, type ModeShortcutHandlers as a_, type Carried as aa, type Carry as ab, type CarryCallbacks as ac, type CarryPayload as ad, type CarryPointer as ae, type CarryStage as af, type Condition as ag, type Conflict as ah, type ContributionChrome as ai, type ContributionDeps as aj, type ContributionRouting as ak, DEFAULT_ALLOWED_CAPABILITIES as al, DEFAULT_DEVICE_PROFILE as am, type DebugSink as an, type DepListing as ao, type DetectedDeviceFacts as ap, type DeviceProfile as aq, type DispatchRecord as ar, type DispatchRecordInput as as, type DispatcherContext as at, type DragSample as au, type DroppedCandidate as av, type Eligibility as aw, type EligibilityState as ax, type GestureBinding as ay, type GestureKitSettings as az, type DepSource as b, assembleEntries as b$, type ModifierRole as b0, type ModifierRoles as b1, type ModifierState as b2, NEVER as b3, type OngoingHandle as b4, type OngoingInvoker as b5, type OngoingOverlay as b6, type OpenKeymap as b7, type OpenMenu as b8, type OverlayRole as b9, type SelectionApi as bA, type Selector as bB, type SpecificityPart as bC, TOOL_OFFHAND_ID as bD, type ToolDef as bE, type ToolEntry as bF, type ToolKeybinding as bG, type ToolModifiers as bH, type ToolOffhandBindingSpec as bI, type ToolPresentation as bJ, type ToolScopes as bK, type ToolSet as bL, type ToolSlot as bM, type TraceLogEntry as bN, type TraceRing as bO, type TunedBinding as bP, type UiOngoingControl as bQ, type ViewportGestureKind as bR, type WalkStep as bS, actionBindings as bT, actionCursor as bU, actionItemTitle as bV, actionItems as bW, actionSettingsParams as bX, actionShortcuts as bY, actionsTagged as bZ, admitIngestMime as b_, type OverlaySchema as ba, type OwnedMenuDef as bb, PREDICATE_TARGET as bc, type PendingIngestItem as bd, type PendingLongPress as be, type PlacedBy as bf, type Point2 as bg, type PointerSession as bh, type PointerSessionCallbacks as bi, type PointerSessionCancelReason as bj, type PointerSessionOptions as bk, type RankedCandidate as bl, type RecordCandidate as bm, type RegistryEntry as bn, type ReservedChord as bo, type ResizeAnchor as bp, type ResolveAllOptions as bq, type ResolveOnlyResult as br, type ResolvedBindingOverrides as bs, type ResolvedCandidate as bt, type RoleKeys as bu, type RoleRebinds as bv, type Rule as bw, type ScopedBinding as bx, type ScratchKey as by, type ScratchStore as bz, type ActionDeps as c, matchSortedWithBarred as c$, bindingId as c0, browserReservedChord as c1, buildDepsFromRequires as c2, buildRouteRegistry as c3, buildRuleCtx as c4, buildToolOffhandBindings as c5, captureGesture as c6, captureKey as c7, clientToCanvas as c8, clientToCanvasRect as c9, isControlHandle as cA, isCornerWidget as cB, isDebugEnabled as cC, isEmpty as cD, isPathEditPart as cE, isResizeHandle as cF, isRotateHandle as cG, isSegment as cH, isSelectedBody as cI, isTool as cJ, isToolSet as cK, isUnselectedBody as cL, itemTypesFromDataTransfer as cM, itemsFromClipboardData as cN, itemsFromDataTransfer as cO, itemsFromFiles as cP, keySpecShortcut as cQ, keymapContribution as cR, keymapLeaderBindingId as cS, keymapLeaderId as cT, keymapShortcuts as cU, keysHeld as cV, liveScope as cW, makeToolOffhandAction as cX, matchActionItem as cY, matchBest as cZ, matchSorted as c_, createDepRegistry as ca, createDispatchTrace as cb, createDispatcher as cc, createKeymapStack as cd, createLongPressStore as ce, createMenuHost as cf, createTraceRing as cg, defineTool as ch, deleteScratch as ci, describeKeymap as cj, describeRule as ck, dlog as cl, dwarn as cm, evaluate as cn, evaluateActive as co, evaluateEnabled as cp, findConflicts as cq, getScratch as cr, heldKeySpec as cs, historyKey as ct, holdPreview as cu, holdPreviewId as cv, isAnchor as cw, isAnchorOrControl as cx, isBalanceGrip as cy, isBody as cz, type ActionsRegistry as d, matchesKeyBinding as d0, mergeContributions as d1, mergeMenuDefs as d2, modeShortcutSpec as d3, modeShortcuts as d4, modifierStateOf as d5, multiTouchGestureId as d6, offhandKeyFor as d7, openPointerSession as d8, overlaysOf as d9, validateActionDefaultBinding as dA, validateActionId as dB, withoutTools as dC, overriddenBindings as da, pendingKindOf as db, pickMenu as dc, pointerGestureId as dd, readActionSettings as de, reportRouteConflicts as df, resolveBindingOverrides as dg, resolveDeviceProfile as dh, resolveMenu as di, resolveParams as dj, resolveSchemaMenu as dk, roleReader as dl, routesForSpec as dm, ruleCanHoldIn as dn, rulesExclusive as dp, scopeBindings as dq, scratchKey as dr, setScratch as ds, startCarry as dt, taggedActionItems as du, targetConsultsAffordance as dv, toolIdsOf as dw, toolSet as dx, toolSetHas as dy, tuneAction as dz, ActionDisabledReason as e, type ActionVariant as f, type MenuDef as g, DepNode as h, type KernelOverlay as i, type Tool as j, ActiveToolContextProvider as k, ActiveToolContextProviderIfRoot as l, type ActiveToolContextProviderProps as m, type ActiveToolContextValue as n, useOptionalActiveToolContext as o, type Dispatcher as p, type AffordanceHit as q, type DispatchTrace as r, type DepSchema as s, ALWAYS as t, useActiveToolContext as u, type ActionDispatch as v, type ActionEnabledResult as w, type ActionEntry as x, type ActionItem as y, type ActionParamSchema as z };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { t as ALWAYS, A as Action, c as ActionDeps, e as ActionDisabledReason, e as ActionDisabledReasonValue, v as ActionDispatch, w as ActionEnabledResult, x as ActionEntry, y as ActionItem, z as ActionParamSchema, E as ActionParams, F as ActionPresentation, G as ActionSettings, H as ActionSettingsState, I as ActionShortcut, J as ActionSource, P as ActionTuning, Q as ActionTunings, U as ActionUnavailable, f as ActionVariant, V as ActionsProp, d as ActionsRegistry, q as AffordanceHit, W as AnyTool, X as AssemblyInputs, Y as BROWSER_RESERVED_CHORDS, Z as BindingOpts, _ as BindingOverrides, $ as BindingScope, a0 as BindingSource, a1 as BodyPredicate, B as BoundGesture, a2 as Bounds, a3 as BuildRuleCtxArgs, a4 as COARSE_TARGET_SCALE, a5 as CaptureGestureOptions, a6 as CaptureKeyOptions, a7 as CaptureKind, a8 as CapturedSpec, a9 as Carried, aa as Carry, ab as CarryCallbacks, ac as CarryPayload, ad as CarryPointer, ae as CarryStage, af as Condition, ag as Conflict, C as Contribution, ah as ContributionChrome, ai as ContributionDeps, aj as ContributionRouting, ak as DEFAULT_ALLOWED_CAPABILITIES, al as DEFAULT_DEVICE_PROFILE, am as DebugSink, an as DepListing, a as DepName, D as DepRegistry, s as DepSchema, b as DepSource, ao as DetectedDeviceFacts, ap as DeviceProfile, aq as DispatchRecord, ar as DispatchRecordInput, r as DispatchTrace, p as Dispatcher, as as DispatcherContext, at as DragSample, au as DroppedCandidate, av as Eligibility, aw as EligibilityState, ax as GestureBinding, ay as GestureKitSettings, az as HandleKind, aA as HitShape, aB as HotkeyTrigger, aC as INGEST_STRING_MIMES, aD as ImmediateInvoker, aE as InvocationCtx, aF as Invoker, aG as KEYMAP_HOLD, i as KernelOverlay, aH as KeyBinding, aI as KeyReach, aJ as KeymapDef, K as KeymapDescription, aK as KeymapRow, aL as KeymapStack, aM as KeymapUnbound, aN as KeymapVerdict, L as LongPressOptions, aO as LongPressState, aP as LongPressStore, aQ as MatchOutcome, aR as MatchResult, g as MenuDef, aS as MenuHit, M as MenuHost, aT as MenuOpenRequest, aU as MenuSources, aV as MenuWhen, aW as ModeShortcutHandlers, aX as ModeSwitchLogEntry, aY as ModifierRole, aZ as ModifierRoles, a_ as ModifierState, a$ as NEVER, N as NodeId, b0 as OngoingHandle, b1 as OngoingInvoker, b2 as OngoingOverlay, b3 as OpenKeymap, b4 as OpenMenu, O as OverlayPosition, b5 as OverlayRole, b6 as OverlaySchema, b7 as OwnedMenuDef, b8 as PREDICATE_TARGET, b9 as PendingLongPress, ba as PlacedBy, bb as Point2, bc as PointerSession, bd as PointerSessionCallbacks, be as PointerSessionCancelReason, bf as PointerSessionOptions, bg as RankedCandidate, bh as RecordCandidate, bi as RegistryEntry, bj as ReservedChord, bk as ResizeAnchor, bl as ResolveAllOptions, bm as ResolveOnlyResult, bn as ResolvedBindingOverrides, bo as ResolvedCandidate, bp as RoleKeys, bq as RoleRebinds, br as Rule, R as RuleCtx, bs as ScopedBinding, bt as ScratchKey, bu as ScratchStore, bv as SelectionApi, bw as Selector, bx as SpecificityPart, by as TOOL_OFFHAND_ID, j as Tool, bz as ToolDef, bA as ToolEntry, bB as ToolKeybinding, bC as ToolModifiers, bD as ToolOffhandBindingSpec, bE as ToolPresentation, bF as ToolScopes, bG as ToolSet, bH as ToolSlot, bI as TraceLogEntry, bJ as TraceRing, bK as TunedBinding, bL as UiOngoingControl, bM as ViewportGestureKind, bN as WalkStep, bO as actionBindings, bP as actionCursor, bQ as actionItemTitle, bR as actionItems, bS as actionSettingsParams, bT as actionShortcuts, bU as actionsTagged, bV as admitIngestMime, bW as assembleEntries, bX as bindingId, bY as browserReservedChord, bZ as buildDepsFromRequires, b_ as buildRouteRegistry, b$ as buildRuleCtx, c0 as buildToolOffhandBindings, c1 as captureGesture, c2 as captureKey, c3 as clientToCanvas, c4 as clientToCanvasRect, c5 as createDepRegistry, c6 as createDispatchTrace, c7 as createDispatcher, c8 as createKeymapStack, c9 as createLongPressStore, ca as createMenuHost, cb as createTraceRing, cc as defineTool, cd as deleteScratch, ce as describeKeymap, cf as describeRule, cg as dlog, ch as dwarn, ci as evaluate, cj as evaluateActive, ck as evaluateEnabled, cl as findConflicts, cm as getScratch, cn as heldKeySpec, co as historyKey, cp as isAnchor, cq as isAnchorOrControl, cr as isBalanceGrip, cs as isBody, ct as isControlHandle, cu as isCornerWidget, cv as isDebugEnabled, cw as isEmpty, cx as isPathEditPart, cy as isResizeHandle, cz as isRotateHandle, cA as isSegment, cB as isSelectedBody, cC as isTool, cD as isToolSet, cE as isUnselectedBody, cF as itemTypesFromDataTransfer, cG as itemsFromClipboardData, cH as itemsFromDataTransfer, cI as itemsFromFiles, cJ as keySpecShortcut, cK as keymapContribution, cL as keymapLeaderBindingId, cM as keymapLeaderId, cN as keymapShortcuts, cO as keysHeld, cP as liveScope, cQ as makeToolOffhandAction, cR as matchActionItem, cS as matchBest, cT as matchSorted, cU as matchSortedWithBarred, cV as matchesKeyBinding, cW as mergeContributions, cX as mergeMenuDefs, cY as modeShortcutSpec, cZ as modeShortcuts, c_ as modifierStateOf, c$ as multiTouchGestureId, d0 as offhandKeyFor, d1 as openPointerSession, d2 as overlaysOf, d3 as overriddenBindings, d4 as pickMenu, d5 as pointerGestureId, d6 as readActionSettings, d7 as reportRouteConflicts, d8 as resolveBindingOverrides, d9 as resolveDeviceProfile, da as resolveMenu, db as resolveParams, dc as resolveSchemaMenu, dd as roleReader, de as routesForSpec, df as ruleCanHoldIn, dg as rulesExclusive, dh as scopeBindings, di as scratchKey, dj as setScratch, dk as startCarry, dl as taggedActionItems, dm as targetConsultsAffordance, dn as toolIdsOf, dp as toolSet, dq as toolSetHas, dr as tuneAction, ds as validateActionDefaultBinding, dt as validateActionId, du as withoutTools } from './index-UFm_a202.js';
1
+ export { t as ALWAYS, A as Action, c as ActionDeps, e as ActionDisabledReason, e as ActionDisabledReasonValue, v as ActionDispatch, w as ActionEnabledResult, x as ActionEntry, y as ActionItem, z as ActionParamSchema, E as ActionParams, F as ActionPresentation, G as ActionSettings, H as ActionSettingsState, I as ActionShortcut, J as ActionSource, P as ActionTuning, Q as ActionTunings, U as ActionUnavailable, f as ActionVariant, V as ActionsProp, d as ActionsRegistry, q as AffordanceHit, X as AnyTool, Y as AssemblyInputs, Z as BROWSER_RESERVED_CHORDS, _ as BindingOpts, $ as BindingOverrides, a0 as BindingScope, a1 as BindingSource, a2 as BodyPredicate, B as BoundGesture, a3 as Bounds, a4 as BuildRuleCtxArgs, a5 as COARSE_TARGET_SCALE, a6 as CaptureGestureOptions, a7 as CaptureKeyOptions, a8 as CaptureKind, a9 as CapturedSpec, aa as Carried, ab as Carry, ac as CarryCallbacks, ad as CarryPayload, ae as CarryPointer, af as CarryStage, ag as Condition, ah as Conflict, C as Contribution, ai as ContributionChrome, aj as ContributionDeps, ak as ContributionRouting, al as DEFAULT_ALLOWED_CAPABILITIES, am as DEFAULT_DEVICE_PROFILE, an as DebugSink, ao as DepListing, a as DepName, D as DepRegistry, s as DepSchema, b as DepSource, ap as DetectedDeviceFacts, aq as DeviceProfile, ar as DispatchRecord, as as DispatchRecordInput, r as DispatchTrace, p as Dispatcher, at as DispatcherContext, au as DragSample, av as DroppedCandidate, aw as Eligibility, ax as EligibilityState, ay as GestureBinding, az as GestureKitSettings, aA as HandleKind, aB as HitShape, aC as HotkeyTrigger, aD as INGEST_STRING_MIMES, aE as ImmediateInvoker, aF as ImmediateParams, aG as InvocationCtx, aH as Invoker, aI as KEYMAP_HOLD, i as KernelOverlay, aJ as KeyBinding, aK as KeyReach, aL as KeymapDef, K as KeymapDescription, aM as KeymapRow, aN as KeymapStack, aO as KeymapUnbound, aP as KeymapVerdict, L as LongPressOptions, aQ as LongPressState, aR as LongPressStore, aS as MatchOutcome, aT as MatchResult, aU as MenuAccess, aV as MenuCustomAt, g as MenuDef, aW as MenuHit, M as MenuHost, aX as MenuOpenRequest, aY as MenuSources, aZ as MenuWhen, a_ as ModeShortcutHandlers, a$ as ModeSwitchLogEntry, b0 as ModifierRole, b1 as ModifierRoles, b2 as ModifierState, b3 as NEVER, N as NodeId, b4 as OngoingHandle, b5 as OngoingInvoker, b6 as OngoingOverlay, b7 as OpenKeymap, b8 as OpenMenu, O as OverlayPosition, b9 as OverlayRole, ba as OverlaySchema, bb as OwnedMenuDef, bc as PREDICATE_TARGET, bd as PendingIngestItem, be as PendingLongPress, bf as PlacedBy, bg as Point2, bh as PointerSession, bi as PointerSessionCallbacks, bj as PointerSessionCancelReason, bk as PointerSessionOptions, bl as RankedCandidate, bm as RecordCandidate, bn as RegistryEntry, bo as ReservedChord, bp as ResizeAnchor, bq as ResolveAllOptions, br as ResolveOnlyResult, bs as ResolvedBindingOverrides, bt as ResolvedCandidate, bu as RoleKeys, bv as RoleRebinds, bw as Rule, R as RuleCtx, bx as ScopedBinding, by as ScratchKey, bz as ScratchStore, bA as SelectionApi, bB as Selector, bC as SpecificityPart, bD as TOOL_OFFHAND_ID, j as Tool, bE as ToolDef, bF as ToolEntry, bG as ToolKeybinding, bH as ToolModifiers, bI as ToolOffhandBindingSpec, bJ as ToolPresentation, bK as ToolScopes, bL as ToolSet, bM as ToolSlot, bN as TraceLogEntry, bO as TraceRing, bP as TunedBinding, bQ as UiOngoingControl, bR as ViewportGestureKind, bS as WalkStep, W as WorldPoint, bT as actionBindings, bU as actionCursor, bV as actionItemTitle, bW as actionItems, bX as actionSettingsParams, bY as actionShortcuts, bZ as actionsTagged, b_ as admitIngestMime, b$ as assembleEntries, c0 as bindingId, c1 as browserReservedChord, c2 as buildDepsFromRequires, c3 as buildRouteRegistry, c4 as buildRuleCtx, c5 as buildToolOffhandBindings, c6 as captureGesture, c7 as captureKey, c8 as clientToCanvas, c9 as clientToCanvasRect, ca as createDepRegistry, cb as createDispatchTrace, cc as createDispatcher, cd as createKeymapStack, ce as createLongPressStore, cf as createMenuHost, cg as createTraceRing, ch as defineTool, ci as deleteScratch, cj as describeKeymap, ck as describeRule, cl as dlog, cm as dwarn, cn as evaluate, co as evaluateActive, cp as evaluateEnabled, cq as findConflicts, cr as getScratch, cs as heldKeySpec, ct as historyKey, cu as holdPreview, cv as holdPreviewId, cw as isAnchor, cx as isAnchorOrControl, cy as isBalanceGrip, cz as isBody, cA as isControlHandle, cB as isCornerWidget, cC as isDebugEnabled, cD as isEmpty, cE as isPathEditPart, cF as isResizeHandle, cG as isRotateHandle, cH as isSegment, cI as isSelectedBody, cJ as isTool, cK as isToolSet, cL as isUnselectedBody, cM as itemTypesFromDataTransfer, cN as itemsFromClipboardData, cO as itemsFromDataTransfer, cP as itemsFromFiles, cQ as keySpecShortcut, cR as keymapContribution, cS as keymapLeaderBindingId, cT as keymapLeaderId, cU as keymapShortcuts, cV as keysHeld, cW as liveScope, cX as makeToolOffhandAction, cY as matchActionItem, cZ as matchBest, c_ as matchSorted, c$ as matchSortedWithBarred, d0 as matchesKeyBinding, d1 as mergeContributions, d2 as mergeMenuDefs, d3 as modeShortcutSpec, d4 as modeShortcuts, d5 as modifierStateOf, d6 as multiTouchGestureId, d7 as offhandKeyFor, d8 as openPointerSession, d9 as overlaysOf, da as overriddenBindings, db as pendingKindOf, dc as pickMenu, dd as pointerGestureId, de as readActionSettings, df as reportRouteConflicts, dg as resolveBindingOverrides, dh as resolveDeviceProfile, di as resolveMenu, dj as resolveParams, dk as resolveSchemaMenu, dl as roleReader, dm as routesForSpec, dn as ruleCanHoldIn, dp as rulesExclusive, dq as scopeBindings, dr as scratchKey, ds as setScratch, dt as startCarry, du as taggedActionItems, dv as targetConsultsAffordance, dw as toolIdsOf, dx as toolSet, dy as toolSetHas, dz as tuneAction, dA as validateActionDefaultBinding, dB as validateActionId, dC as withoutTools } from './index-DJ7SxEKS.js';
2
2
  export { CONTROL_SELECTOR, ChannelRef, DRAG_THRESHOLD_PX, DescribeRouteOptions, GESTURE_DESCRIPTORS, GestureArgSpec, GestureDescriptor, GestureName, IngestItem, InputEvent, LONG_PRESS_MS, ModRequirement, ModifierKey, ParsedModifiers, ParsedRoute, PhaseAtom, PhaseContext, RESERVED_ID_NAMES, RESERVED_ID_PREFIXES, ROUTE_FIELD_DEFINITIONS, ROUTE_TERMS, RouteDescriptionPart, RouteFieldName, RouteTermLabel, activatesFocusedControl, canonicalModifiers, collapseShiftPairs, describeRoute, describeRouteParts, focusedControlOwnsKey, formatPhaseAtom, formatRoute, getGestureDescriptor, isEditableTarget, isInControlWithin, isKnownGestureName, matchKey, matchModifiers, matchPhase, matchSpec, matchTarget, parseRoute, pastDragThreshold, routeGestureForSpecKind, specKindForRouteGesture, specificity } from '@weasel-js/gestures';
3
3
  export { SelectionExtendKey, SelectionMode } from '@weasel-js/select';
4
4
  export { View } from '@weasel-js/geom';
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
- import { actionItems, actionItemTitle, ActionDisabledReason } from './chunk-XVWEZTUX.js';
2
- export { ALWAYS, ActionDisabledReason, COARSE_TARGET_SCALE, DEFAULT_ALLOWED_CAPABILITIES, DEFAULT_DEVICE_PROFILE, GESTURE_DESCRIPTORS, INGEST_STRING_MIMES, KEYMAP_HOLD, LONG_PRESS_MS, NEVER, PREDICATE_TARGET, RESERVED_ID_NAMES, RESERVED_ID_PREFIXES, ROUTE_FIELD_DEFINITIONS, ROUTE_TERMS, TOOL_OFFHAND_ID, actionBindings, actionCursor, actionItemTitle, actionItems, actionSettingsParams, actionShortcuts, activatesFocusedControl, admitIngestMime, assembleEntries, bindingId, buildDepsFromRequires, buildRouteRegistry, buildRuleCtx, buildToolOffhandBindings, canonicalModifiers, clientToCanvas, clientToCanvasRect, collapseShiftPairs, createDepRegistry, createDispatchTrace, createDispatcher, createKeymapStack, createLongPressStore, createMenuHost, createTraceRing, describeKeymap, describeRoute, describeRouteParts, describeRule, dlog, dwarn, evaluate, evaluateActive, evaluateEnabled, findConflicts, focusedControlOwnsKey, formatPhaseAtom, formatRoute, getGestureDescriptor, heldKeySpec, historyKey, isDebugEnabled, isEditableTarget, isKnownGestureName, isTool, itemTypesFromDataTransfer, itemsFromClipboardData, itemsFromDataTransfer, itemsFromFiles, keySpecShortcut, keymapContribution, keymapLeaderBindingId, keymapLeaderId, keymapShortcuts, keysHeld, liveScope, makeToolOffhandAction, matchBest, matchKey, matchModifiers, matchPhase, matchSorted, matchSortedWithBarred, matchSpec, matchTarget, matchesKeyBinding, mergeMenuDefs, modifierStateOf, multiTouchGestureId, offhandKeyFor, openPointerSession, overriddenBindings, parseRoute, pickMenu, pointerGestureId, readActionSettings, reportRouteConflicts, resolveBindingOverrides, resolveDeviceProfile, resolveMenu, resolveParams, resolveSchemaMenu, roleReader, routeGestureForSpecKind, routesForSpec, ruleCanHoldIn, rulesExclusive, scopeBindings, specKindForRouteGesture, specificity, startCarry, targetConsultsAffordance, tuneAction, validateActionDefaultBinding, validateActionId } from './chunk-XVWEZTUX.js';
1
+ export { ALWAYS, COARSE_TARGET_SCALE, DEFAULT_ALLOWED_CAPABILITIES, DEFAULT_DEVICE_PROFILE, GESTURE_DESCRIPTORS, INGEST_STRING_MIMES, KEYMAP_HOLD, LONG_PRESS_MS, NEVER, PREDICATE_TARGET, TOOL_OFFHAND_ID, activatesFocusedControl, admitIngestMime, assembleEntries, buildRouteRegistry, buildRuleCtx, buildToolOffhandBindings, clientToCanvas, clientToCanvasRect, createDispatchTrace, createDispatcher, createKeymapStack, createLongPressStore, createTraceRing, describeKeymap, describeRule, dlog, dwarn, evaluate, findConflicts, focusedControlOwnsKey, getGestureDescriptor, heldKeySpec, historyKey, isDebugEnabled, isEditableTarget, isKnownGestureName, isTool, itemTypesFromDataTransfer, itemsFromClipboardData, itemsFromDataTransfer, itemsFromFiles, keymapContribution, keymapLeaderBindingId, keymapLeaderId, keymapShortcuts, liveScope, makeToolOffhandAction, matchBest, matchKey, matchModifiers, matchPhase, matchSorted, matchSortedWithBarred, matchSpec, matchTarget, matchesKeyBinding, modifierStateOf, multiTouchGestureId, offhandKeyFor, openPointerSession, pendingKindOf, pointerGestureId, reportRouteConflicts, resolveDeviceProfile, routeGestureForSpecKind, routesForSpec, ruleCanHoldIn, rulesExclusive, scopeBindings, specKindForRouteGesture, specificity, startCarry, targetConsultsAffordance } from './chunk-HR5F4LBX.js';
2
+ import { actionItems, actionItemTitle, resolveParams, ActionDisabledReason } from './chunk-EUCNVGJV.js';
3
+ export { ActionDisabledReason, RESERVED_ID_NAMES, RESERVED_ID_PREFIXES, ROUTE_FIELD_DEFINITIONS, ROUTE_TERMS, actionBindings, actionCursor, actionItemTitle, actionItems, actionSettingsParams, actionShortcuts, bindingId, buildDepsFromRequires, canonicalModifiers, collapseShiftPairs, createDepRegistry, createMenuHost, describeRoute, describeRouteParts, evaluateActive, evaluateEnabled, formatPhaseAtom, formatRoute, keySpecShortcut, keysHeld, mergeMenuDefs, overriddenBindings, parseRoute, pickMenu, readActionSettings, resolveBindingOverrides, resolveMenu, resolveParams, resolveSchemaMenu, roleReader, tuneAction, validateActionDefaultBinding, validateActionId } from './chunk-EUCNVGJV.js';
3
4
  import { hasTag, matchQuery } from '@weasel-js/registry';
4
5
  import { bodyPredicate, hitPredicate, key, isApplePlatform, createPointerRecognizer, RESERVED_ID_PREFIXES, RESERVED_ID_NAMES, DOUBLE_CLICK_MAX_MS } from '@weasel-js/gestures';
5
6
  export { CONTROL_SELECTOR, DRAG_THRESHOLD_PX, isInControlWithin, pastDragThreshold } from '@weasel-js/gestures';
@@ -15,6 +16,33 @@ function matchActionItem(item, query) {
15
16
  return matchQuery(query, { text: [actionItemTitle(item)], tags: item.tags });
16
17
  }
17
18
 
19
+ // src/interactions/actions/holdPreview.ts
20
+ var holdPreviewId = (id) => `${id}.hold`;
21
+ function holdPreview(action) {
22
+ const { invoker } = action;
23
+ return {
24
+ id: holdPreviewId(action.id),
25
+ label: action.label,
26
+ ...action.requires ? { requires: action.requires } : {},
27
+ ...action.enabled ? { enabled: action.enabled } : {},
28
+ ...action.eligible ? { eligible: action.eligible } : {},
29
+ invoker: {
30
+ timing: "ongoing",
31
+ start: (ctx, opts) => {
32
+ const params = resolveParams(opts?.params);
33
+ const hide = action.preview?.(ctx.deps, params);
34
+ return {
35
+ // An end's ctx carries no deps, so the run takes the press's.
36
+ onEnd: (_end, reason) => {
37
+ hide?.();
38
+ if (reason === "commit" && invoker?.timing === "immediate") invoker.run(ctx.deps, params);
39
+ }
40
+ };
41
+ }
42
+ }
43
+ };
44
+ }
45
+
18
46
  // src/interactions/actions/overlay.ts
19
47
  function overlaysOf(handle) {
20
48
  const ov = handle.overlay?.();
@@ -445,6 +473,6 @@ function deleteScratch(store, key2) {
445
473
  return false;
446
474
  }
447
475
 
448
- export { BROWSER_RESERVED_CHORDS, actionsTagged, browserReservedChord, captureGesture, captureKey, defineTool, deleteScratch, getScratch, isAnchor, isAnchorOrControl, isBalanceGrip, isBody, isControlHandle, isCornerWidget, isEmpty, isPathEditPart, isResizeHandle, isRotateHandle, isSegment, isSelectedBody, isToolSet, isUnselectedBody, matchActionItem, mergeContributions, modeShortcutSpec, modeShortcuts, overlaysOf, scratchKey, setScratch, taggedActionItems, toolIdsOf, toolSet, toolSetHas, withoutTools };
476
+ export { BROWSER_RESERVED_CHORDS, actionsTagged, browserReservedChord, captureGesture, captureKey, defineTool, deleteScratch, getScratch, holdPreview, holdPreviewId, isAnchor, isAnchorOrControl, isBalanceGrip, isBody, isControlHandle, isCornerWidget, isEmpty, isPathEditPart, isResizeHandle, isRotateHandle, isSegment, isSelectedBody, isToolSet, isUnselectedBody, matchActionItem, mergeContributions, modeShortcutSpec, modeShortcuts, overlaysOf, scratchKey, setScratch, taggedActionItems, toolIdsOf, toolSet, toolSetHas, withoutTools };
449
477
  //# sourceMappingURL=index.js.map
450
478
  //# sourceMappingURL=index.js.map