@weasel-js/path-tools 0.0.0-stage → 1.10.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.
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 CHANGED
@@ -1,3 +1,48 @@
1
- # Temporary Holding Version
1
+ # @weasel-js/path-tools
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Path-editing tools for a weasel canvas, each family a preset an app turns on
4
+ beside core's own.
5
+
6
+ Part of [weasel](https://github.com/orochi235/weasel), a domain-agnostic 2D
7
+ scene-graph canvas kit for React. See the
8
+ [API reference](https://orochi235.github.io/weasel/#pkg/path-tools).
9
+
10
+ ```sh
11
+ npm install @weasel-js/path-tools
12
+ ```
13
+
14
+ Core keeps basic path editing: anchors and handles, bending a segment, Join,
15
+ Average, Cut at crossings, Simplify, and Offset. This package adds the rest,
16
+ on core's public surface:
17
+
18
+ ```tsx
19
+ import { SceneCanvas } from '@weasel-js/core';
20
+ import { pathTools } from '@weasel-js/path-tools';
21
+
22
+ <SceneCanvas scene={scene} features={['draw', pathTools]} />;
23
+ ```
24
+
25
+ `pathTools` turns every family on. Each is also a preset of its own, and an app
26
+ that imports only some never loads the others:
27
+
28
+ | Preset | What it adds |
29
+ |---|---|
30
+ | `simplifyBrushPreset` | The Simplify brush, a path-edit tool that refits the curve it passes over |
31
+ | `handleLocksPreset` | The `handleLock.angle` and `handleLock.length` toggles |
32
+ | `bridgePreset` | Bridge: join open ends with a curve along each end's heading, on paths or on two anchors |
33
+ | `trimPreset`, `extendPreset`, `smudgePreset` | The actions `useTrimTool`, `useExtendTool`, and `useSmudgeBrushTool` bind |
34
+ | `harmonizePreset` | Harmonize curvature |
35
+ | `curvatureCombPreset` | The curvature comb over the open path, under chrome id `path-edit.comb` |
36
+ | `balancePreset` | Balance handles and Equalize, from grips under chrome id `path-edit.balance` |
37
+ | `constraintsPreset` | Path constraints: the actions, their marks, and every edit finished so they hold |
38
+ | `pathEffectsPreset` | Blend, Bend along, and Repeat along, and the actions that edit and expand them |
39
+ | `warpPreset` | Expand and configure a held warp; `useDistortTool`, `useEnvelopeTool`, and `usePuppetTool` bring their own drags |
40
+
41
+ The comb, balance lines, and constraint marks are off until chrome-caps shows
42
+ them, and `createCurvatureCombPreset`, `createBalancePreset`, and
43
+ `createConstraintsPreset` take their look. They reach path edit through core's
44
+ `PathEditExtension`: marks drawn on the open path, parts of it to press, marks
45
+ a click selects and Delete removes, and what an edit keeps true.
46
+
47
+ The tools are hooks, mounted with `<SceneCanvas tools>` as core's are; each
48
+ binds an action its family's preset registers, so turn on both.