@orbat-mapper/tactical-draw 0.22.1 → 0.24.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/dist/index.d.mts +89 -6
- package/dist/index.mjs +789 -343
- package/dist/{map-adapter-Btuz2FLI.d.mts → map-adapter-DoB8tiCc.d.mts} +92 -46
- package/dist/testing.d.mts +1 -1
- package/package.json +4 -3
|
@@ -166,6 +166,92 @@ declare class PinPresentationStore {
|
|
|
166
166
|
onChange(listener: (state: PinPresentationState) => void): () => void;
|
|
167
167
|
}
|
|
168
168
|
//#endregion
|
|
169
|
+
//#region src/gestures/types.d.ts
|
|
170
|
+
interface PointerEventInfo {
|
|
171
|
+
/** Per-event hit-tolerance override (e.g. larger for touch). */
|
|
172
|
+
hitTolerance?: number;
|
|
173
|
+
/**
|
|
174
|
+
* Whether Alt/Option was held. Modifiers are populated on mouse
|
|
175
|
+
* pointer-down; touch leaves them undefined. Which gesture reads which key
|
|
176
|
+
* is set by `TacticalDrawOptions.editModifiers` and `offsetDragModifier`.
|
|
177
|
+
*/
|
|
178
|
+
altKey?: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* Whether Shift was held for this pointer event. Constrain gestures read
|
|
181
|
+
* their key (Shift by default) live, on every move.
|
|
182
|
+
*/
|
|
183
|
+
shiftKey?: boolean;
|
|
184
|
+
/** Whether Control was held for this pointer event. */
|
|
185
|
+
ctrlKey?: boolean;
|
|
186
|
+
/** Whether Meta/Command was held for this pointer event. */
|
|
187
|
+
metaKey?: boolean;
|
|
188
|
+
/** Engine-native event, for drivers that need to call preventDefault etc. */
|
|
189
|
+
native?: unknown;
|
|
190
|
+
}
|
|
191
|
+
interface PointerCallback {
|
|
192
|
+
(pixel: PixelCoordinate, info?: PointerEventInfo): void;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Engine-agnostic pointer driver consumed by `TacticalDraw`'s edit controller.
|
|
196
|
+
* The controller owns handle rendering and hit-tests handles in lonLat space;
|
|
197
|
+
* the driver only carries raw pointer events, drag-pan toggle, and pixel
|
|
198
|
+
* projection.
|
|
199
|
+
*/
|
|
200
|
+
interface EditPointerDriver {
|
|
201
|
+
onPointerDown(cb: PointerCallback): () => void;
|
|
202
|
+
onPointerMove(cb: PointerCallback): () => void;
|
|
203
|
+
onPointerUp(cb: PointerCallback): () => void;
|
|
204
|
+
/**
|
|
205
|
+
* `false` holds the engine's own drag gestures for the duration of an edit
|
|
206
|
+
* drag — its drag-pan, and any other drag the engine binds to the same
|
|
207
|
+
* pointer (MapLibre's drag-rotate) — so the drag moves only the handle;
|
|
208
|
+
* `true` restores the ones the host had enabled. Despite the name it is not
|
|
209
|
+
* limited to panning.
|
|
210
|
+
*/
|
|
211
|
+
setDragPanEnabled(enabled: boolean): void;
|
|
212
|
+
toPixel(lonLat: Position): PixelCoordinate | null;
|
|
213
|
+
fromPixel(pixel: PixelCoordinate): Position;
|
|
214
|
+
/** Idempotent. */
|
|
215
|
+
dispose(): void;
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/tactical-draw/edit-modifiers.d.ts
|
|
219
|
+
/** A keyboard modifier a pointer gesture can read. */
|
|
220
|
+
type ModifierKey = "alt" | "shift" | "ctrl" | "meta";
|
|
221
|
+
/**
|
|
222
|
+
* Which modifier keys the editor's gestures listen for (#652). Each role takes
|
|
223
|
+
* a key or `false` to turn the gesture off; omitted roles keep their current
|
|
224
|
+
* key. See {@link TacticalDrawOptions.editModifiers}.
|
|
225
|
+
*/
|
|
226
|
+
interface EditModifiers {
|
|
227
|
+
/**
|
|
228
|
+
* Drag a vertex with this key held to hand the gesture to the definition's
|
|
229
|
+
* `modifierDrag` hook (e.g. a Flow Arrow split or merge). Any key in a list
|
|
230
|
+
* starts it.
|
|
231
|
+
* @default ["ctrl", "meta"]
|
|
232
|
+
*/
|
|
233
|
+
modifierDrag?: ModifierKey | readonly ModifierKey[] | false;
|
|
234
|
+
/**
|
|
235
|
+
* Click a vertex with this key held to delete it, or an option handle to
|
|
236
|
+
* reset its option. Must not share a key with `modifierDrag`.
|
|
237
|
+
* @default "alt"
|
|
238
|
+
*/
|
|
239
|
+
deleteOrReset?: ModifierKey | false;
|
|
240
|
+
/**
|
|
241
|
+
* Hold to constrain angles while drawing or dragging a vertex, and to step
|
|
242
|
+
* rotations in 15° increments.
|
|
243
|
+
* @default "shift"
|
|
244
|
+
*/
|
|
245
|
+
constrain?: ModifierKey | false;
|
|
246
|
+
}
|
|
247
|
+
/** {@link EditModifiers} with every role filled in, as `getEditModifiers()` returns it. */
|
|
248
|
+
interface ResolvedEditModifiers {
|
|
249
|
+
modifierDrag: readonly ModifierKey[] | false;
|
|
250
|
+
deleteOrReset: ModifierKey | false;
|
|
251
|
+
constrain: ModifierKey | false;
|
|
252
|
+
}
|
|
253
|
+
declare const DEFAULT_EDIT_MODIFIERS: ResolvedEditModifiers;
|
|
254
|
+
//#endregion
|
|
169
255
|
//#region src/point-symbol.d.ts
|
|
170
256
|
type PointSymbolSize = {
|
|
171
257
|
value: number;
|
|
@@ -205,8 +291,11 @@ type PointSymbolPlacement = {
|
|
|
205
291
|
mode: "ground";
|
|
206
292
|
position: Position;
|
|
207
293
|
};
|
|
208
|
-
/**
|
|
209
|
-
|
|
294
|
+
/**
|
|
295
|
+
* Modifier that temporarily activates offset placement for a body drag.
|
|
296
|
+
* @deprecated Use {@link ModifierKey}; kept as an alias.
|
|
297
|
+
*/
|
|
298
|
+
type OffsetDragModifier = ModifierKey;
|
|
210
299
|
type PointSymbolConnector = "auto" | "direct";
|
|
211
300
|
/** Optional connector overrides; omitted properties inherit symbol styling. */
|
|
212
301
|
interface PointSymbolOffsetStyle {
|
|
@@ -314,49 +403,6 @@ declare function clonePointSymbol(symbol: PointSymbol): PointSymbol;
|
|
|
314
403
|
*/
|
|
315
404
|
declare function resizePointSymbolSize(size: PointSymbolSize, value: number): PointSymbolSize;
|
|
316
405
|
//#endregion
|
|
317
|
-
//#region src/gestures/types.d.ts
|
|
318
|
-
interface PointerEventInfo {
|
|
319
|
-
/** Per-event hit-tolerance override (e.g. larger for touch). */
|
|
320
|
-
hitTolerance?: number;
|
|
321
|
-
/**
|
|
322
|
-
* Whether Alt/Option was held. Used for Alt+click vertex deletion and the
|
|
323
|
-
* optional point-symbol offset shortcut. Modifiers are populated on mouse
|
|
324
|
-
* pointer-down; touch leaves them undefined.
|
|
325
|
-
*/
|
|
326
|
-
altKey?: boolean;
|
|
327
|
-
/**
|
|
328
|
-
* Whether Shift was held for this pointer event. Rotation gestures use the
|
|
329
|
-
* live value to constrain transform-box angles to 15-degree increments.
|
|
330
|
-
* Point-symbol offset shortcuts read their configured modifier on pointer-down.
|
|
331
|
-
*/
|
|
332
|
-
shiftKey?: boolean;
|
|
333
|
-
/** Whether Control was held for this pointer event. */
|
|
334
|
-
ctrlKey?: boolean;
|
|
335
|
-
/** Whether Meta/Command was held for this pointer event. */
|
|
336
|
-
metaKey?: boolean;
|
|
337
|
-
/** Engine-native event, for drivers that need to call preventDefault etc. */
|
|
338
|
-
native?: unknown;
|
|
339
|
-
}
|
|
340
|
-
interface PointerCallback {
|
|
341
|
-
(pixel: PixelCoordinate, info?: PointerEventInfo): void;
|
|
342
|
-
}
|
|
343
|
-
/**
|
|
344
|
-
* Engine-agnostic pointer driver consumed by `TacticalDraw`'s edit controller.
|
|
345
|
-
* The controller owns handle rendering and hit-tests handles in lonLat space;
|
|
346
|
-
* the driver only carries raw pointer events, drag-pan toggle, and pixel
|
|
347
|
-
* projection.
|
|
348
|
-
*/
|
|
349
|
-
interface EditPointerDriver {
|
|
350
|
-
onPointerDown(cb: PointerCallback): () => void;
|
|
351
|
-
onPointerMove(cb: PointerCallback): () => void;
|
|
352
|
-
onPointerUp(cb: PointerCallback): () => void;
|
|
353
|
-
setDragPanEnabled(enabled: boolean): void;
|
|
354
|
-
toPixel(lonLat: Position): PixelCoordinate | null;
|
|
355
|
-
fromPixel(pixel: PixelCoordinate): Position;
|
|
356
|
-
/** Idempotent. */
|
|
357
|
-
dispose(): void;
|
|
358
|
-
}
|
|
359
|
-
//#endregion
|
|
360
406
|
//#region src/fill-pattern.d.ts
|
|
361
407
|
/**
|
|
362
408
|
* Shared hatch fill-pattern tiles for area control-measure fills (ADR-0035
|
|
@@ -753,4 +799,4 @@ interface MapAdapter {
|
|
|
753
799
|
getLayerFeatures(layerId: LayerId): readonly Feature[];
|
|
754
800
|
}
|
|
755
801
|
//#endregion
|
|
756
|
-
export {
|
|
802
|
+
export { PinPresentationCapability as $, PointSymbolConnector as A, isPointSymbol as B, makeFillPatternImage as C, PointSymbolAnchor as D, PointSymbol as E, PointSymbolRect as F, ResolvedEditModifiers as G, DEFAULT_EDIT_MODIFIERS as H, PointSymbolRender as I, PointerEventInfo as J, EditPointerDriver as K, PointSymbolSize as L, PointSymbolOffset as M, PointSymbolOffsetStyle as N, PointSymbolCapability as O, PointSymbolPlacement as P, PinPresentation as Q, PointSymbolStyle as R, isMinePattern as S, OffsetDragModifier as T, EditModifiers as U, resizePointSymbolSize as V, ModifierKey as W, PinFootprint as X, DEFAULT_PIN_PRESENTATION as Y, PinOverridePatch as Z, HatchPattern as _, LayerId as a, PinRender as at, fillPatternImageDimension as b, MapEvent as c, pinDistanceScale as ct, PickHandler as d, PinPresentationPatch as et, PickOptions as f, HATCH_PATTERNS as g, TextStyleOptions as h, ImageOverlayResource as i, PinPresentationStore as it, PointSymbolGraphicModifiers as j, PointSymbolColors as k, MapEventHandler as l, pinZoomScale as lt, StyleOptions as m, HandleStyle as n, PinPresentationStatus as nt, MapAdapter as o, combinePinScale as ot, PixelCoordinate as p, PointerCallback as q, IconResource as r, PinPresentationStatusEvent as rt, MapCursor as s, isValidPinNumber as st, FeatureGroup as t, PinPresentationState as tt, PickEvent as u, resolvePinPresentation as ut, MINE_PATTERN_TILE_SIZE as v, parseColor as w, fillPatternImageId as x, Rgba as y, clonePointSymbol as z };
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as LayerId, o as MapAdapter, p as PixelCoordinate } from "./map-adapter-
|
|
1
|
+
import { a as LayerId, o as MapAdapter, p as PixelCoordinate } from "./map-adapter-DoB8tiCc.mjs";
|
|
2
2
|
import { Feature } from "geojson";
|
|
3
3
|
|
|
4
4
|
//#region src/testing/feature-group-conformance.d.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orbat-mapper/tactical-draw",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "Engine-agnostic draw/edit core for tactical control measures (MIL-STD-2525 / APP-6). The MapAdapter ABI and bring-your-own-engine entry point for the tactical-draw package family.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Orbat Mapper",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@orbat-mapper/control-measures": "^0.
|
|
42
|
+
"@orbat-mapper/control-measures": "^0.40.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"vitest": ">=4.0.0"
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build": "tsdown",
|
|
64
64
|
"test": "vitest run",
|
|
65
|
-
"lint": "eslint . --fix"
|
|
65
|
+
"lint": "eslint . --fix",
|
|
66
|
+
"typecheck": "tsc --noEmit"
|
|
66
67
|
}
|
|
67
68
|
}
|