@weasel-js/routing 1.5.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 orochi235
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # @weasel-js/routing
2
+
3
+ Binding-to-action routing for the weasel canvas kit: the gesture dispatcher,
4
+ the action registry and invoker, tool and contribution declaration, the
5
+ route grammar's reflection surface, and the eligibility rule algebra.
6
+
7
+ Routing is the part of the kit that decides *which action a gesture runs*. It
8
+ knows nothing about what an action does to a scene — actions themselves, the
9
+ scene graph, the renderer and the concrete dependency interfaces all live in
10
+ `@weasel-js/core`, which consumes this package and re-exports its surface.
11
+
12
+ ## Two entry points
13
+
14
+ - `@weasel-js/routing` — the pure half. No React, no DOM: the dispatcher, the
15
+ matcher, the rule algebra, the action and tool types, the invoker.
16
+ - `@weasel-js/routing/react` — the React seam. `useGestureDispatcher` and the
17
+ providers that feed it (`ActionsProvider`, `DepRegistryProvider`,
18
+ `useTools`, `useContributions`). React is an optional peer.
19
+
20
+ ## The dependency schema
21
+
22
+ `DepSchema` is declared here as an empty interface. Everything that names a
23
+ dependency — `Action.requires`, `DepRegistry.get`, `useDepSource` — is keyed on
24
+ `keyof DepSchema`, so the set of legal names is whatever has been merged into
25
+ it. `@weasel-js/core` merges the kit's own 24 deps; a consumer adds its own the
26
+ same way:
27
+
28
+ ```ts
29
+ declare module '@weasel-js/core' {
30
+ interface DepSchema {
31
+ color: ColorApi;
32
+ }
33
+ }
34
+ ```
35
+
36
+ The augmentation merges through core's re-export, so consumers keep naming
37
+ `'@weasel-js/core'` and never have to know this package exists.