@weasel-js/core 0.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 +381 -0
- package/LICENSE +21 -0
- package/README.md +144 -0
- package/dist/DrawCommand-Dl0bXNfS.d.ts +500 -0
- package/dist/chunk-775XXAHR.js +216 -0
- package/dist/chunk-775XXAHR.js.map +1 -0
- package/dist/chunk-7V6JEOXE.js +27754 -0
- package/dist/chunk-7V6JEOXE.js.map +1 -0
- package/dist/chunk-AM6ARSPN.js +517 -0
- package/dist/chunk-AM6ARSPN.js.map +1 -0
- package/dist/chunk-BGGZ4CVF.js +248 -0
- package/dist/chunk-BGGZ4CVF.js.map +1 -0
- package/dist/chunk-BHVYVFGV.js +29 -0
- package/dist/chunk-BHVYVFGV.js.map +1 -0
- package/dist/chunk-CQNKCG34.js +831 -0
- package/dist/chunk-CQNKCG34.js.map +1 -0
- package/dist/chunk-GVCNT7UH.js +47 -0
- package/dist/chunk-GVCNT7UH.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +9 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/chunk-UGFFCMQP.js +28 -0
- package/dist/chunk-UGFFCMQP.js.map +1 -0
- package/dist/chunk-VOVKONXA.js +103 -0
- package/dist/chunk-VOVKONXA.js.map +1 -0
- package/dist/chunk-Y52N27PF.js +39 -0
- package/dist/chunk-Y52N27PF.js.map +1 -0
- package/dist/clipboard.d.ts +91 -0
- package/dist/clipboard.js +6 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/clone.d.ts +8 -0
- package/dist/clone.js +6 -0
- package/dist/clone.js.map +1 -0
- package/dist/fitViewToBounds-evGsnR8Q.d.ts +62 -0
- package/dist/grid-Cf87knjU.d.ts +153 -0
- package/dist/index-DZBYMsHI.d.ts +1555 -0
- package/dist/index.css +121 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +10200 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/insert.d.ts +33 -0
- package/dist/insert.js +81 -0
- package/dist/insert.js.map +1 -0
- package/dist/move.d.ts +69 -0
- package/dist/move.js +145 -0
- package/dist/move.js.map +1 -0
- package/dist/options-BPPBWMa7.d.ts +64 -0
- package/dist/patterns-builtin.d.ts +55 -0
- package/dist/patterns-builtin.js +100 -0
- package/dist/patterns-builtin.js.map +1 -0
- package/dist/pointSnapToGrid-D7s7QmOF.d.ts +185 -0
- package/dist/registerFont-CP-wCsrz.d.ts +109 -0
- package/dist/registerTexture-BzHTLhD9.d.ts +25 -0
- package/dist/renderer.css +121 -0
- package/dist/renderer.css.map +1 -0
- package/dist/renderer.d.ts +376 -0
- package/dist/renderer.js +13 -0
- package/dist/renderer.js.map +1 -0
- package/dist/resize.d.ts +78 -0
- package/dist/resize.js +5 -0
- package/dist/resize.js.map +1 -0
- package/dist/routing.css +35 -0
- package/dist/routing.css.map +1 -0
- package/dist/routing.d.ts +14 -0
- package/dist/routing.js +4 -0
- package/dist/routing.js.map +1 -0
- package/dist/types-B6MMiodD.d.ts +59 -0
- package/dist/types-BJ8_cyT7.d.ts +130 -0
- package/dist/types-B_-khFM0.d.ts +331 -0
- package/dist/types-BjUi2vA-.d.ts +355 -0
- package/dist/types-Cpb4hii1.d.ts +445 -0
- package/dist/types-D2tTKEU0.d.ts +18 -0
- package/dist/view-DSQgxBJB.d.ts +63 -0
- package/package.json +96 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import { Op } from '@weasel-js/history';
|
|
2
|
+
import { S as SnapTarget, M as MoveAdapter, I as InsertAdapter } from './types-B_-khFM0.js';
|
|
3
|
+
|
|
4
|
+
/** Snapshot of modifier-key state at gesture dispatch. */
|
|
5
|
+
interface ModifierState {
|
|
6
|
+
alt: boolean;
|
|
7
|
+
shift: boolean;
|
|
8
|
+
meta: boolean;
|
|
9
|
+
ctrl: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Pointer position in both world and client coords. */
|
|
12
|
+
interface PointerState {
|
|
13
|
+
worldX: number;
|
|
14
|
+
worldY: number;
|
|
15
|
+
clientX: number;
|
|
16
|
+
clientY: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Per-gesture context passed to behaviors. `current` is the running pose
|
|
20
|
+
* map; behaviors mutate proposed poses by returning new TPose values from
|
|
21
|
+
* onMove. `scratch` is per-gesture key/value storage that resets at the
|
|
22
|
+
* next gesture start.
|
|
23
|
+
*/
|
|
24
|
+
interface GestureContext<TPose, TNode extends {
|
|
25
|
+
id: string;
|
|
26
|
+
} = {
|
|
27
|
+
id: string;
|
|
28
|
+
}> {
|
|
29
|
+
draggedIds: string[];
|
|
30
|
+
origin: Map<string, TPose>;
|
|
31
|
+
current: Map<string, TPose>;
|
|
32
|
+
snap: SnapTarget<TPose> | null;
|
|
33
|
+
modifiers: ModifierState;
|
|
34
|
+
pointer: PointerState;
|
|
35
|
+
adapter: MoveAdapter<TNode, TPose>;
|
|
36
|
+
/**
|
|
37
|
+
* Per-gesture mutable store. Keys should be namespaced by behavior name to avoid
|
|
38
|
+
* collisions: `'behaviorName'` for a single value, `'behaviorName.field'` for
|
|
39
|
+
* sub-keys. Two behaviors sharing a key will silently clobber each other.
|
|
40
|
+
*/
|
|
41
|
+
scratch: Record<string, unknown>;
|
|
42
|
+
}
|
|
43
|
+
/** Pluggable per-gesture snap rule; receives the proposed pose and returns a snapped pose or `null` to skip. */
|
|
44
|
+
interface SnapStrategy<TPose> {
|
|
45
|
+
snap(pose: TPose, ctx: GestureContext<TPose, {
|
|
46
|
+
id: string;
|
|
47
|
+
}>): TPose | null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Generalized base behavior. Each hook defines an alias that pins the
|
|
51
|
+
* proposed-pose shape (TProposed) and the onMove return shape (TMoveResult).
|
|
52
|
+
* onEnd is uniform: first non-undefined return wins (Op[] = commit those,
|
|
53
|
+
* null = abort, undefined = defer).
|
|
54
|
+
*
|
|
55
|
+
* `defaultTransient`: when at least one behavior in a gesture sets this true
|
|
56
|
+
* AND the hook's `options.transient` is not explicitly set, the gesture
|
|
57
|
+
* commits its ops via `adapter.applyOps(ops)` (no history entry). When
|
|
58
|
+
* `options.transient` is set explicitly, that value wins.
|
|
59
|
+
*/
|
|
60
|
+
interface ActionBehavior<TPose, TProposed, TMoveResult> {
|
|
61
|
+
defaultTransient?: boolean;
|
|
62
|
+
onStart?(ctx: GestureContext<TPose>): void;
|
|
63
|
+
onMove?(ctx: GestureContext<TPose>, proposed: TProposed): TMoveResult | void;
|
|
64
|
+
onEnd?(ctx: GestureContext<TPose>): Op[] | null | void;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Uniform group transform proposed by a gesture and shaped by behaviors.
|
|
68
|
+
* Applied identically to every dragged id so a multi-select gesture cannot
|
|
69
|
+
* drift apart (the historical bug: snap shifted only the primary, secondaries
|
|
70
|
+
* kept the raw cursor delta).
|
|
71
|
+
*
|
|
72
|
+
* v1 of the migration: only `'translate'` is wired end-to-end. `'scale'` and
|
|
73
|
+
* `'rotate'` exist for forward compatibility — `useResize` already remaps
|
|
74
|
+
* each leaf via `geom.remapBounds`, and `useRotate` is single-id-pivot-bound,
|
|
75
|
+
* so neither suffers the multi-select drift `'translate'` did. Migrate those
|
|
76
|
+
* gestures to emit `GroupTransform` in a follow-up.
|
|
77
|
+
*/
|
|
78
|
+
type GroupTransform = {
|
|
79
|
+
kind: 'translate';
|
|
80
|
+
dx: number;
|
|
81
|
+
dy: number;
|
|
82
|
+
} | {
|
|
83
|
+
kind: 'scale';
|
|
84
|
+
pivot: {
|
|
85
|
+
x: number;
|
|
86
|
+
y: number;
|
|
87
|
+
};
|
|
88
|
+
sx: number;
|
|
89
|
+
sy: number;
|
|
90
|
+
} | {
|
|
91
|
+
kind: 'rotate';
|
|
92
|
+
pivot: {
|
|
93
|
+
x: number;
|
|
94
|
+
y: number;
|
|
95
|
+
};
|
|
96
|
+
angle: number;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Per-frame result a `MoveBehavior.onMove` can return.
|
|
100
|
+
*
|
|
101
|
+
* `transform` is the new uniform-group-transform channel: the gesture applies
|
|
102
|
+
* it to every dragged id, eliminating multi-select drift.
|
|
103
|
+
*
|
|
104
|
+
* `pose` is the legacy channel: a primary-id-only override. The hook routes
|
|
105
|
+
* it through a back-compat shim that derives a `translate` transform from
|
|
106
|
+
* the pose diff against `origin.get(primaryId)`. Prefer `transform` in new
|
|
107
|
+
* behaviors; `pose` will be removed after one release cycle.
|
|
108
|
+
*
|
|
109
|
+
* `snap` announces a visual snap target; unchanged from the legacy contract.
|
|
110
|
+
*/
|
|
111
|
+
interface BehaviorResult<TPose> {
|
|
112
|
+
/** Replace the proposed transform. Applied uniformly to every id. */
|
|
113
|
+
transform?: GroupTransform;
|
|
114
|
+
/** @deprecated Return `transform` instead. Legacy primary-only pose override; supported via internal shim. */
|
|
115
|
+
pose?: TPose;
|
|
116
|
+
snap?: SnapTarget<TPose> | null;
|
|
117
|
+
}
|
|
118
|
+
/** @deprecated Renamed to `BehaviorResult`. Kept as an alias for one release cycle. */
|
|
119
|
+
type BehaviorMoveResult<TPose> = BehaviorResult<TPose>;
|
|
120
|
+
/** A behavior plugged into `useMove` — shapes the proposed transform during a drag.
|
|
121
|
+
* Behaviors receive a `GroupTransform` (currently always `'translate'` for
|
|
122
|
+
* `useMove`) and return a `BehaviorResult` shaping it (or, legacy, an
|
|
123
|
+
* override pose run through the back-compat shim). */
|
|
124
|
+
type MoveBehavior<TPose> = ActionBehavior<TPose, GroupTransform, BehaviorResult<TPose>>;
|
|
125
|
+
/** Which corner/edge of the rect stays fixed during a resize. */
|
|
126
|
+
type ResizeAnchor = {
|
|
127
|
+
x: 'min' | 'max' | 'free';
|
|
128
|
+
y: 'min' | 'max' | 'free';
|
|
129
|
+
};
|
|
130
|
+
/** Minimum rect-shaped pose required by the resize machinery. */
|
|
131
|
+
interface ResizePose {
|
|
132
|
+
x: number;
|
|
133
|
+
y: number;
|
|
134
|
+
width: number;
|
|
135
|
+
height: number;
|
|
136
|
+
}
|
|
137
|
+
/** Per-frame proposed resize: pose plus the anchor pinning the opposite corner. */
|
|
138
|
+
interface ResizeProposed<TPose extends ResizePose> {
|
|
139
|
+
pose: TPose;
|
|
140
|
+
anchor: ResizeAnchor;
|
|
141
|
+
}
|
|
142
|
+
/** Per-frame result a `BoundsConstraint.onMove` can return to override the proposed pose. */
|
|
143
|
+
interface ResizeMoveResult<TPose extends ResizePose> {
|
|
144
|
+
pose?: TPose;
|
|
145
|
+
}
|
|
146
|
+
/** A bounds-frame constraint plugged into `useResize` / `resizeAction`.
|
|
147
|
+
* Reads/writes `{x,y,width,height}` and can override the proposed pose
|
|
148
|
+
* on each frame (e.g. lock-aspect, clamp-min-size, snap-to-grid). */
|
|
149
|
+
type BoundsConstraint<TPose extends ResizePose> = ActionBehavior<TPose, ResizeProposed<TPose>, ResizeMoveResult<TPose>>;
|
|
150
|
+
/** Live overlay state exposed by `useResize` for rendering the in-flight resize ghost. */
|
|
151
|
+
interface ResizeOverlay<TPose> {
|
|
152
|
+
id: string;
|
|
153
|
+
currentPose: TPose;
|
|
154
|
+
targetPose: TPose;
|
|
155
|
+
anchor: ResizeAnchor;
|
|
156
|
+
/** Per-leaf scaled poses when the gesture is resizing a group.
|
|
157
|
+
* Keys are the expanded leaf ids (from `expandIds`); values are the
|
|
158
|
+
* per-leaf poses produced by scaling each leaf's origin pose against
|
|
159
|
+
* the group's origin/proposed union rects. Absent for single-leaf
|
|
160
|
+
* resizes. */
|
|
161
|
+
leafPoses?: Map<string, TPose>;
|
|
162
|
+
}
|
|
163
|
+
/** ResizePose extended with a rotation angle (radians). Pivot is the AABB
|
|
164
|
+
* center of the unrotated `{x, y, width, height}`. */
|
|
165
|
+
interface RotatedPose extends ResizePose {
|
|
166
|
+
rotation: number;
|
|
167
|
+
}
|
|
168
|
+
/** Per-frame proposed rotation: pose plus the candidate angle in radians. */
|
|
169
|
+
interface RotateProposed<TPose> {
|
|
170
|
+
pose: TPose;
|
|
171
|
+
/** Proposed rotation angle (radians). */
|
|
172
|
+
rotation: number;
|
|
173
|
+
}
|
|
174
|
+
/** Per-frame result a `RotateBehavior.onMove` can return to override the proposed pose. */
|
|
175
|
+
interface RotateMoveResult<TPose> {
|
|
176
|
+
pose?: TPose;
|
|
177
|
+
}
|
|
178
|
+
/** A behavior plugged into `useRotate`. */
|
|
179
|
+
type RotateBehavior<TPose> = ActionBehavior<TPose, RotateProposed<TPose>, RotateMoveResult<TPose>>;
|
|
180
|
+
/** Live overlay state exposed by `useRotate` for rendering the in-flight rotation ghost. */
|
|
181
|
+
interface RotateOverlay<TPose> {
|
|
182
|
+
id: string;
|
|
183
|
+
currentPose: TPose;
|
|
184
|
+
targetPose: TPose;
|
|
185
|
+
/** Origin pose at gesture start. */
|
|
186
|
+
originPose: TPose;
|
|
187
|
+
}
|
|
188
|
+
/** A single world-space point. Insert tracks two of these (start + current);
|
|
189
|
+
* bounds and pose are derived per-frame. */
|
|
190
|
+
interface InsertPoint {
|
|
191
|
+
x: number;
|
|
192
|
+
y: number;
|
|
193
|
+
}
|
|
194
|
+
/** Per-frame proposed insert: the two world points plus their derived bounds and pose. */
|
|
195
|
+
interface InsertProposed<TPose> {
|
|
196
|
+
start: InsertPoint;
|
|
197
|
+
current: InsertPoint;
|
|
198
|
+
bounds: ResizePose;
|
|
199
|
+
pose: TPose;
|
|
200
|
+
}
|
|
201
|
+
/** Per-frame result an `InsertBehavior.onMove` can return to override the start/current points. */
|
|
202
|
+
interface InsertMoveResult {
|
|
203
|
+
/** Override the start point (e.g. snap-to-grid on the anchor). */
|
|
204
|
+
start?: InsertPoint;
|
|
205
|
+
/** Override the current point (e.g. snap the live edge). */
|
|
206
|
+
current?: InsertPoint;
|
|
207
|
+
}
|
|
208
|
+
/** Behaviors operate over the two world points; bounds and pose are derived
|
|
209
|
+
* by the hook from the (possibly modified) points each frame. */
|
|
210
|
+
type InsertBehavior<TPose> = ActionBehavior<TPose, InsertProposed<TPose>, InsertMoveResult>;
|
|
211
|
+
/** Live overlay state exposed by `useInsert` for rendering the in-flight insert preview. */
|
|
212
|
+
interface InsertOverlay<TPose> {
|
|
213
|
+
start: InsertPoint;
|
|
214
|
+
current: InsertPoint;
|
|
215
|
+
/** Axis-aligned bounding rect derived from `start`/`current`. */
|
|
216
|
+
bounds: ResizePose;
|
|
217
|
+
/** TPose constructed from `bounds` via the hook's `posefromBounds`. */
|
|
218
|
+
pose: TPose;
|
|
219
|
+
}
|
|
220
|
+
/** Pose carried through area-select gestures: the world point under the
|
|
221
|
+
* cursor at gesture start, plus the shift-key state at start. */
|
|
222
|
+
interface AreaSelectPose {
|
|
223
|
+
worldX: number;
|
|
224
|
+
worldY: number;
|
|
225
|
+
shiftHeld: boolean;
|
|
226
|
+
}
|
|
227
|
+
/** Per-frame proposed area-select state: start point, current point, and shift policy. */
|
|
228
|
+
interface AreaSelectProposed {
|
|
229
|
+
start: {
|
|
230
|
+
worldX: number;
|
|
231
|
+
worldY: number;
|
|
232
|
+
};
|
|
233
|
+
current: {
|
|
234
|
+
worldX: number;
|
|
235
|
+
worldY: number;
|
|
236
|
+
};
|
|
237
|
+
shiftHeld: boolean;
|
|
238
|
+
}
|
|
239
|
+
/** onMove for area-select doesn't shape ops; behaviors only need to react in
|
|
240
|
+
* onEnd. We return void from onMove. */
|
|
241
|
+
type AreaSelectMoveResult = void;
|
|
242
|
+
/** A behavior plugged into `useAreaSelect`. */
|
|
243
|
+
type AreaSelectBehavior = ActionBehavior<AreaSelectPose, AreaSelectProposed, AreaSelectMoveResult>;
|
|
244
|
+
/** Live overlay state exposed by `useAreaSelect` for rendering the marquee. */
|
|
245
|
+
interface AreaSelectOverlay {
|
|
246
|
+
start: {
|
|
247
|
+
worldX: number;
|
|
248
|
+
worldY: number;
|
|
249
|
+
};
|
|
250
|
+
current: {
|
|
251
|
+
worldX: number;
|
|
252
|
+
worldY: number;
|
|
253
|
+
};
|
|
254
|
+
shiftHeld: boolean;
|
|
255
|
+
}
|
|
256
|
+
/** Pose carried through lasso-select gestures: the world point under the
|
|
257
|
+
* cursor at gesture start, plus the shift-key state at start. */
|
|
258
|
+
interface LassoSelectPose {
|
|
259
|
+
worldX: number;
|
|
260
|
+
worldY: number;
|
|
261
|
+
shiftHeld: boolean;
|
|
262
|
+
}
|
|
263
|
+
/** Per-frame proposed lasso state: full vertex history + shift policy. */
|
|
264
|
+
interface LassoSelectProposed {
|
|
265
|
+
vertices: ReadonlyArray<{
|
|
266
|
+
x: number;
|
|
267
|
+
y: number;
|
|
268
|
+
}>;
|
|
269
|
+
shiftHeld: boolean;
|
|
270
|
+
}
|
|
271
|
+
/** onMove for lasso-select doesn't shape ops; behaviors only need to react
|
|
272
|
+
* in onEnd. We return void from onMove. */
|
|
273
|
+
type LassoSelectMoveResult = void;
|
|
274
|
+
/** A behavior plugged into `useLassoSelect`. */
|
|
275
|
+
type LassoSelectBehavior = ActionBehavior<LassoSelectPose, LassoSelectProposed, LassoSelectMoveResult>;
|
|
276
|
+
/** Live overlay state exposed by `useLassoSelect` for rendering the
|
|
277
|
+
* in-progress polyline + dashed close-line. */
|
|
278
|
+
interface LassoSelectOverlay {
|
|
279
|
+
vertices: ReadonlyArray<{
|
|
280
|
+
x: number;
|
|
281
|
+
y: number;
|
|
282
|
+
}>;
|
|
283
|
+
current: {
|
|
284
|
+
worldX: number;
|
|
285
|
+
worldY: number;
|
|
286
|
+
};
|
|
287
|
+
shiftHeld: boolean;
|
|
288
|
+
}
|
|
289
|
+
/** Frames a point-snap behavior can return for the hook to back-solve. */
|
|
290
|
+
type PointSnapFrame = 'dragged-corner' | 'fixed-corner' | 'center' | 'origin';
|
|
291
|
+
/** Per-frame world-space context handed to `PointSnapBehavior.onMove`.
|
|
292
|
+
* `draggedCorner` and `fixedCorner` are `null` for edge drags
|
|
293
|
+
* (`anchor.x === 'free'` or `anchor.y === 'free'`). `center` and
|
|
294
|
+
* `origin` are always present. */
|
|
295
|
+
interface PointSnapContext<TPose extends ResizePose> {
|
|
296
|
+
draggedCorner: {
|
|
297
|
+
worldX: number;
|
|
298
|
+
worldY: number;
|
|
299
|
+
} | null;
|
|
300
|
+
fixedCorner: {
|
|
301
|
+
worldX: number;
|
|
302
|
+
worldY: number;
|
|
303
|
+
} | null;
|
|
304
|
+
center: {
|
|
305
|
+
worldX: number;
|
|
306
|
+
worldY: number;
|
|
307
|
+
};
|
|
308
|
+
origin: {
|
|
309
|
+
worldX: number;
|
|
310
|
+
worldY: number;
|
|
311
|
+
};
|
|
312
|
+
rotation: number;
|
|
313
|
+
anchor: ResizeAnchor;
|
|
314
|
+
proposed: TPose;
|
|
315
|
+
modifiers: ModifierState;
|
|
316
|
+
}
|
|
317
|
+
/** Per-frame snap result. A behavior returns at most one. */
|
|
318
|
+
interface PointSnapResult {
|
|
319
|
+
frame: PointSnapFrame;
|
|
320
|
+
worldX: number;
|
|
321
|
+
worldY: number;
|
|
322
|
+
}
|
|
323
|
+
/** A point-snap behavior plugged into `useResize`'s `pointSnapBehaviors`. */
|
|
324
|
+
interface PointSnapBehavior<TPose extends ResizePose> {
|
|
325
|
+
id?: string;
|
|
326
|
+
onMove(ctx: PointSnapContext<TPose>): PointSnapResult | null | undefined;
|
|
327
|
+
}
|
|
328
|
+
/** Pose carried through clone gestures: ids being cloned plus the pointer/offset state. */
|
|
329
|
+
interface ClonePose {
|
|
330
|
+
ids: string[];
|
|
331
|
+
offset: {
|
|
332
|
+
dx: number;
|
|
333
|
+
dy: number;
|
|
334
|
+
};
|
|
335
|
+
worldX: number;
|
|
336
|
+
worldY: number;
|
|
337
|
+
}
|
|
338
|
+
/** Layer category a clone targets — kit-level placeholder; consumers may narrow. */
|
|
339
|
+
type CloneLayer = 'structures' | 'zones' | 'plantings';
|
|
340
|
+
/** A behavior plugged into `useClone`; gates on modifier state and emits ops at gesture end. */
|
|
341
|
+
interface CloneBehavior {
|
|
342
|
+
id: string;
|
|
343
|
+
/** Default true. */
|
|
344
|
+
defaultTransient?: boolean;
|
|
345
|
+
/** Decides whether this gesture should activate at start. */
|
|
346
|
+
activates: (modifiers: ModifierState) => boolean;
|
|
347
|
+
/** On end, returns ops to commit (or [] for no-op). */
|
|
348
|
+
onEnd: (pose: ClonePose, ctx: {
|
|
349
|
+
adapter: InsertAdapter<{
|
|
350
|
+
id: string;
|
|
351
|
+
}>;
|
|
352
|
+
}) => Op[];
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export type { ActionBehavior as A, BoundsConstraint as B, CloneBehavior as C, ResizeMoveResult as D, ResizeOverlay as E, ResizeProposed as F, GestureContext as G, RotateMoveResult as H, InsertBehavior as I, RotateOverlay as J, RotateProposed as K, LassoSelectBehavior as L, ModifierState as M, PointSnapBehavior as P, ResizePose as R, SnapStrategy as S, MoveBehavior as a, RotatedPose as b, ResizeAnchor as c, PointSnapFrame as d, RotateBehavior as e, AreaSelectBehavior as f, AreaSelectMoveResult as g, AreaSelectOverlay as h, AreaSelectPose as i, AreaSelectProposed as j, BehaviorMoveResult as k, BehaviorResult as l, CloneLayer as m, ClonePose as n, GroupTransform as o, InsertMoveResult as p, InsertOverlay as q, InsertPoint as r, InsertProposed as s, LassoSelectMoveResult as t, LassoSelectOverlay as u, LassoSelectPose as v, LassoSelectProposed as w, PointSnapContext as x, PointSnapResult as y, PointerState as z };
|