@weasel-js/core 1.4.4 → 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 +937 -2202
- package/README.md +118 -75
- package/dist/{autoPoseDescriptor-DF1SnnSx.d.ts → autoPoseDescriptor-CvjflWJK.d.ts} +29 -26
- package/dist/{chunk-2VXGHUVL.js → chunk-BDWAA634.js} +4 -22
- package/dist/chunk-BDWAA634.js.map +1 -0
- package/dist/{chunk-R3AWPTLZ.js → chunk-MG7OXCAI.js} +2760 -4491
- package/dist/chunk-MG7OXCAI.js.map +1 -0
- package/dist/{chunk-PRGBGMH3.js → chunk-MQI4PIX3.js} +3 -3
- package/dist/chunk-MQI4PIX3.js.map +1 -0
- package/dist/{chunk-WPM42WJP.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-0Pbn5B2C.d.ts → grid-BrIa38gG.d.ts} +7 -10
- package/dist/index.d.ts +1996 -1229
- 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-DbYLImvq.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 -12
- 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-ei3UMl9R.d.ts → types-DMyo7dnM.d.ts} +12 -41
- package/dist/{types-DEALFt5F.d.ts → types-DtjCJA5r.d.ts} +9 -3
- package/package.json +13 -10
- package/dist/DrawCommand-CD-ug3d9.d.ts +0 -332
- package/dist/builtins-BXFBXegF.d.ts +0 -840
- package/dist/chunk-2VXGHUVL.js.map +0 -1
- package/dist/chunk-BL65SHCX.js +0 -573
- package/dist/chunk-BL65SHCX.js.map +0 -1
- package/dist/chunk-PRGBGMH3.js.map +0 -1
- package/dist/chunk-R3AWPTLZ.js.map +0 -1
- package/dist/chunk-WPM42WJP.js.map +0 -1
- package/dist/geometry-6fCNhAux.d.ts +0 -114
- package/dist/path-JEV2c5If.d.ts +0 -48
- package/dist/registry-BY-wI9gm.d.ts +0 -4003
- package/dist/types-BHK2dkMu.d.ts +0 -172
- package/dist/types-bcc7jcUy.d.ts +0 -594
- package/dist/view-DSQgxBJB.d.ts +0 -63
package/dist/types-BHK2dkMu.d.ts
DELETED
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
/** One bit per debug feature; absent keys are off. */
|
|
2
|
-
interface DebugConfig {
|
|
3
|
-
hitboxes?: boolean;
|
|
4
|
-
handles?: boolean;
|
|
5
|
-
bounds?: boolean;
|
|
6
|
-
origins?: boolean;
|
|
7
|
-
snap?: boolean;
|
|
8
|
-
layers?: boolean;
|
|
9
|
-
/** Render each tracked node's id as a label at the top-left of its
|
|
10
|
-
* bounds. Pulls from the same `recordBounds` stream `bounds` uses, so
|
|
11
|
-
* no extra sink calls are required to enable. */
|
|
12
|
-
ids?: boolean;
|
|
13
|
-
/** Rolling FPS counter rendered in the top-left corner of the canvas.
|
|
14
|
-
* Tracks the rate at which the debug overlay's draw callback runs;
|
|
15
|
-
* this matches the canvas's effective repaint rate. */
|
|
16
|
-
fps?: boolean;
|
|
17
|
-
/** Optional per-feature color overrides; falls back to the default theme. */
|
|
18
|
-
theme?: Partial<DebugTheme>;
|
|
19
|
-
/** Optional per-feature line-width / dash overrides; falls back to
|
|
20
|
-
* {@link DEFAULT_DEBUG_STROKES}. */
|
|
21
|
-
strokes?: Partial<DebugStrokes>;
|
|
22
|
-
}
|
|
23
|
-
/** The name of one debug-overlay feature — the keys of {@link DebugConfig}
|
|
24
|
-
* that toggle a visualization. */
|
|
25
|
-
type DebugFeature = 'hitboxes' | 'handles' | 'bounds' | 'origins' | 'snap' | 'layers' | 'ids' | 'fps';
|
|
26
|
-
/** Colors the debug overlay draws with, one entry per feature. */
|
|
27
|
-
interface DebugTheme {
|
|
28
|
-
hitboxFill: string;
|
|
29
|
-
hitboxStroke: string;
|
|
30
|
-
handle: string;
|
|
31
|
-
bounds: string;
|
|
32
|
-
origin: string;
|
|
33
|
-
snap: string;
|
|
34
|
-
layerText: string;
|
|
35
|
-
layerTextBg: string;
|
|
36
|
-
/** Color for the per-node id label rendered when `config.ids` is on. */
|
|
37
|
-
idText: string;
|
|
38
|
-
/** Foreground / background for the FPS panel. */
|
|
39
|
-
fpsText: string;
|
|
40
|
-
fpsTextBg: string;
|
|
41
|
-
}
|
|
42
|
-
/** Line width and dash pattern for one stroked debug feature. An empty (or
|
|
43
|
-
* omitted) `dash` is a solid line. */
|
|
44
|
-
interface DebugStroke {
|
|
45
|
-
width: number;
|
|
46
|
-
dash?: readonly number[];
|
|
47
|
-
}
|
|
48
|
-
/** The stroked half of the debug overlay's appearance, split from
|
|
49
|
-
* {@link DebugTheme} because only some features draw a line at all — text
|
|
50
|
-
* panels and filled origin dots take color and nothing else. */
|
|
51
|
-
interface DebugStrokes {
|
|
52
|
-
hitbox: DebugStroke;
|
|
53
|
-
bounds: DebugStroke;
|
|
54
|
-
handle: DebugStroke;
|
|
55
|
-
/** Rejected snap candidates only; accepted ones paint as a filled dot. */
|
|
56
|
-
snap: DebugStroke;
|
|
57
|
-
}
|
|
58
|
-
/** Which kind of handle a recorded handle marker represents. */
|
|
59
|
-
type HandleKind = 'corner' | 'rotation' | 'anchor';
|
|
60
|
-
/** The geometry a hit region actually tests against, as reported to the debug
|
|
61
|
-
* sink so the overlay can draw the real shape rather than its bounding box. */
|
|
62
|
-
type HitShape = {
|
|
63
|
-
kind: 'rect';
|
|
64
|
-
x: number;
|
|
65
|
-
y: number;
|
|
66
|
-
width: number;
|
|
67
|
-
height: number;
|
|
68
|
-
rotation?: number;
|
|
69
|
-
} | {
|
|
70
|
-
kind: 'circle';
|
|
71
|
-
cx: number;
|
|
72
|
-
cy: number;
|
|
73
|
-
r: number;
|
|
74
|
-
} | {
|
|
75
|
-
kind: 'path';
|
|
76
|
-
d: Path2D;
|
|
77
|
-
};
|
|
78
|
-
/** A hit region tested during the current frame. */
|
|
79
|
-
interface RecordedHitbox {
|
|
80
|
-
id: string;
|
|
81
|
-
kind: 'body' | 'handle' | 'rotation' | 'anchor';
|
|
82
|
-
shape: HitShape;
|
|
83
|
-
}
|
|
84
|
-
/** A handle drawn during the current frame, and where. */
|
|
85
|
-
interface RecordedHandle {
|
|
86
|
-
id: string;
|
|
87
|
-
position: {
|
|
88
|
-
x: number;
|
|
89
|
-
y: number;
|
|
90
|
-
};
|
|
91
|
-
kind: HandleKind;
|
|
92
|
-
}
|
|
93
|
-
/** A node's bounds as computed during the current frame. */
|
|
94
|
-
interface RecordedBounds {
|
|
95
|
-
id: string;
|
|
96
|
-
bounds: {
|
|
97
|
-
x: number;
|
|
98
|
-
y: number;
|
|
99
|
-
width: number;
|
|
100
|
-
height: number;
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
/** A node's transform origin as used during the current frame. */
|
|
104
|
-
interface RecordedOrigin {
|
|
105
|
-
id: string;
|
|
106
|
-
point: {
|
|
107
|
-
x: number;
|
|
108
|
-
y: number;
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
/** A snap candidate considered during the current gesture, and whether it
|
|
112
|
-
* won. Unlike the other records these survive across frames, until the
|
|
113
|
-
* gesture ends. */
|
|
114
|
-
interface RecordedSnap {
|
|
115
|
-
point: {
|
|
116
|
-
x: number;
|
|
117
|
-
y: number;
|
|
118
|
-
};
|
|
119
|
-
accepted: boolean;
|
|
120
|
-
}
|
|
121
|
-
/** A render layer that drew during the current frame. */
|
|
122
|
-
interface RecordedLayer {
|
|
123
|
-
id: string;
|
|
124
|
-
label: string;
|
|
125
|
-
space: 'world' | 'screen';
|
|
126
|
-
index: number;
|
|
127
|
-
}
|
|
128
|
-
/** Everything the sink collected, ready for the overlay to draw. */
|
|
129
|
-
interface DebugSnapshot {
|
|
130
|
-
hitboxes: RecordedHitbox[];
|
|
131
|
-
handles: RecordedHandle[];
|
|
132
|
-
bounds: RecordedBounds[];
|
|
133
|
-
origins: RecordedOrigin[];
|
|
134
|
-
snap: RecordedSnap[];
|
|
135
|
-
layers: RecordedLayer[];
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Where the kit reports what it is doing so the debug overlay can draw it.
|
|
139
|
-
*
|
|
140
|
-
* Recording is push-based and cheap: hit-testers, handle painters and snap
|
|
141
|
-
* strategies call these as they run, whether or not any overlay is watching.
|
|
142
|
-
* Nothing here affects behavior — a sink that discards everything is a valid
|
|
143
|
-
* sink.
|
|
144
|
-
*/
|
|
145
|
-
interface DebugSink {
|
|
146
|
-
recordHitbox(id: string, kind: 'body' | 'handle' | 'rotation' | 'anchor', shape: HitShape): void;
|
|
147
|
-
recordHandle(id: string, position: {
|
|
148
|
-
x: number;
|
|
149
|
-
y: number;
|
|
150
|
-
}, kind: HandleKind): void;
|
|
151
|
-
recordBounds(id: string, bounds: {
|
|
152
|
-
x: number;
|
|
153
|
-
y: number;
|
|
154
|
-
width: number;
|
|
155
|
-
height: number;
|
|
156
|
-
}): void;
|
|
157
|
-
recordOrigin(id: string, point: {
|
|
158
|
-
x: number;
|
|
159
|
-
y: number;
|
|
160
|
-
}): void;
|
|
161
|
-
recordSnapCandidate(point: {
|
|
162
|
-
x: number;
|
|
163
|
-
y: number;
|
|
164
|
-
}, accepted: boolean): void;
|
|
165
|
-
recordLayer(id: string, label: string, space: 'world' | 'screen', index: number): void;
|
|
166
|
-
/** Clears every non-snap array. Called at the start of each Canvas render. */
|
|
167
|
-
beginFrame(): void;
|
|
168
|
-
/** Clears the snap array. Called at gesture end. */
|
|
169
|
-
clearSnap(): void;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
export type { DebugSink as D, HandleKind as H, RecordedBounds as R, DebugConfig as a, DebugSnapshot as b, DebugStrokes as c, DebugTheme as d, DebugFeature as e, DebugStroke as f, HitShape as g, RecordedHandle as h, RecordedHitbox as i, RecordedLayer as j, RecordedOrigin as k, RecordedSnap as l };
|