@weasel-js/core 1.4.3 → 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/CHANGELOG.md +1299 -2197
- package/README.md +118 -75
- package/dist/{pointSnapToGrid-D1bRdq-j.d.ts → autoPoseDescriptor-CvjflWJK.d.ts} +35 -17
- package/dist/{chunk-ORZNKVXM.js → chunk-BDWAA634.js} +4 -22
- package/dist/chunk-BDWAA634.js.map +1 -0
- package/dist/{chunk-WYPSGIYS.js → chunk-MG7OXCAI.js} +4149 -5316
- package/dist/chunk-MG7OXCAI.js.map +1 -0
- package/dist/{chunk-BLJNRMKB.js → chunk-MQI4PIX3.js} +3 -3
- package/dist/chunk-MQI4PIX3.js.map +1 -0
- package/dist/{chunk-SBFC6J3C.js → chunk-UCPV7JXC.js} +201 -256
- package/dist/chunk-UCPV7JXC.js.map +1 -0
- package/dist/clipboard.d.ts +2 -3
- package/dist/clone.d.ts +3 -2
- package/dist/depSchema-nMqj_qTM.d.ts +3490 -0
- package/dist/{grid-Bw8cSde-.d.ts → grid-BrIa38gG.d.ts} +7 -23
- package/dist/index.d.ts +2134 -1210
- package/dist/index.js +4 -5
- package/dist/insert.d.ts +4 -4
- package/dist/insert.js +1 -1
- package/dist/move.d.ts +5 -6
- package/dist/move.js +3 -6
- package/dist/move.js.map +1 -1
- package/dist/{options-DYfUlZxk.d.ts → options-BDyCnrp8.d.ts} +3 -2
- package/dist/poseDescriptor-CGOgIgf8.d.ts +134 -0
- package/dist/renderer.d.ts +10 -4
- package/dist/renderer.js +4 -5
- package/dist/resize.d.ts +10 -11
- package/dist/resize.js +2 -2
- package/dist/routing.d.ts +1 -142
- package/dist/routing.js +1 -1
- package/dist/routing.js.map +1 -1
- package/dist/{types-BJqsTlXl.d.ts → types-DMyo7dnM.d.ts} +12 -41
- package/dist/{types-CoVTbo_y.d.ts → types-DtjCJA5r.d.ts} +10 -9
- package/package.json +13 -10
- package/dist/DrawCommand-CD-ug3d9.d.ts +0 -332
- package/dist/builtins-CtGORLCG.d.ts +0 -740
- package/dist/chunk-BLJNRMKB.js.map +0 -1
- package/dist/chunk-LEURURX3.js +0 -561
- package/dist/chunk-LEURURX3.js.map +0 -1
- package/dist/chunk-ORZNKVXM.js.map +0 -1
- package/dist/chunk-SBFC6J3C.js.map +0 -1
- package/dist/chunk-WYPSGIYS.js.map +0 -1
- package/dist/geometry-CHR36Ub_.d.ts +0 -114
- package/dist/path-JEV2c5If.d.ts +0 -48
- package/dist/registry-DnoTWGED.d.ts +0 -4003
- package/dist/types-BHK2dkMu.d.ts +0 -172
- package/dist/types-H7o6MaPo.d.ts +0 -512
- package/dist/view-DSQgxBJB.d.ts +0 -63
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { M as MoveBehavior, S as SnapStrategy } from './types-DMyo7dnM.js';
|
|
2
|
+
import { DebugSink } from '@weasel-js/routing';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Units — a tiny customizable unit system for canvas-kit APIs.
|
|
@@ -45,6 +45,8 @@ declare function formatUnit(baseValue: number, displayUnit: Unit, unitSystem: Un
|
|
|
45
45
|
declare const IMPERIAL_INCHES: UnitSystem;
|
|
46
46
|
/** Metric unit system with base 'mm'. */
|
|
47
47
|
declare const METRIC_MM: UnitSystem;
|
|
48
|
+
/** Angle unit system with base 'rad'. */
|
|
49
|
+
declare const ANGLE_RADIANS: UnitSystem;
|
|
48
50
|
/** Pixel unit system — sole unit is the base. */
|
|
49
51
|
declare const PIXELS: UnitSystem;
|
|
50
52
|
|
|
@@ -55,14 +57,9 @@ declare const PIXELS: UnitSystem;
|
|
|
55
57
|
* Consumers should import from here directly; `move.ts` re-exports the
|
|
56
58
|
* same symbol for back-compat. */
|
|
57
59
|
|
|
58
|
-
/** Options for the `move` action:
|
|
59
|
-
*
|
|
60
|
+
/** Options for the `move` action: the behaviors (snapping, momentum) layered
|
|
61
|
+
* over the raw drag, and how a gesture expands a group into its leaves. */
|
|
60
62
|
interface UseMoveOptions<TPose> {
|
|
61
|
-
/** How to apply a `(dx, dy)` translation to a pose. Defaults to
|
|
62
|
-
* `translateRectPose`, which assumes the pose carries top-level
|
|
63
|
-
* `x`/`y` (the common rect-shaped case). Override for non-rect poses
|
|
64
|
-
* (e.g. `Path` → `translatePath`). */
|
|
65
|
-
translatePose?: (pose: TPose, dx: number, dy: number) => TPose;
|
|
66
63
|
behaviors?: MoveBehavior<TPose>[];
|
|
67
64
|
dragThresholdPx?: number;
|
|
68
65
|
moveLabel?: string;
|
|
@@ -78,19 +75,6 @@ interface UseMoveOptions<TPose> {
|
|
|
78
75
|
* generation. Returning `[]` aborts the gesture cleanly.
|
|
79
76
|
* Default: identity. */
|
|
80
77
|
expandIds?: (ids: string[]) => string[];
|
|
81
|
-
/** Optional: lookup a world-space pose by id. When supplied alongside
|
|
82
|
-
* `adapter.getChildren`, the hook walks each dragged id's descendants and
|
|
83
|
-
* includes them in the live overlay (translated by the same drag delta
|
|
84
|
-
* and added to `overlay.hideIds`) so structurally-grouped children visually
|
|
85
|
-
* follow the parent during the gesture. No transform ops are generated
|
|
86
|
-
* for cascaded ids — under local-pose semantics, a child's local pose is
|
|
87
|
-
* unchanged when its parent's local pose moves, so the post-commit scene
|
|
88
|
-
* is already correct.
|
|
89
|
-
*
|
|
90
|
-
* Pair with `worldPoseLookup(adapter, composeRectPose)` from
|
|
91
|
-
* `@weasel-js/core/transforms` for the standard rect case. Returning
|
|
92
|
-
* `null` for an id (e.g., one removed mid-render) skips it. */
|
|
93
|
-
cascadeWorldPose?: (id: string) => TPose | null;
|
|
94
78
|
}
|
|
95
79
|
|
|
96
80
|
/**
|
|
@@ -155,4 +139,4 @@ declare function pointToGridCell(point: {
|
|
|
155
139
|
row: number;
|
|
156
140
|
};
|
|
157
141
|
|
|
158
|
-
export { IMPERIAL_INCHES as I, METRIC_MM as M, type OriginProjection as O, PIXELS as P, RECT_ORIGIN_PROJECTION as R, type UseMoveOptions as U, type UnitValue as a, type UnitSystem as b, type Unit as c, formatUnit as f, gridSnapStrategy as g, pointToGridCell as p, resolveUnit as r };
|
|
142
|
+
export { ANGLE_RADIANS as A, IMPERIAL_INCHES as I, METRIC_MM as M, type OriginProjection as O, PIXELS as P, RECT_ORIGIN_PROJECTION as R, type UseMoveOptions as U, type UnitValue as a, type UnitSystem as b, type Unit as c, formatUnit as f, gridSnapStrategy as g, pointToGridCell as p, resolveUnit as r };
|