@orbat-mapper/tactical-draw 0.2.0-alpha.36 → 0.2.0-alpha.37
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.mjs +14 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2342,6 +2342,15 @@ function runEditInteraction(spec) {
|
|
|
2342
2342
|
/**
|
|
2343
2343
|
* Consume exactly one trailing click without closing — set through
|
|
2344
2344
|
* `shell.suppressNextClickAway()` on delete / label-drag / post-drag paths.
|
|
2345
|
+
*
|
|
2346
|
+
* The suppression is scoped to the pointer cycle that armed it: it is cleared
|
|
2347
|
+
* again on the next `pointerdown` (see the `onDown` wrapper below). Hosts do
|
|
2348
|
+
* not agree on whether a completed drag is followed by a `click` at all —
|
|
2349
|
+
* MapLibre swallows its `click` when the pointer moved beyond its 3px
|
|
2350
|
+
* `clickTolerance`, while Leaflet delivers one. Without the reset, a
|
|
2351
|
+
* suppression armed after a real drag on MapLibre survives into the *next*
|
|
2352
|
+
* pointer cycle and eats the user's first genuine click-away, so exiting the
|
|
2353
|
+
* edit takes two clicks instead of one.
|
|
2345
2354
|
*/
|
|
2346
2355
|
let suppressClickAway = false;
|
|
2347
2356
|
/** A zero-movement body drag released this pointer cycle — set through `shell.noteBodyClick()`. */
|
|
@@ -2437,7 +2446,11 @@ function runEditInteraction(spec) {
|
|
|
2437
2446
|
writeLayer: interaction.writeLayer,
|
|
2438
2447
|
onTeardown: interaction.onTeardown
|
|
2439
2448
|
};
|
|
2440
|
-
const
|
|
2449
|
+
const onDown = (pixel, info) => {
|
|
2450
|
+
suppressClickAway = false;
|
|
2451
|
+
spec.onDown(pixel, info);
|
|
2452
|
+
};
|
|
2453
|
+
const unsubDown = driver.onPointerDown(onDown);
|
|
2441
2454
|
const unsubMove = driver.onPointerMove(spec.onMove);
|
|
2442
2455
|
const unsubUp = driver.onPointerUp(spec.onUp);
|
|
2443
2456
|
const unsubPreview = adapter.onPick(previewLayer, onPreviewPick);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orbat-mapper/tactical-draw",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.37",
|
|
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",
|