@weasel-js/routing 1.15.0 → 1.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-3SPPC6UP.js → chunk-3R7IGCAY.js} +14 -8
- package/dist/chunk-3R7IGCAY.js.map +1 -0
- package/dist/{chunk-ZK72IBMI.js → chunk-HCO42UVG.js} +22 -22
- package/dist/chunk-HCO42UVG.js.map +1 -0
- package/dist/{chunk-A6MN3I6R.js → chunk-TTIRQ4BV.js} +9 -13
- package/dist/chunk-TTIRQ4BV.js.map +1 -0
- package/dist/{index-C2EcHkCp.d.ts → index-CBxf3Cxm.d.ts} +86 -63
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -14
- package/dist/index.js.map +1 -1
- package/dist/{internal-C8-r3Zmo.d.ts → internal-CqqT2T4V.d.ts} +8 -1
- package/dist/internal.d.ts +2 -2
- package/dist/react.d.ts +7 -5
- package/dist/react.js +16 -8
- package/dist/react.js.map +1 -1
- package/dist/testing/registerAction.d.ts +1 -1
- package/dist/testing/registerAction.js +2 -2
- package/package.json +13 -13
- package/dist/chunk-3SPPC6UP.js.map +0 -1
- package/dist/chunk-A6MN3I6R.js.map +0 -1
- package/dist/chunk-ZK72IBMI.js.map +0 -1
|
@@ -589,6 +589,69 @@ type OngoingOverlay = {
|
|
|
589
589
|
/** A handle's overlays as a list: empty when it has none. */
|
|
590
590
|
declare function overlaysOf(handle: OngoingHandle): readonly OngoingOverlay[];
|
|
591
591
|
|
|
592
|
+
/**
|
|
593
|
+
* The options a gesture binding hands the action it fires, and reading their params.
|
|
594
|
+
*/
|
|
595
|
+
|
|
596
|
+
/** Per-invocation options the dispatcher reads from a `GestureBinding`'s
|
|
597
|
+
* `opts` field and passes to `OngoingInvoker.start`. */
|
|
598
|
+
interface BindingOpts {
|
|
599
|
+
/** The id a binding override names this binding by, `<owner>.<role>`:
|
|
600
|
+
* `undo.key`, `rect.drag`, `nudge.left.big`. Without one it is its owner and
|
|
601
|
+
* its position (`<entry>#<n>`, `<action>@<n>`), which moves when the defaults
|
|
602
|
+
* are reordered, so a binding a host may persist an override for declares one. */
|
|
603
|
+
id?: string;
|
|
604
|
+
/** Gesture behaviors the action's own invoker runs. Routing carries the
|
|
605
|
+
* array to the action and never reads an element, so the element type is
|
|
606
|
+
* open here; `@weasel-js/core` narrows it. */
|
|
607
|
+
behaviors?: unknown[];
|
|
608
|
+
/** Per-binding action parameters, which an immediate invoker reads via the
|
|
609
|
+
* second arg to `run`.
|
|
610
|
+
*
|
|
611
|
+
* May also be a thunk evaluated each time the value is needed, so a tool
|
|
612
|
+
* can close over refs that mutate during a gesture (e.g. polygon `sides`
|
|
613
|
+
* adjusted mid-drag via ArrowUp). An ongoing invoker that wants the latest
|
|
614
|
+
* values at commit re-calls it inside `onEnd` via
|
|
615
|
+
* `resolveParams(opts?.params)`. */
|
|
616
|
+
params?: Record<string, unknown> | (() => Record<string, unknown>);
|
|
617
|
+
/**
|
|
618
|
+
* The views this binding is live in, by id, where `null` is the surface's
|
|
619
|
+
* own camera. Omitted means every view.
|
|
620
|
+
*
|
|
621
|
+
* A binding that names the view an input landed in outranks every binding
|
|
622
|
+
* that does not, whatever their scope tiers: naming a view is the most
|
|
623
|
+
* specific thing a binding can say about where it applies. Without that, a
|
|
624
|
+
* drag bound inside a minimap view loses to the active tool's marquee.
|
|
625
|
+
*/
|
|
626
|
+
views?: readonly (string | null)[];
|
|
627
|
+
/**
|
|
628
|
+
* Says this binding is declared ahead of another on the same input on
|
|
629
|
+
* purpose: its action declines through `enabled()` when the input is not its
|
|
630
|
+
* to take, and the next binding fires. The dispatcher does that for any
|
|
631
|
+
* binding; this tells the route-conflict check the order is the design.
|
|
632
|
+
*/
|
|
633
|
+
yields?: boolean;
|
|
634
|
+
/**
|
|
635
|
+
* For a key binding: live while the pointer is over the surface, whichever
|
|
636
|
+
* canvas holds the keys, and only then. For a key that means "here" — a
|
|
637
|
+
* magnifier's peek — on a page with more than one surface that hears it.
|
|
638
|
+
* A held key follows the pointer: one already down when it arrives presses
|
|
639
|
+
* the binding, and leaving releases it.
|
|
640
|
+
*/
|
|
641
|
+
over?: boolean;
|
|
642
|
+
/**
|
|
643
|
+
* Keys for some of the action's `modifierRoles` on this binding, by role
|
|
644
|
+
* id, over the action's defaults and any tuning's.
|
|
645
|
+
*/
|
|
646
|
+
roles?: RoleRebinds;
|
|
647
|
+
/** Screen travel, in CSS pixels, a drag makes before this binding's ongoing action starts, over the
|
|
648
|
+
* action's own `dragThresholdPx`. See `OngoingInvoker.dragThresholdPx`. */
|
|
649
|
+
dragThresholdPx?: number;
|
|
650
|
+
}
|
|
651
|
+
/** Resolve `BindingOpts.params` to a concrete record (calling the thunk if
|
|
652
|
+
* needed). Returns `undefined` for absent params. */
|
|
653
|
+
declare function resolveParams(params: BindingOpts['params']): Record<string, unknown> | undefined;
|
|
654
|
+
|
|
592
655
|
/**
|
|
593
656
|
* Invoker — pluggable invocation strategy for an Action.
|
|
594
657
|
*
|
|
@@ -779,64 +842,7 @@ interface InvocationCtx {
|
|
|
779
842
|
*/
|
|
780
843
|
roles?: Readonly<Record<string, boolean>>;
|
|
781
844
|
}
|
|
782
|
-
|
|
783
|
-
* `opts` field and passes to `OngoingInvoker.start`. */
|
|
784
|
-
interface BindingOpts {
|
|
785
|
-
/** The id a binding override names this binding by, `<owner>.<role>`:
|
|
786
|
-
* `undo.key`, `rect.drag`, `nudge.left.big`. Without one it is its owner and
|
|
787
|
-
* its position (`<entry>#<n>`, `<action>@<n>`), which moves when the defaults
|
|
788
|
-
* are reordered, so a binding a host may persist an override for declares one. */
|
|
789
|
-
id?: string;
|
|
790
|
-
/** Gesture behaviors the action's own invoker runs. Routing carries the
|
|
791
|
-
* array to the action and never reads an element, so the element type is
|
|
792
|
-
* open here; `@weasel-js/core` narrows it. */
|
|
793
|
-
behaviors?: unknown[];
|
|
794
|
-
/** Per-binding action parameters, which an immediate invoker reads via the
|
|
795
|
-
* second arg to `run`.
|
|
796
|
-
*
|
|
797
|
-
* May also be a thunk evaluated each time the value is needed, so a tool
|
|
798
|
-
* can close over refs that mutate during a gesture (e.g. polygon `sides`
|
|
799
|
-
* adjusted mid-drag via ArrowUp). An ongoing invoker that wants the latest
|
|
800
|
-
* values at commit re-calls it inside `onEnd` via
|
|
801
|
-
* `resolveParams(opts?.params)`. */
|
|
802
|
-
params?: Record<string, unknown> | (() => Record<string, unknown>);
|
|
803
|
-
/**
|
|
804
|
-
* The views this binding is live in, by id, where `null` is the surface's
|
|
805
|
-
* own camera. Omitted means every view.
|
|
806
|
-
*
|
|
807
|
-
* A binding that names the view an input landed in outranks every binding
|
|
808
|
-
* that does not, whatever their scope tiers: naming a view is the most
|
|
809
|
-
* specific thing a binding can say about where it applies. Without that, a
|
|
810
|
-
* drag bound inside a minimap view loses to the active tool's marquee.
|
|
811
|
-
*/
|
|
812
|
-
views?: readonly (string | null)[];
|
|
813
|
-
/**
|
|
814
|
-
* Says this binding is declared ahead of another on the same input on
|
|
815
|
-
* purpose: its action declines through `enabled()` when the input is not its
|
|
816
|
-
* to take, and the next binding fires. The dispatcher does that for any
|
|
817
|
-
* binding; this tells the route-conflict check the order is the design.
|
|
818
|
-
*/
|
|
819
|
-
yields?: boolean;
|
|
820
|
-
/**
|
|
821
|
-
* For a key binding: live while the pointer is over the surface, whichever
|
|
822
|
-
* canvas holds the keys, and only then. For a key that means "here" — a
|
|
823
|
-
* magnifier's peek — on a page with more than one surface that hears it.
|
|
824
|
-
* A held key follows the pointer: one already down when it arrives presses
|
|
825
|
-
* the binding, and leaving releases it.
|
|
826
|
-
*/
|
|
827
|
-
over?: boolean;
|
|
828
|
-
/**
|
|
829
|
-
* Keys for some of the action's `modifierRoles` on this binding, by role
|
|
830
|
-
* id, over the action's defaults and any tuning's.
|
|
831
|
-
*/
|
|
832
|
-
roles?: RoleRebinds;
|
|
833
|
-
/** Screen travel, in CSS pixels, a drag makes before this binding's ongoing action starts, over the
|
|
834
|
-
* action's own `dragThresholdPx`. See {@link OngoingInvoker.dragThresholdPx}. */
|
|
835
|
-
dragThresholdPx?: number;
|
|
836
|
-
}
|
|
837
|
-
/** Resolve `BindingOpts.params` to a concrete record (calling the thunk if
|
|
838
|
-
* needed). Returns `undefined` for absent params. */
|
|
839
|
-
declare function resolveParams(params: BindingOpts['params']): Record<string, unknown> | undefined;
|
|
845
|
+
|
|
840
846
|
/** The deps an action receives, composed per call from what it `requires`.
|
|
841
847
|
* Each name resolves to its {@link DepSchema} entry, and is absent when no
|
|
842
848
|
* source registered it; a name nothing has declared passes through as
|
|
@@ -885,6 +891,13 @@ interface OngoingHandle {
|
|
|
885
891
|
* faithfully leaves it out, and its action gets no panel.
|
|
886
892
|
*/
|
|
887
893
|
replay?(params: Record<string, unknown>): void;
|
|
894
|
+
/**
|
|
895
|
+
* Params this gesture's commit took from what it edited rather than from its binding, read once it has ended:
|
|
896
|
+
* a held warp's own grid and tolerance, say, which the binding's settings do not reach. The last-operation
|
|
897
|
+
* panel shows them over the resolved params, and `replay` is handed them, so a change to one field leaves the
|
|
898
|
+
* rest as the gesture found them.
|
|
899
|
+
*/
|
|
900
|
+
params?(): Readonly<Record<string, unknown>>;
|
|
888
901
|
/**
|
|
889
902
|
* Optional preview surface: the in-flight state the canvas's preview-ghost
|
|
890
903
|
* layer renders on top of the committed scene during the gesture.
|
|
@@ -1314,6 +1327,10 @@ interface ActionTuning<P = Record<string, unknown>> {
|
|
|
1314
1327
|
/** Keys for some of the action's `modifierRoles`, by role id. A binding's
|
|
1315
1328
|
* own `opts.roles` is laid over these. */
|
|
1316
1329
|
roles?: RoleRebinds;
|
|
1330
|
+
/** Told the params the last-operation panel just set for the action, which hold for the rest of the session.
|
|
1331
|
+
* A tuning whose `params` thunk reads a host's store writes the ones it supplies back there, so the store, and
|
|
1332
|
+
* whatever draws it, says what the next run will use rather than overriding it. */
|
|
1333
|
+
keep?(params: Readonly<Record<string, unknown>>): void;
|
|
1317
1334
|
}
|
|
1318
1335
|
/** `action` with each tuning applied in turn, a later one's params over an
|
|
1319
1336
|
* earlier one's. Applying a tuning to a copy it already tuned changes nothing. */
|
|
@@ -1346,7 +1363,8 @@ interface LastOperationStore {
|
|
|
1346
1363
|
* Undo the operation's entry, put back the selection it ran on, and run it again with `patch` laid over its
|
|
1347
1364
|
* values (a gesture is replayed by its handle), keeping the entry that makes in place of the old one: the
|
|
1348
1365
|
* history, or the journal open on it, still holds one entry for it. The merged values become the action's
|
|
1349
|
-
* params for the rest of the session, under any tuning
|
|
1366
|
+
* params for the rest of the session, under any tuning, and each tuning that keeps them is handed them
|
|
1367
|
+
* (`ActionTuning.keep`). Returns whether it ran.
|
|
1350
1368
|
*/
|
|
1351
1369
|
adjust(patch: Readonly<Record<string, unknown>>): boolean;
|
|
1352
1370
|
/** Forget the operation; the scene and the history stay as they are. */
|
|
@@ -1364,6 +1382,8 @@ interface LastOperationHost {
|
|
|
1364
1382
|
paramsOf(id: string, given: Record<string, unknown> | undefined): Record<string, unknown>;
|
|
1365
1383
|
/** Run the action live for `id` here with `params`, as `trigger` would. */
|
|
1366
1384
|
rerun(id: string, params: Record<string, unknown>): void;
|
|
1385
|
+
/** Hand `params`, which a panel change made `id`'s for the session, to each tuning of `id` that keeps them. */
|
|
1386
|
+
keep(id: string, params: Readonly<Record<string, unknown>>): void;
|
|
1367
1387
|
}
|
|
1368
1388
|
/** The store one actions tree keeps at its root. `onSession` is told when an action's session params change. */
|
|
1369
1389
|
declare class LastOperationKeeper implements LastOperationStore {
|
|
@@ -3697,8 +3717,9 @@ interface KeyBinding {
|
|
|
3697
3717
|
*/
|
|
3698
3718
|
key: string | readonly string[];
|
|
3699
3719
|
/**
|
|
3700
|
-
* Require Cmd
|
|
3701
|
-
* `
|
|
3720
|
+
* Require `mod`: Cmd on an Apple platform, Ctrl elsewhere, with the other
|
|
3721
|
+
* key forbidden — `mod` as `@weasel-js/gestures` defines it. Default `false`
|
|
3722
|
+
* (both forbidden).
|
|
3702
3723
|
*/
|
|
3703
3724
|
mod?: boolean;
|
|
3704
3725
|
/** Require Alt. Default `false` (forbidden). */
|
|
@@ -3721,10 +3742,12 @@ interface KeyBinding {
|
|
|
3721
3742
|
* `preventDefault`. Shared by the tool dispatcher (`useKeybindings`) and the
|
|
3722
3743
|
* gesture dispatcher so the rules can't drift.
|
|
3723
3744
|
*/
|
|
3724
|
-
declare function matchesKeyBinding(e:
|
|
3745
|
+
declare function matchesKeyBinding(e: KeyBindingEvent, b: KeyBinding, isMac?: boolean): boolean;
|
|
3746
|
+
/** The fields of a keyboard event {@link matchesKeyBinding} reads, so a React event passes as readily as a DOM one. */
|
|
3747
|
+
type KeyBindingEvent = Pick<KeyboardEvent, 'key' | 'metaKey' | 'ctrlKey' | 'shiftKey' | 'altKey'>;
|
|
3725
3748
|
/** Which history step `e` asks for: Mod+Z undoes, Shift+Mod+Z and Mod+Y redo. `null` for anything else. Takes a
|
|
3726
3749
|
* React keyboard event as readily as a DOM one. */
|
|
3727
|
-
declare function historyKey(e:
|
|
3750
|
+
declare function historyKey(e: KeyBindingEvent, isMac?: boolean): 'undo' | 'redo' | null;
|
|
3728
3751
|
|
|
3729
3752
|
/**
|
|
3730
3753
|
* Key chords a major browser or the desktop under it takes before a page can:
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { x as ALWAYS, A as Action, c as ActionDeps, e as ActionDisabledReason, e as ActionDisabledReasonValue, y as ActionDispatch, z as ActionEnabledResult, E as ActionEntry, F as ActionItem, G as ActionParamSchema, H as ActionParams, I as ActionPresentation, J as ActionSettings, P as ActionSettingsState, Q as ActionShortcut, U as ActionSource, V as ActionTuning, X as ActionTunings, Y as ActionUnavailable, f as ActionVariant, Z as ActionsProp, d as ActionsRegistry, s as AffordanceHit, _ as AnyTool, $ as AssemblyInputs, a0 as BROWSER_RESERVED_CHORDS, a1 as BindingOpts, a2 as BindingOverrides, a3 as BindingScope, a4 as BindingSource, a5 as BodyPredicate, B as BoundGesture, a6 as Bounds, a7 as BuildRuleCtxArgs, a8 as COARSE_TARGET_SCALE, a9 as CaptureGestureOptions, aa as CaptureKeyOptions, ab as CaptureKind, ac as CapturedSpec, ad as Carried, ae as Carry, af as CarryCallbacks, ag as CarryPayload, ah as CarryPointer, ai as CarryStage, aj as Condition, ak as Conflict, C as Contribution, al as ContributionChrome, am as ContributionDeps, an as ContributionRouting, ao as DEFAULT_ALLOWED_CAPABILITIES, ap as DEFAULT_DEVICE_PROFILE, aq as DebugSink, ar as DepListing, a as DepName, D as DepRegistry, w as DepSchema, b as DepSource, as as DetectedDeviceFacts, at as DeviceProfile, au as DispatchRecord, av as DispatchRecordInput, t as DispatchTrace, r as Dispatcher, aw as DispatcherContext, ax as DragSample, ay as DroppedCandidate, az as Eligibility, aA as EligibilityState, aB as GestureBinding, aC as GestureKitSettings, aD as HandleKind, aE as HitShape, aF as HotkeyTrigger, aG as INGEST_STRING_MIMES, aH as ImmediateInvoker, aI as ImmediateParams, aJ as InvocationCtx, aK as Invoker, aL as KEYMAP_HOLD, k as KernelOverlay, aM as KeyBinding, aN as KeyReach, aO as KeymapDef, K as KeymapDescription, aP as KeymapRow, aQ as KeymapStack, aR as KeymapUnbound, aS as KeymapVerdict, h as LastOperation, g as LastOperationStore, v as LongPressOptions, aT as LongPressState, aU as LongPressStore, aV as MatchOutcome, aW as MatchResult, aX as MenuAccess, aY as MenuCustomAt, i as MenuDef, aZ as MenuHit, M as MenuHost, a_ as MenuOpenRequest, a$ as MenuSources, b0 as MenuWhen, b1 as ModeShortcutHandlers, b2 as ModeSwitchLogEntry, b3 as ModifierRole, b4 as ModifierRoles, b5 as ModifierState, b6 as NEVER, N as NodeId, b7 as OngoingHandle, b8 as OngoingInvoker, b9 as OngoingOverlay, ba as OpenKeymap, bb as OpenMenu, O as OverlayPosition, bc as OverlayRole, bd as OverlaySchema, be as OwnedMenuDef, bf as PREDICATE_TARGET, bg as PendingIngestItem, bh as PendingLongPress, bi as PlacedBy, bj as Point2, bk as PointerSession, bl as PointerSessionCallbacks, bm as PointerSessionCancelReason, bn as PointerSessionOptions, bo as RankedCandidate, bp as RecordCandidate, bq as RegistryEntry, br as ReservedChord, bs as ResizeAnchor, bt as ResolveAllOptions, bu as ResolveOnlyResult, bv as ResolvedBindingOverrides, bw as ResolvedCandidate, bx as RoleKeys, by as RoleRebinds, bz as Rule, R as RuleCtx, bA as ScopedBinding, bB as ScratchKey, bC as ScratchStore, bD as SelectionApi, bE as SelectionSnapshotDep, bF as Selector, bG as SpecificityPart, bH as TOOL_OFFHAND_ID, l as Tool, bI as ToolDef, bJ as ToolEntry, bK as ToolKeybinding, bL as ToolModifiers, bM as ToolOffhandBindingSpec, bN as ToolOptionStep, bO as ToolOptionValues, bP as ToolOptions, bQ as ToolPresentation, bR as ToolScopes, bS as ToolSet, bT as ToolSlot, bU as TraceLogEntry, bV as TraceRing, bW as TunedBinding, bX as UiOngoingControl, bY as ViewportGestureKind, bZ as WalkStep, W as WorldPoint, b_ as actionBindings, b$ as actionCursor, c0 as actionItemTitle, c1 as actionItems, c2 as actionSettingsParams, c3 as actionShortcuts, c4 as actionsTagged, c5 as admitIngestMime, c6 as assembleEntries, c7 as bindingId, c8 as browserReservedChord, c9 as buildDepsFromRequires, ca as buildRouteRegistry, cb as buildRuleCtx, cc as buildToolOffhandBindings, cd as captureGesture, ce as captureKey, cf as clientToCanvas, cg as clientToCanvasRect, ch as createDepRegistry, ci as createDispatchTrace, cj as createDispatcher, ck as createKeymapStack, cl as createLongPressStore, cm as createMenuHost, cn as createToolOptionValues, co as createTraceRing, cp as defineTool, cq as deleteScratch, cr as describeKeymap, cs as describeRule, ct as dlog, cu as dwarn, cv as evaluate, cw as evaluateActive, cx as evaluateEnabled, cy as findConflicts, cz as getScratch, cA as heldKeySpec, cB as historyKey, cC as holdPreview, cD as holdPreviewId, cE as isAnchor, cF as isAnchorOrControl, cG as isBalanceGrip, cH as isBody, cI as isControlHandle, cJ as isCornerWidget, cK as isDebugEnabled, cL as isEmpty, cM as isPathEditPart, cN as isResizeHandle, cO as isRotateHandle, cP as isSegment, cQ as isSelectedBody, cR as isTool, cS as isToolSet, cT as isUnselectedBody, cU as itemTypesFromDataTransfer, cV as itemsFromClipboardData, cW as itemsFromDataTransfer, cX as itemsFromFiles, cY as keySpecShortcut, cZ as keymapContribution, c_ as keymapLeaderBindingId, c$ as keymapLeaderId, d0 as keymapShortcuts, d1 as keysHeld, d2 as liveScope, d3 as makeToolOffhandAction, d4 as matchActionItem, d5 as matchBest, d6 as matchSorted, d7 as matchSortedWithBarred, d8 as matchesKeyBinding, d9 as mergeContributions, da as mergeMenuDefs, db as modeShortcutSpec, dc as modeShortcuts, dd as modifierStateOf, de as multiTouchGestureId, df as offhandKeyFor, dg as openPointerSession, dh as overlaysOf, di as overriddenBindings, dj as pendingKindOf, dk as pickMenu, dl as pointerGestureId, dm as readActionSettings, dn as reportRouteConflicts, dp as resolveBindingOverrides, dq as resolveDeviceProfile, dr as resolveMenu, ds as resolveParams, dt as resolveSchemaMenu, du as returnToModeDefault, dv as roleReader, dw as routesForSpec, dx as ruleCanHoldIn, dy as rulesExclusive, dz as scopeBindings, dA as scratchKey, dB as setScratch, dC as startCarry, dD as steppedOption, dE as taggedActionItems, dF as targetConsultsAffordance, dG as toolIdsOf, dH as toolOptionParams, dI as toolOptionSteps, dJ as toolSet, dK as toolSetHas, dL as tuneAction, dM as validateActionDefaultBinding, dN as validateActionId, dO as withoutTools } from './index-
|
|
1
|
+
export { x as ALWAYS, A as Action, c as ActionDeps, e as ActionDisabledReason, e as ActionDisabledReasonValue, y as ActionDispatch, z as ActionEnabledResult, E as ActionEntry, F as ActionItem, G as ActionParamSchema, H as ActionParams, I as ActionPresentation, J as ActionSettings, P as ActionSettingsState, Q as ActionShortcut, U as ActionSource, V as ActionTuning, X as ActionTunings, Y as ActionUnavailable, f as ActionVariant, Z as ActionsProp, d as ActionsRegistry, s as AffordanceHit, _ as AnyTool, $ as AssemblyInputs, a0 as BROWSER_RESERVED_CHORDS, a1 as BindingOpts, a2 as BindingOverrides, a3 as BindingScope, a4 as BindingSource, a5 as BodyPredicate, B as BoundGesture, a6 as Bounds, a7 as BuildRuleCtxArgs, a8 as COARSE_TARGET_SCALE, a9 as CaptureGestureOptions, aa as CaptureKeyOptions, ab as CaptureKind, ac as CapturedSpec, ad as Carried, ae as Carry, af as CarryCallbacks, ag as CarryPayload, ah as CarryPointer, ai as CarryStage, aj as Condition, ak as Conflict, C as Contribution, al as ContributionChrome, am as ContributionDeps, an as ContributionRouting, ao as DEFAULT_ALLOWED_CAPABILITIES, ap as DEFAULT_DEVICE_PROFILE, aq as DebugSink, ar as DepListing, a as DepName, D as DepRegistry, w as DepSchema, b as DepSource, as as DetectedDeviceFacts, at as DeviceProfile, au as DispatchRecord, av as DispatchRecordInput, t as DispatchTrace, r as Dispatcher, aw as DispatcherContext, ax as DragSample, ay as DroppedCandidate, az as Eligibility, aA as EligibilityState, aB as GestureBinding, aC as GestureKitSettings, aD as HandleKind, aE as HitShape, aF as HotkeyTrigger, aG as INGEST_STRING_MIMES, aH as ImmediateInvoker, aI as ImmediateParams, aJ as InvocationCtx, aK as Invoker, aL as KEYMAP_HOLD, k as KernelOverlay, aM as KeyBinding, aN as KeyReach, aO as KeymapDef, K as KeymapDescription, aP as KeymapRow, aQ as KeymapStack, aR as KeymapUnbound, aS as KeymapVerdict, h as LastOperation, g as LastOperationStore, v as LongPressOptions, aT as LongPressState, aU as LongPressStore, aV as MatchOutcome, aW as MatchResult, aX as MenuAccess, aY as MenuCustomAt, i as MenuDef, aZ as MenuHit, M as MenuHost, a_ as MenuOpenRequest, a$ as MenuSources, b0 as MenuWhen, b1 as ModeShortcutHandlers, b2 as ModeSwitchLogEntry, b3 as ModifierRole, b4 as ModifierRoles, b5 as ModifierState, b6 as NEVER, N as NodeId, b7 as OngoingHandle, b8 as OngoingInvoker, b9 as OngoingOverlay, ba as OpenKeymap, bb as OpenMenu, O as OverlayPosition, bc as OverlayRole, bd as OverlaySchema, be as OwnedMenuDef, bf as PREDICATE_TARGET, bg as PendingIngestItem, bh as PendingLongPress, bi as PlacedBy, bj as Point2, bk as PointerSession, bl as PointerSessionCallbacks, bm as PointerSessionCancelReason, bn as PointerSessionOptions, bo as RankedCandidate, bp as RecordCandidate, bq as RegistryEntry, br as ReservedChord, bs as ResizeAnchor, bt as ResolveAllOptions, bu as ResolveOnlyResult, bv as ResolvedBindingOverrides, bw as ResolvedCandidate, bx as RoleKeys, by as RoleRebinds, bz as Rule, R as RuleCtx, bA as ScopedBinding, bB as ScratchKey, bC as ScratchStore, bD as SelectionApi, bE as SelectionSnapshotDep, bF as Selector, bG as SpecificityPart, bH as TOOL_OFFHAND_ID, l as Tool, bI as ToolDef, bJ as ToolEntry, bK as ToolKeybinding, bL as ToolModifiers, bM as ToolOffhandBindingSpec, bN as ToolOptionStep, bO as ToolOptionValues, bP as ToolOptions, bQ as ToolPresentation, bR as ToolScopes, bS as ToolSet, bT as ToolSlot, bU as TraceLogEntry, bV as TraceRing, bW as TunedBinding, bX as UiOngoingControl, bY as ViewportGestureKind, bZ as WalkStep, W as WorldPoint, b_ as actionBindings, b$ as actionCursor, c0 as actionItemTitle, c1 as actionItems, c2 as actionSettingsParams, c3 as actionShortcuts, c4 as actionsTagged, c5 as admitIngestMime, c6 as assembleEntries, c7 as bindingId, c8 as browserReservedChord, c9 as buildDepsFromRequires, ca as buildRouteRegistry, cb as buildRuleCtx, cc as buildToolOffhandBindings, cd as captureGesture, ce as captureKey, cf as clientToCanvas, cg as clientToCanvasRect, ch as createDepRegistry, ci as createDispatchTrace, cj as createDispatcher, ck as createKeymapStack, cl as createLongPressStore, cm as createMenuHost, cn as createToolOptionValues, co as createTraceRing, cp as defineTool, cq as deleteScratch, cr as describeKeymap, cs as describeRule, ct as dlog, cu as dwarn, cv as evaluate, cw as evaluateActive, cx as evaluateEnabled, cy as findConflicts, cz as getScratch, cA as heldKeySpec, cB as historyKey, cC as holdPreview, cD as holdPreviewId, cE as isAnchor, cF as isAnchorOrControl, cG as isBalanceGrip, cH as isBody, cI as isControlHandle, cJ as isCornerWidget, cK as isDebugEnabled, cL as isEmpty, cM as isPathEditPart, cN as isResizeHandle, cO as isRotateHandle, cP as isSegment, cQ as isSelectedBody, cR as isTool, cS as isToolSet, cT as isUnselectedBody, cU as itemTypesFromDataTransfer, cV as itemsFromClipboardData, cW as itemsFromDataTransfer, cX as itemsFromFiles, cY as keySpecShortcut, cZ as keymapContribution, c_ as keymapLeaderBindingId, c$ as keymapLeaderId, d0 as keymapShortcuts, d1 as keysHeld, d2 as liveScope, d3 as makeToolOffhandAction, d4 as matchActionItem, d5 as matchBest, d6 as matchSorted, d7 as matchSortedWithBarred, d8 as matchesKeyBinding, d9 as mergeContributions, da as mergeMenuDefs, db as modeShortcutSpec, dc as modeShortcuts, dd as modifierStateOf, de as multiTouchGestureId, df as offhandKeyFor, dg as openPointerSession, dh as overlaysOf, di as overriddenBindings, dj as pendingKindOf, dk as pickMenu, dl as pointerGestureId, dm as readActionSettings, dn as reportRouteConflicts, dp as resolveBindingOverrides, dq as resolveDeviceProfile, dr as resolveMenu, ds as resolveParams, dt as resolveSchemaMenu, du as returnToModeDefault, dv as roleReader, dw as routesForSpec, dx as ruleCanHoldIn, dy as rulesExclusive, dz as scopeBindings, dA as scratchKey, dB as setScratch, dC as startCarry, dD as steppedOption, dE as taggedActionItems, dF as targetConsultsAffordance, dG as toolIdsOf, dH as toolOptionParams, dI as toolOptionSteps, dJ as toolSet, dK as toolSetHas, dL as tuneAction, dM as validateActionDefaultBinding, dN as validateActionId, dO as withoutTools } from './index-CBxf3Cxm.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,7 +1,7 @@
|
|
|
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-
|
|
2
|
-
import { actionItems, actionItemTitle, resolveParams, ActionDisabledReason } from './chunk-
|
|
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-
|
|
4
|
-
import { hasTag, matchQuery } from '@weasel-js/registry';
|
|
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-HCO42UVG.js';
|
|
2
|
+
import { actionItems, actionItemTitle, resolveParams, ActionDisabledReason } from './chunk-TTIRQ4BV.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-TTIRQ4BV.js';
|
|
4
|
+
import { hasTag, matchQuery, createEmitter } from '@weasel-js/registry';
|
|
5
5
|
import { bodyPredicate, hitPredicate, key, isApplePlatform, createPointerRecognizer, RESERVED_ID_PREFIXES, RESERVED_ID_NAMES, DOUBLE_CLICK_MAX_MS } from '@weasel-js/gestures';
|
|
6
6
|
export { CONTROL_SELECTOR, DRAG_THRESHOLD_PX, isInControlWithin, pastDragThreshold } from '@weasel-js/gestures';
|
|
7
7
|
import { modeLabel } from '@weasel-js/modes';
|
|
@@ -375,24 +375,17 @@ function captureKey(target, opts = {}) {
|
|
|
375
375
|
...opts.apple !== void 0 ? { apple: opts.apple } : {}
|
|
376
376
|
});
|
|
377
377
|
}
|
|
378
|
-
|
|
379
|
-
// src/tools/toolOptions.ts
|
|
380
378
|
var NONE = Object.freeze({});
|
|
381
379
|
function createToolOptionValues() {
|
|
382
380
|
const values = /* @__PURE__ */ new Map();
|
|
383
|
-
const
|
|
381
|
+
const changed = createEmitter();
|
|
384
382
|
return {
|
|
385
383
|
get: (toolId) => values.get(toolId) ?? NONE,
|
|
386
384
|
set(toolId, option, value) {
|
|
387
385
|
values.set(toolId, { ...values.get(toolId), [option]: value });
|
|
388
|
-
|
|
386
|
+
changed.emit();
|
|
389
387
|
},
|
|
390
|
-
subscribe
|
|
391
|
-
listeners.add(listener);
|
|
392
|
-
return () => {
|
|
393
|
-
listeners.delete(listener);
|
|
394
|
-
};
|
|
395
|
-
}
|
|
388
|
+
subscribe: changed.subscribe
|
|
396
389
|
};
|
|
397
390
|
}
|
|
398
391
|
function leafOf(options, option) {
|